nativescript running code on a remote emulator

Viewed 161

I'm developing a mobile app using Nativescript 6.5.x and Angular within a Debian VM. I have an emulator running on another machine.

Is there a way to tell the following command to run my code on my emulator on the remote machine

tns run android

Current work around is I mount my code directory on the remote machine and run the tns command over there. Problem with this work around is it breaks the 'Hot Module Replacement' so I have to reload the whole app everytime I change code.

Update

Seting up server & client using adb works

LTSPHOST (Server)

adb -a -P 5037 nodaemon server

LTSP (Client)

adb -H 192.168.200.7 -P 5037 devices

I can also see the devices through tns

ANDROID_ADB_SERVER_ADDRESS=192.168.200.7 tns device

Output

Connected devices & emulators
Searching for devices...
iTunes is not available for this operating system. You will not be able to work with connected iOS devices.
 ┌───┬───────────────────────────┬──────────┬───────────────────┬──────────┬───────────┬─────────────────┐
 │ # │ Device Name               │ Platform │ Device Identifier │ Type     │ Status    │ Connection Type │
 │ 1 │ Android SDK built for x86 │ Android  │ emulator-5586     │ Emulator │ Connected │ Local           │
 └───┴───────────────────────────┴──────────┴───────────────────┴──────────┴───────────┴─────────────────┘

Running 'tns run android' with the remote ADB server fails

ANDROID_ADB_SERVER_ADDRESS=192.168.200.7 ANDROID_ADB_SERVER_PORT=5037 tns run android --env.apiUrl='http://192.168.200.4:3000' --device emulator-5586

Output

Webpack compilation complete. Watching for file changes.
Webpack build done!
Project successfully prepared (android)
Unable to apply changes on device: emulator-5586. Error is: connect ECONNREFUSED 127.0.0.1:38759.

Second time I ran produced a different port so I cannot simply ssh tunnel that one port.

Unable to apply changes on device: emulator-5586. Error is: connect ECONNREFUSED 127.0.0.1:33909.

Update: Check proxies

I have no proxies setup through npm or tns.

Update: Try latest nativescript

I install 7.0.11 and ran;

ANDROID_ADB_SERVER_ADDRESS=192.168.200.7 ANDROID_ADB_SERVER_PORT=5037 tns run android --env.apiUrl='http://192.168.200.4:3000' --device emulator-5586 --no-hmr

I got the same error

Unable to apply changes on device: emulator-5586. Error is: connect ECONNREFUSED 127.0.0.1:39679.
0 Answers
Related