You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to launch react-native(0.29) on iOS physical device(9.3) #8647
thanks @rogchap - since upgrading to rn 0.29 i can no longer run on a physical device. I'm getting the "Could not connect to development server" error. Have the commands changed that I need to run?
Have you updated your AppDelegate? It's completely changed from previous
versions.
On Wed, 13 Jul 2016 at 20:23, Nick Pomfret notifications@github.com wrote:
thanks @rogchaphttps://github.com/rogchap - since upgrading to rn 0.29
i can no longer run on a physical device. I'm getting the "Could not
connect to development server" error. Have the commands changed that I need
to run?
Before I was just running npm start.
—
You are receiving this because you were mentioned.
Yes, I've got that. So how do now load js files from a physical device? I use'd to just specify an ipaddress (jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.64:8081/index.ios.bundle?platform=ios&dev=true"];). But that's not an option any more. The docs are out of date as well.
Have you run '$ react-native upgrade' to upgrade your templates?
There are some script files that copy your IP address into a ip.txt file
that is used to access your local machine.
In 0.29.x you do not need to make any changes to run on a physical device.
Just be on the same WiFi network.
On Wed, 13 Jul 2016 at 23:39, Nick Pomfret notifications@github.com wrote:
Completely changed? What's different? The only thing I noticed was:
Yes, I've got that. So how do now load js files from a physical device? I
use'd to just specify an ipaddress (jsCodeLocation = [NSURL
URLWithString:@"
http://192.168.1.64:8081/index.ios.bundle?platform=ios&dev=true"];). But
that's not an option any more. The docs are out of date as well.
Yes, I've run react-native upgrade. Maybe i missed something in the merge process, but I can't see what. My phone will only load the pre packaged JS files now. What should I look for? How does the phone know which ip address to use?
@npomfret Did you manage to get this resolved? I have the same issue in that my app no longer connects to the packager and only uses the bundled JS. I have ATS setup with an exception for localhost but I believe that was the default setup when I created my app.
@npomfret I dug into this a bit more and found that my problem was related to how the react-native-xcode.sh script creates the IP.txt file when the machine is only on wifi. It uses ipconfig getifaddr en0 which returns blank. I explained the rest here:
Right so if you have 2 or more network interfaces, which I do - you need to make sure that the node process binds to the wifi and not the ethernet? How on earth do you do that? I want to use ethernet when its available, not wifi, so I'd rather not bump wifi to the top of the list. I guess that's just not possible now
Unfortunately, I don't have a great answer other than tweaking react-native-xcode.sh to look at the right device for writing out the IP.txt file. At least I understand what's really happening now. :|
Activity
rogchap commentedon Jul 8, 2016
Looking at the code, it seems that you need an
ip.txtfile in your main bundle:https://github.com/facebook/react-native/blob/master/React/Base/RCTBundleURLProvider.m#L29
rogchap commentedon Jul 8, 2016
Looking further: https://github.com/facebook/react-native/blob/8c29a52c54392ce52148e7d3aa9f835537453aa4/packager/react-native-xcode.sh#L77
Seems that the packager should create this file. I think this means that you should not have to change anything to run on your device.
DanielMSchmidt commentedon Jul 8, 2016
@facebook-github-bot stack-overflow
npomfret commentedon Jul 13, 2016
thanks @rogchap - since upgrading to rn 0.29 i can no longer run on a physical device. I'm getting the "Could not connect to development server" error. Have the commands changed that I need to run?
Before I was just running npm start.
rogchap commentedon Jul 13, 2016
Have you updated your AppDelegate? It's completely changed from previous
versions.
On Wed, 13 Jul 2016 at 20:23, Nick Pomfret notifications@github.com wrote:
npomfret commentedon Jul 13, 2016
Completely changed? What's different? The only thing I noticed was:
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];Yes, I've got that. So how do now load js files from a physical device? I use'd to just specify an ipaddress (
jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.64:8081/index.ios.bundle?platform=ios&dev=true"];). But that's not an option any more. The docs are out of date as well.rogchap commentedon Jul 13, 2016
Have you run '$ react-native upgrade' to upgrade your templates?
There are some script files that copy your IP address into a ip.txt file
that is used to access your local machine.
In 0.29.x you do not need to make any changes to run on a physical device.
Just be on the same WiFi network.
On Wed, 13 Jul 2016 at 23:39, Nick Pomfret notifications@github.com wrote:
npomfret commentedon Jul 14, 2016
Yes, I've run react-native upgrade. Maybe i missed something in the merge process, but I can't see what. My phone will only load the pre packaged JS files now. What should I look for? How does the phone know which ip address to use?
longsangstan commentedon Aug 3, 2016
https://facebook.github.io/react-native/docs/running-on-device-ios.html
Seems that the docs are out-dated.
strefethen commentedon Aug 22, 2016
@npomfret Did you manage to get this resolved? I have the same issue in that my app no longer connects to the packager and only uses the bundled JS. I have ATS setup with an exception for localhost but I believe that was the default setup when I created my app.
Thanks
npomfret commentedon Aug 23, 2016
Yes, see my comments here #8358
No idea if its the right thing to do, but as far as I can tell the documented solution is wrong.
strefethen commentedon Aug 23, 2016
@npomfret I dug into this a bit more and found that my problem was related to how the react-native-xcode.sh script creates the IP.txt file when the machine is only on wifi. It uses ipconfig getifaddr en0 which returns blank. I explained the rest here:
http://www.stevetrefethen.com/blog/react-native-bundle-loading-failing-on-a-physical-device
Basically, you should not have to hard code your IP address in AppDelegate.m it should "just work", if your machine is connected on "en0" that is.
npomfret commentedon Aug 24, 2016
Right so if you have 2 or more network interfaces, which I do - you need to make sure that the node process binds to the wifi and not the ethernet? How on earth do you do that? I want to use ethernet when its available, not wifi, so I'd rather not bump wifi to the top of the list. I guess that's just not possible now
strefethen commentedon Aug 25, 2016
Unfortunately, I don't have a great answer other than tweaking react-native-xcode.sh to look at the right device for writing out the IP.txt file. At least I understand what's really happening now. :|