ionic-team / ionic-team/ionic-cli

Ionic CLI - ionic capacitor run android

Đang mở
#4,057 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
capacitor
Ngôn ngữ chính
TypeScript
Star
2k
Fork
682
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello,

One of the ionic cli commands needs a bit of tweaking. `ionic capacitor run android -l` runs by default `ng run app:serve --host=localhost --port=8100` with the server being localhost and port 8100, then it does a `capacitor copy android` and opens the android studio.

When we launch the android emulator, it is watching for changes on localhost:8100, however localhost:8100 is not reachable from the device emulator, the host machine is at 10.0.2.2 (https://developer.android.com/studio/run/emulator-networking).

It seems like we either need a rule to forward localhost to 10.0.2.2 or to let the android studio / emulator handles their own stuff, we can offer 2 urls in capacitor.config.json one url for the angular serve (localhost:8100) and one for the android emulator (10.0.2.2:8100).

Thoughts?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with the `ionic capacitor run android -l` entry point and trace the `ng run app:serve --host=localhost --port=8100`, `capacitor copy android`, and Android Studio flow described here. Read `capacitor.config.json` and the Android emulator networking guidance; done means live reload reaches the emulator without breaking the existing browser or Android workflow.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
cli, mobile-dev
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
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.