问题
I have an Android Emulator running on Windows on port 5554.
I am running expo inside WSL2. I have verified that I can access my Android Emulator on WIndows since if I type in:
# 172.22.80.1 is the IP to Windows from WSL2
telnet 127.22.80.1 5554
it shows me the same "Android Console: Authentication required" prompt as if I did it in my Windows PowerShell.
However, when I click on "Run on Android device/emulator" from the Metro Bundler web page, it throws me:
Couldn't start project on Android: could not connect to TCP port 5554: Connection refused
It seems like it's trying to access the emulator via localhost:5554
, but I would like it to connect to $SPECIFIED_IP:5554
.
Is there an env var where I can change this? FWIW I am using a Managed Expo project.
来源:https://stackoverflow.com/questions/64830917/how-can-i-get-expo-to-connect-to-android-emulator-with-a-non-localhost-ip-addres