Skip to content

Commit 4e94ad4

Browse files
edusperonirigor789
andauthored
feat(livesync): support livesync in remote machine (#5560)
* feat: support livesync in remote machine adds support to wsl via `export LIVESYNC_ADDR=hostIpAddr` * Update lib/services/livesync/android-device-livesync-service.ts * Update lib/services/livesync/android-livesync-tool.ts Co-authored-by: Igor Randjelovic <[email protected]>
1 parent 37e2dbb commit 4e94ad4

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/services/livesync/android-device-livesync-service.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,13 @@ export class AndroidDeviceLiveSyncService
260260
let isResolved = false;
261261
const socket = new net.Socket();
262262

263-
socket.connect(this.port, "127.0.0.1", () => {
264-
socket.write(Buffer.from([0, 0, 0, 1, 1]));
265-
});
263+
socket.connect(
264+
this.port,
265+
process.env.NATIVESCRIPT_LIVESYNC_ADDRESS || "127.0.0.1",
266+
() => {
267+
socket.write(Buffer.from([0, 0, 0, 1, 1]));
268+
}
269+
);
266270
socket.on("data", (data: any) => {
267271
isResolved = true;
268272
socket.destroy();

lib/services/livesync/android-livesync-tool.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export class AndroidLivesyncTool implements IAndroidLivesyncTool {
7676
}
7777

7878
if (!configuration.localHostAddress) {
79-
configuration.localHostAddress = DEFAULT_LOCAL_HOST_ADDRESS;
79+
configuration.localHostAddress =
80+
process.env.NATIVESCRIPT_LIVESYNC_ADDRESS || DEFAULT_LOCAL_HOST_ADDRESS;
8081
}
8182

8283
const connectTimeout = configuration.connectTimeout || TRY_CONNECT_TIMEOUT;

0 commit comments

Comments
 (0)