React Native Expo change default LAN IP

后端 未结 10 1004
星月不相逢
星月不相逢 2020-12-13 09:23

I\'ve got virtual box installed. And when I look at the host > LAN > ip address is exp://192.168.56.1:19000.

How can I change it without disable the network? because

相关标签:
10条回答
  • 2020-12-13 10:06

    If you have "ubuntu in windows" configured you can automate the process and run:

    for /F "usebackq delims=" %A in (`ipconfig  ^| grep -A4 'Wireless LAN adapter WiFi' ^| tail -1 ^| awk '{print $NF}'`) do set REACT_NATIVE_PACKAGER_HOSTNAME=%A
    
    0 讨论(0)
  • 2020-12-13 10:08

    You can specify the REACT_NATIVE_PACKAGER_HOSTNAME environment variable to use the correct IP address.

    If you're using XDE, then make sure to launch it from your project directory with xde . after you've installed the command line tools.

    0 讨论(0)
  • 2020-12-13 10:11

    check your pc whether install virtualbox , disable VirtualBox Host-Only Network

    go to win pc: Control Panel\Network and Internet\Network Connections

    run again command expo start is ok

    0 讨论(0)
  • 2020-12-13 10:14

    I have similar kind of problem (with may a slight difference), but the solution doesn't work for me. Finally I tried Expo CLI tool which worked great for me and is also recommended by Expo team.

    My detailed question (may help someone to resolve similar problem):

    Expo LAN configuration doesn't work for New ReactNative Project

    0 讨论(0)
提交回复
热议问题