it tries to connect to npm server and throws red screen, I want to test some offline on-load features.
or is there someway to debug without npm server?
To debug offline IOS (react native) you can run two commands: - once you turned off your wifi, run this command in the terminal:
sudo ifconfig lo0 alias 192.xx.xx.xx
- 192.xx.xx.xx is your ip address (you can get the ip address running ifconfig
command)
After running above command and being offline you should not have the red screen
To undo the above command you run:
sudo ifconfig lo0 -alias 192.xx.xx.xx
, being still offline you will get now the red screen.
Hope this helps.
To debug on an android device (usb connected) you need to do the following:
Enable USB debugging on your android device
Navigate to your AndroidDevelopment/SDKManagerForAndroidStudio/Platform-tools/ directory
in a terminal and type adb devices
(this should pull up your connected device)
Again in the terminal type adb reverse tcp:8081 tcp:8081
You should then be able to debug on your device. Here is a link to the docs (I think they explain how to go about this on ios, I've only tried it on Android)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With