NativeScript / NativeScript/nativescript-cli

Android remote emulator lose connection using ANDROID_ADB_SERVER_ADDRESS

Offen
#5,504 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

os: android
Vorherrschende Sprache
JavaScript
Sterne
1.1k
Forks
204
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
8

Beschreibung

Environment
Component nativescript has 7.2.0 version and is up to date.
✔ Component @nativescript/core has 7.2.1 version and is up to date.
✔ Component @nativescript/ios has 7.2.0 version and is up to date.
✔ Component @nativescript/android has 7.0.1 version and is up to date.

Describe the bug
The use of the command for running on a remote Android emulator (in my case a Virtualbox with Ubuntu 20.04.1 and Android SDK and emulator running) as follows:

$ ANDROID_ADB_SERVER_ADDRESS={VirtualMachineIP} ns run android --no-hmr

The application is installed and has run successfully but the CLI command seems to timeout when trying to connect to the application log with the error:

Installing on device emulator-5554...
Successfully installed on device with identifier 'emulator-5554'.
Unable to apply changes on device: emulator-5554. Error is: connect ECONNREFUSED 127.0.0.1:51258.

Seems like NativeScript is trying to connect to a port in the local machine ignoring the ANDROID_ADB_SERVER_ADDRESS IP address

To Reproduce

  • Create an Ubuntu virtual machine with android SDK on a VirtualBox or similar on a Mac OS host machine
  • create an Android emulator and run it
  • in the virtual machine OS (Ubuntu in this case) terminal run adb -a -P 5037 nodaemon server
  • in the host machine (Mac OS in my case) execute an android application with the NativeScript CLI ANDROID_ADB_SERVER_ADDRESS={VirtualMachineIP} ns run android --no-hmr

Expected behavior
Running an Android application in a remote machine as normal as in host machine with debug and log capabilities.

Additional context
The virtual machine should have bridged adapter configured, I don't know if NAT is also working

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Problem mit ANDROID_ADB_SERVER_ADDRESS={VirtualMachineIP} ns run android --no-hmr und dem oben beschriebenen Setup des entfernten adb-Servers zu reproduzieren. Verfolge die Handhabung der Installation, Protokollierung und Debug-Verbindung durch die Android CLI, und achte dabei besonders auf den gemeldeten localhost-Port. Die Aufgabe ist erledigt, wenn ein entfernter Emulator die Anwendung mit Debug- und Protokollierungsfunktionen ohne Verbindungs-Timeout ausführen kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, javascript
Bereich
cli, mobile-dev, networking
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.