NativeScript / NativeScript/nativescript-cli
Allow setting `localHostAddress` for android-livesync-tool
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 1.1k
- フォーク
- 204
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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