From 759d4862e7bd6076a13d2d7b57db257f27234629 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Sun, 8 Aug 2021 10:32:54 -0300 Subject: [PATCH 1/3] feat: support livesync in remote machine adds support to wsl via `export LIVESYNC_ADDR=hostIpAddr` --- .../livesync/android-device-livesync-service.ts | 10 +++++++--- lib/services/livesync/android-livesync-tool.ts | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/services/livesync/android-device-livesync-service.ts b/lib/services/livesync/android-device-livesync-service.ts index ec266bb924..3e5e27ae69 100644 --- a/lib/services/livesync/android-device-livesync-service.ts +++ b/lib/services/livesync/android-device-livesync-service.ts @@ -260,9 +260,13 @@ export class AndroidDeviceLiveSyncService let isResolved = false; const socket = new net.Socket(); - socket.connect(this.port, "127.0.0.1", () => { - socket.write(Buffer.from([0, 0, 0, 1, 1])); - }); + socket.connect( + this.port, + process.env.LIVESYNC_ADDR || "127.0.0.1", + () => { + socket.write(Buffer.from([0, 0, 0, 1, 1])); + } + ); socket.on("data", (data: any) => { isResolved = true; socket.destroy(); diff --git a/lib/services/livesync/android-livesync-tool.ts b/lib/services/livesync/android-livesync-tool.ts index f6b1d159d4..bb50d4d5e8 100644 --- a/lib/services/livesync/android-livesync-tool.ts +++ b/lib/services/livesync/android-livesync-tool.ts @@ -76,7 +76,8 @@ export class AndroidLivesyncTool implements IAndroidLivesyncTool { } if (!configuration.localHostAddress) { - configuration.localHostAddress = DEFAULT_LOCAL_HOST_ADDRESS; + configuration.localHostAddress = + process.env.LIVESYNC_ADDR || DEFAULT_LOCAL_HOST_ADDRESS; } const connectTimeout = configuration.connectTimeout || TRY_CONNECT_TIMEOUT; From c217fc45543bcbf2a1e7adf1fc9b7c419aa3e9fe Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Wed, 11 Aug 2021 19:54:13 +0200 Subject: [PATCH 2/3] Update lib/services/livesync/android-device-livesync-service.ts --- lib/services/livesync/android-device-livesync-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/livesync/android-device-livesync-service.ts b/lib/services/livesync/android-device-livesync-service.ts index 3e5e27ae69..81a4d20831 100644 --- a/lib/services/livesync/android-device-livesync-service.ts +++ b/lib/services/livesync/android-device-livesync-service.ts @@ -262,7 +262,7 @@ export class AndroidDeviceLiveSyncService socket.connect( this.port, - process.env.LIVESYNC_ADDR || "127.0.0.1", + process.env.NATIVESCRIPT_LIVESYNC_ADDRESS || "127.0.0.1", () => { socket.write(Buffer.from([0, 0, 0, 1, 1])); } From 8e115dcf50ae4f850e5c860b4aa85a408acf4339 Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Wed, 11 Aug 2021 19:54:17 +0200 Subject: [PATCH 3/3] Update lib/services/livesync/android-livesync-tool.ts --- lib/services/livesync/android-livesync-tool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/livesync/android-livesync-tool.ts b/lib/services/livesync/android-livesync-tool.ts index bb50d4d5e8..aa00cecaaa 100644 --- a/lib/services/livesync/android-livesync-tool.ts +++ b/lib/services/livesync/android-livesync-tool.ts @@ -77,7 +77,7 @@ export class AndroidLivesyncTool implements IAndroidLivesyncTool { if (!configuration.localHostAddress) { configuration.localHostAddress = - process.env.LIVESYNC_ADDR || DEFAULT_LOCAL_HOST_ADDRESS; + process.env.NATIVESCRIPT_LIVESYNC_ADDRESS || DEFAULT_LOCAL_HOST_ADDRESS; } const connectTimeout = configuration.connectTimeout || TRY_CONNECT_TIMEOUT;