diff --git a/lib/services/livesync/android-device-livesync-service.ts b/lib/services/livesync/android-device-livesync-service.ts index ec266bb924..81a4d20831 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.NATIVESCRIPT_LIVESYNC_ADDRESS || "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..aa00cecaaa 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.NATIVESCRIPT_LIVESYNC_ADDRESS || DEFAULT_LOCAL_HOST_ADDRESS; } const connectTimeout = configuration.connectTimeout || TRY_CONNECT_TIMEOUT;