Commit d57d0db
committed
fix: Remove hardcoded port for livesync on Android
Currently the LiveSync operations on Android devices uses a hardcoded port - 18182 to wait for a message from the runtime and determines if we should clean the LiveSync temp directories on the device.
The port forwarding is executed every time on all of the devices. This is a problem when the hardcoded port is already used by another application.
In order to fix this, execute the port forwarding only once per device and persist the port. Use the newly introduced method in android-process-service, which will check if there's already a forwarded port for the specified abstract port. In case there's no such forwarding, a new free port is taken and the forwarding is executed. Once CLI finishes its work, the port forwarding is removed.
This ensures we'll execute only one port forwarding per device and also we'll not clash with other applications as the port is no longer hardcoded.1 parent 4c259e4 commit d57d0db
File tree
2 files changed
+12
-4
lines changed- lib
- services/livesync
2 files changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
89 | 96 | | |
90 | 97 | | |
91 | 98 | | |
| |||
121 | 128 | | |
122 | 129 | | |
123 | 130 | | |
124 | | - | |
| 131 | + | |
125 | 132 | | |
126 | 133 | | |
127 | 134 | | |
| 135 | + | |
128 | 136 | | |
129 | 137 | | |
130 | 138 | | |
| |||
0 commit comments