Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After upgrade livereload missing on real device, cannot debug js remotely from real device

Tags:

react-native

After updating react native from 0.26 to 0.29, live reload and hot code push items are missing in dev menu, so I have to manually reload the app every time. However, it's working in simulator. Have I messed up something while upgrading? I tried to update to 0.30, but didn't help.

Also, remote debugging from real device doesn't work, works only while running app in simulator. I get this error: Runtime is not ready for debugging, but I'm sure that packager server is running, it's not paused on breakpoint. Any ideas?

React version: 15.2.1 Watchman version: 4.5.0

Thanks :)

like image 860
OndrejRohon Avatar asked Jul 30 '16 17:07

OndrejRohon


People also ask

Where is debug JS remotely?

To debug the JavaScript code in Chrome, select "Debug JS Remotely" from the Developer Menu. This will open a new tab at http://localhost:8081/debugger-ui. Select Tools → Developer Tools from the Chrome Menu to open the Developer Tools.

How do I debug the react native app?

In App Developer MenuOn Android emulator, you need to press command + M. Debug JS Remotely − Used for activating debugging inside browser developer console. Enable Live Reload − Used for enabling live reloading whenever your code is saved. The debugger will open at localhost:8081/debugger-ui.

How do I reload a react native app on real?

Open the in-app Developer menu. Go to Dev Settings → Debug server host & port for device. Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081). Go back to the Developer menu and select Reload JS.


1 Answers

Figured out the needed configuration for make live reload work:

jsCodeLocation = [NSURL URLWithString: @"http://192.168.0.200:8081/index.ios.bundle?platform=ios&dev=true"];

note also that without "?platform=ios&dev=true" Hot Reload didn't work for me ("Unbalanced calls start/end" errors).

and in RCTWebSocketExecutor.m:

host = @"http://192.168.0.200";

192.168.0.200 - address of your computer. Both computer and device have to be in the same network. After that "Live Reload" item in "shake" dev menu appeared and also i started to see logs in server console: enter image description here

and also "gotta be on the same wifi network" as @jmancherje mentioned

like image 113
protspace Avatar answered Oct 05 '22 20:10

protspace