NativeScript / NativeScript/nativescript-cli

Allow setting `localHostAddress` for android-livesync-tool

未關閉
#5,302 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

feature
主要語言
JavaScript
星號
1.1k
分支
204
平均合併
1 天 9 小時
30 天內合併 PR
8

描述

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

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 lib/services/livesync/android-device-livesync-sockets-service.ts 中參照的呼叫附近開始,追蹤至 lib/services/livesync/android-livesync-tool.ts,其中 localHostAddress 預設為 DEFAULT_LOCAL_HOST_ADDRESS。確認應如何透過 CLI、nsconfig.json 或環境變數公開該位址,然後驗證 livesync 是否能在遠端模擬器上重新啟動應用程式。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
android, typescript
領域
cli, mobile
Issue 類型
功能
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。