NativeScript / NativeScript/nativescript-cli

Allow setting `localHostAddress` for android-livesync-tool

Abierto
#5,302 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

feature
Lenguaje dominante
JavaScript
Estrellas
1.1k
Forks
204
Merge medio
1 d 9 h
PR fusionados (30 d)
8

Descripción

Is your feature request related to a problem? Please describe.

A little bit of background why I ran into this issue: I'm running an emulator on a separate PC and connect to it over the network. (this is different from adb tcpip). This all works fine with adb, and the initial app install, but the address defaults to 127.0.0.1 and livesync is not able to restart the app on the remote emulator. If I manually patch the address in my CLI, it works as expected.

The android-livesync-tool has a configuration option for localHostAddress but it can't be changed from the CLI.

The tool is called from here:
https://github.com/NativeScript/nativescript-cli/blob/48965cd1dbbfa213aa27d0658c1db1064fd9a081/lib/services/livesync/android-device-livesync-sockets-service.ts#L153-L158

And localHostAddress is never passed, so it always defaults to DEFAULT_LOCAL_HOST_ADDRESS here:
https://github.com/NativeScript/nativescript-cli/blob/48965cd1dbbfa213aa27d0658c1db1064fd9a081/lib/services/livesync/android-livesync-tool.ts#L63-L65

Describe the solution you'd like

I would like to be able to specify the address somehow. A cli argument, a setting in nsconfig.json or even just an env variable would be enough for me. Perhaps read ANDROID_ADB_SERVER_ADDRESS as that is where adb can get the address for a remote adb server.

Describe alternatives you've considered

N/A

Additional context

N/A

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza en lib/services/livesync/android-device-livesync-sockets-service.ts, alrededor de la llamada mencionada, y sigue el flujo hasta lib/services/livesync/android-livesync-tool.ts, donde localHostAddress tiene por defecto el valor DEFAULT_LOCAL_HOST_ADDRESS. Determina cómo debería exponerse la dirección a través de la CLI, nsconfig.json o una variable de entorno, y luego verifica que livesync pueda reiniciar una aplicación en un emulador remoto.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
android, typescript
Área
cli, mobile
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.