Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
684 views
in Technique[技术] by (71.8m points)

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

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 :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...