mirror of
https://github.com/status-im/react-native.git
synced 2025-01-16 20:44:10 +00:00
b1e49832ef
Summary: We had rendering support for prev links, but we never had any previous links in our metadata. Only next links. This adds that support to both Guides and APIs. **For guides**: `previous` is manually inserted into the metadata of the actual markdown file. **For APIs/Components**: `previous` is established via code within `extractDocs.js` > This isn't totally perfect. For example, the transition from the last guide to the first API/component has a next link from the guide, but not a previous link from the API since the way you get the previous links are different from guides and APIs. But this gets us really close. Closes https://github.com/facebook/react-native/pull/8754 Differential Revision: D3557972 Pulled By: hramos fbshipit-source-id: e270bb51e7a4f59f61dad28ae0928d27d0af3d4a
47 lines
2.4 KiB
Markdown
47 lines
2.4 KiB
Markdown
---
|
|
id: running-on-device-ios
|
|
title: Running On Device
|
|
layout: docs
|
|
category: Guides (iOS)
|
|
permalink: docs/running-on-device-ios.html
|
|
next: running-on-simulator-ios
|
|
previous: linking-libraries-ios
|
|
---
|
|
|
|
Running an iOS app on a device requires an [Apple Developer account](https://developer.apple.com/) and provisioning your iPhone. This guide covers only React Native specific topics.
|
|
|
|
## Accessing the development server from device
|
|
|
|
You can iterate quickly on device using the development server. First, ensure that you are on the same Wi-Fi network as your computer.
|
|
|
|
In Xcode, select your phone as build target and press "Build and run"
|
|
|
|
> Hint
|
|
>
|
|
> Shake the device to open the [developer menu](/react-native/docs/debugging.html#accessing-the-in-app-developer-menu).
|
|
|
|
## Building your app for production
|
|
|
|
You have built a great app using React Native, and you are now itching to release it in the App Store. The process is the same as any other native iOS app, with some additional considerations to take into account.
|
|
|
|
### Disabling the developer menu
|
|
|
|
Building an app for distribution in the App Store requires using the `Release` scheme in Xcode. Apps built for `Release` will automatically disable the in-app developer menu. This will prevent your users from inadvertently accessing the menu in production.
|
|
|
|
### Using the offline bundle
|
|
|
|
Set up your app to load your JavaScript, images, and other static assets from its resource bundle rather than the development server. This way you can test the app independently of the development server, and will allow you to distribute the app to beta testers and submit the app to the App Store.
|
|
|
|
1. Open `ios/YourApp/AppDelegate.m`
|
|
2. Uncomment the line, `jsCodeLocation = [[NSBundle mainBundle] ...`
|
|
|
|
### App Transport Security
|
|
|
|
App Transport Security is a security feature, added in iOS 9, that rejects all HTTP requests that are not sent over HTTPS. This can result in HTTP traffic being blocked, including the developer React Native server.
|
|
|
|
ATS is disabled by default in projects generated using the React Native CLI in order to make development easier. You should re-enable ATS prior to building your app for production by removing the `NSAllowsArbitraryLoads` entry from your `Info.plist` file in the `ios/` folder.
|
|
|
|
To learn more about how to configure ATS on your own Xcode projects, see [this post on ATS][cats].
|
|
|
|
[cats]: http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/
|