NativeScript / NativeScript/nativescript-cli
Android remote emulator lose connection using ANDROID_ADB_SERVER_ADDRESS
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ả
Environment
Component nativescript has 7.2.0 version and is up to date.
✔ Component @nativescript/core has 7.2.1 version and is up to date.
✔ Component @nativescript/ios has 7.2.0 version and is up to date.
✔ Component @nativescript/android has 7.0.1 version and is up to date.
Describe the bug
The use of the command for running on a remote Android emulator (in my case a Virtualbox with Ubuntu 20.04.1 and Android SDK and emulator running) as follows:
$ ANDROID_ADB_SERVER_ADDRESS={VirtualMachineIP} ns run android --no-hmr
The application is installed and has run successfully but the CLI command seems to timeout when trying to connect to the application log with the error:
Installing on device emulator-5554...
Successfully installed on device with identifier 'emulator-5554'.
Unable to apply changes on device: emulator-5554. Error is: connect ECONNREFUSED 127.0.0.1:51258.
Seems like NativeScript is trying to connect to a port in the local machine ignoring the ANDROID_ADB_SERVER_ADDRESS IP address
To Reproduce
- Create an Ubuntu virtual machine with android SDK on a VirtualBox or similar on a Mac OS host machine
- create an Android emulator and run it
- in the virtual machine OS (Ubuntu in this case) terminal run
adb -a -P 5037 nodaemon server - in the host machine (Mac OS in my case) execute an android application with the NativeScript CLI
ANDROID_ADB_SERVER_ADDRESS={VirtualMachineIP} ns run android --no-hmr
Expected behavior
Running an Android application in a remote machine as normal as in host machine with debug and log capabilities.
Additional context
The virtual machine should have bridged adapter configured, I don't know if NAT is also working
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 bằng cách tái hiện vấn đề với ANDROID_ADB_SERVER_ADDRESS={VirtualMachineIP} ns run android --no-hmr và thiết lập máy chủ adb từ xa được mô tả ở trên. Theo dõi cách Android CLI xử lý việc cài đặt, log và kết nối debug, đặc biệt chú ý đến cổng localhost được báo cáo. Công việc được xem là hoàn tất khi một trình giả lập từ xa có thể chạy ứng dụng với khả năng debug và log mà không bị timeout kết nối.
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, javascript
- Lĩnh vực
- cli, mobile-dev, networking
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 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
- 35/100