NativeScript / NativeScript/nativescript-cli
Allow setting `localHostAddress` for android-livesync-tool
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 1.1k
- Fork
- 204
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 8
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu tại lib/services/livesync/android-device-livesync-sockets-service.ts, quanh lệnh gọi được đề cập, và lần theo đến lib/services/livesync/android-livesync-tool.ts, nơi localHostAddress mặc định là DEFAULT_LOCAL_HOST_ADDRESS. Xác định cách địa chỉ nên được cung cấp thông qua CLI, nsconfig.json hoặc một biến môi trường, sau đó xác minh rằng livesync có thể khởi động lại một ứng dụng trên trình mô phỏng từ xa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- android, typescript
- Lĩnh vực
- cli, mobile
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100