How can I get expo to connect to Android emulator with a non-localhost ip address?

心已入冬 提交于 2021-01-28 10:27:34

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!