Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Expo change default LAN IP

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 it's my virtualbox ip and my device can't connect to it.

Thanks

like image 656
ssuhat Avatar asked Apr 29 '17 14:04

ssuhat


2 Answers

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.

like image 174
dikaiosune Avatar answered Sep 18 '22 07:09

dikaiosune


In windows you can use:

set REACT_NATIVE_PACKAGER_HOSTNAME=192.168.1.59 

set is only used for one session. If you always wanna use the same ip after reboot you can use:

setx /M REACT_NATIVE_PACKAGER_HOSTNAME 192.168.1.59 
like image 20
Mauricio Cortazar Avatar answered Sep 17 '22 07:09

Mauricio Cortazar