Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 033d8af

Browse files
committed
Adding iOS debug detail
1 parent 8336ab7 commit 033d8af

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ This change configures your app to always load the most recent version of your a
9999
100100
*NOTE: The `bundleURL` method assumes your app's JS bundle is named `main.jsbundle`. If you have configured your app to use a different file name, simply call the `bundleURLForResource:` method (which assumes you're using the `.jsbundle` extension) or `bundleURLForResource:withExtension:` method instead, in order to overwrite that default behavior*
101101
102+
Typically, you're only going to want to use CodePush to resolve your JS bundle within release builds, and therefore, we recommend using the `DEBUG` pre-processor macro to dynamically switch between using the packager server and CodePush, depending on whether you are debugging or not. This will make it much simpler to ensure you get the right behavior you want in production, while still being able to use the Chrome Dev Tools, live reload, etc. at debug-time.
103+
104+
```
105+
#ifdef DEBUG
106+
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
107+
#else
108+
jsCodeLocation = [CodePush bundleURL];
109+
#endif
110+
```
111+
102112
To let the CodePush runtime know which deployment it should query for updates against, perform the following steps:
103113
104114
1. Open your app's `Info.plist` file and add a new entry named `CodePushDeploymentKey`, whose value is the key of the deployment you want to configure this app against (e.g. the key for the `Staging` deployment for the `FooBar` app). You can retrieve this value by running `code-push deployment ls <appName>` in the CodePush CLI, and copying the value of the `Deployment Key` column which corresponds to the deployment you want to use (see below). Note that using the deployment's name (e.g. Staging) will not work. That "friendly name" is intended only for authenticated management usage from the CLI, and not for public consumption within your app.

0 commit comments

Comments
 (0)