Running On Device # | Edit on GitHub |
Note that running on device requires Apple Developer account and provisioning your iPhone. This guide covers only React Native specific topic.
You can iterate quickly on device using development server. To do that, your laptop and your phone have to be on the same wifi network.
AwesomeApp/ios/AwesomeApp/AppDelegate.m
localhost
to your laptop's IP. On Mac, you can find the IP address in System Preferences / Network.Hint
Shake the device to open development menu (reload, debug, etc.)
When you run your app on device, we pack all the JavaScript code and the images used into the app's resources. This way you can test it without development server running and submit the app to the AppStore.
AwesomeApp/ios/AwesomeApp/AppDelegate.m
jsCodeLocation = [[NSBundle mainBundle] ...
Product > Scheme > Edit Scheme...
in xcode and change Build Configuration
between Debug
and Release
.When building your app for production, your app's scheme should be set to Release
as detailed in the debugging documentation in order to disable the in-app developer menu.
If curl
command fails make sure the packager is running. Also try adding --ipv4
flag to the end of it.
Note that since v0.14 JS and images are automatically packaged into the iOS app using Bundle React Native code and images
Xcode build phase.