Skip to content

Commit 6bf0a02

Browse files
gzzoelicwhite
authored andcommitted
Remove section that's already included in the template (facebook#788)
The `AppDelegate.m` template already has the changes mentioned in the 3rd section, so this step is unnecessary in the documentation.
1 parent e0570a5 commit 6bf0a02

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

docs/running-on-device.md

+8-24
Original file line numberDiff line numberDiff line change
@@ -348,42 +348,26 @@ To configure your app to be built using the `Release` scheme, go to **Product**
348348

349349
![](/react-native/docs/assets/ConfigureReleaseScheme.png)
350350

351-
### 3. Configure app to use static bundle
351+
#### Pro Tips
352352

353-
During the development process, React Native has loaded your JavaScript code dynamically at runtime. For a production build, you want to pre-package the JavaScript bundle and distribute it inside your application. Doing this requires a code change in your code so that it knows to load the static bundle.
354-
355-
In `AppDelegate.m`, change `jsCodeLocation` to point to the static bundle if you're not in debug mode.
353+
As your App Bundle grows in size, you may start to see a white screen flash between your splash screen and the display of your root application view. If this is the case, you can add the following code to `AppDelegate.m` in order to keep your splash screen displayed during the transition.
356354

357355
```objc
358-
#ifdef DEBUG
359-
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
360-
#else
361-
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
362-
#endif
356+
// Place this code after "[self.window makeKeyAndVisible]" and before "return YES;"
357+
UIView* launchScreenView = [[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:self options:nil] objectAtIndex:0];
358+
launchScreenView.frame = self.window.bounds;
359+
rootView.loadingView = launchScreenView;
363360
```
364361
365-
This will now reference the `main.jsbundle` resource file that is created during the `Bundle React Native code and images` Build Phase in Xcode.
366-
367-
> Note: The static bundle is built every time you target a physical device, even in Debug. If you want to save time, turn off bundle generation in Debug by adding the following to your shell script in the Xcode Build Phase `Bundle React Native code and images`:
362+
The static bundle is built every time you target a physical device, even in Debug. If you want to save time, turn off bundle generation in Debug by adding the following to your shell script in the Xcode Build Phase `Bundle React Native code and images`:
368363
369364
```shell
370365
if [ "${CONFIGURATION}" == "Debug" ]; then
371366
export SKIP_BUNDLING=true
372367
fi
373368
```
374369

375-
#### Pro Tip
376-
377-
As your App Bundle grows in size, you may start to see a white screen flash between your splash screen and the display of your root application view. If this is the case, you can add the following code to `AppDelegate.m` in order to keep your splash screen displayed during the transition.
378-
379-
```objc
380-
// Place this code after "[self.window makeKeyAndVisible]" and before "return YES;"
381-
UIView* launchScreenView = [[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:self options:nil] objectAtIndex:0];
382-
launchScreenView.frame = self.window.bounds;
383-
rootView.loadingView = launchScreenView;
384-
```
385-
386-
### 4. Build app for release
370+
### 3. Build app for release
387371

388372
You can now build your app for release by tapping `⌘B` or selecting **Product****Build** from the menu bar. Once built for release, you'll be able to distribute the app to beta testers and submit the app to the App Store.
389373

0 commit comments

Comments
 (0)