NativeScript / NativeScript/nativescript-cli
Allow setting `localHostAddress` for android-livesync-tool
还没有人认领这个 Issue。
- 主要语言
- 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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 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