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 }}
This repository was archived by the owner on May 20, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+19-17Lines changed: 19 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -260,33 +260,35 @@ This is not necessarily the case for `updateDialog`, since it won't force the us
260
260
261
261
## Releasing Updates
262
262
263
-
Once your app has been configured and distributed to your users, and you've made some JSand/or asset changes, it's time to instantly release them! The simplest (and recommended) way to do this is to use the `release-react` command in the CodePush CLI, which will handle bundling your JavaScript and asset files and releasing the update to the CodePush server.
263
+
Once your app is configured and distributed to your users, and you have made some JS or asset changes, it's time to release them.The recommended way to release them is using the `release-react` command in the App Center CLI, which will bundle your JavaScript files, asset files, and release the update to the CodePush server.
264
264
265
-
In it's most basic form, this command only requires two parameters: your app name and the platform you are bundling the update for (either `ios` or `android`).
265
+
*NOTE: Before you can start releasing updates, please log into App Center by running the `appcenter login` command.*
266
+
267
+
In its most basic form, this command only requires one parameter: your owner name +"/"+ app name.
266
268
267
269
```shell
268
-
code-push release-react <appName> <platform>
270
+
appcenter codepush release-react -a <ownerName>/<appName>
269
271
270
-
code-push release-react MyApp-iOS ios
271
-
code-push release-react MyApp-Android android
272
+
appcenter codepush release-react -a <ownerName>/MyApp-iOS
273
+
appcenter codepush release-react -a <ownerName>/MyApp-Android
272
274
```
273
275
274
276
The `release-react` command enables such a simple workflow because it provides many sensible defaults (like generating a release bundle, assuming your app's entry file on iOS is either `index.ios.js` or `index.js`). However, all of these defaults can be customized to allow incremental flexibility as necessary, which makes it a good fit for most scenarios.
275
277
276
278
```shell
277
279
# Release a mandatory update with a changelog
278
-
code-push release-react MyApp-iOS ios -m --description "Modified the header color"
280
+
appcenter codepush release-react -a <ownerName>/MyApp-iOS -m --description "Modified the header color"
279
281
280
282
# Release an update for an app that uses a non-standard entry file name, and also capture
281
283
# the sourcemap file generated by react-native bundle
appcenter codepush release-react -a <ownerName>/MyApp-Android --target-binary-version "~1.1.0"
290
292
291
293
```
292
294
@@ -302,19 +304,19 @@ If you run into any issues, or have any questions/comments/feedback, you can pin
302
304
303
305
In our [getting started](#getting-started) docs, we illustrated how to configure the CodePush plugin using a specific deployment key. However, in order to effectively test your releases, it is critical that you leverage the `Staging` and `Production` deployments that are auto-generated when you first created your CodePush app (or any custom deployments you may have created). This way, you never release an update to your end users that you haven't been able to validate yourself.
304
306
305
-
*NOTE: Our client-side rollback feature can help unblock users after installing a release that resulted in a crash, and server-side rollbacks (i.e. `code-push rollback`) allow you to prevent additional users from installing a bad release once it's been identified. However, it's obviously better if you can prevent an erroneous update from being broadly released in the first place.*
307
+
*NOTE: Our client-side rollback feature can help unblock users after installing a release that resulted in a crash, and server-side rollbacks (i.e. `appcenter codepush rollback`) allow you to prevent additional users from installing a bad release once it's been identified. However, it's obviously better if you can prevent an erroneous update from being broadly released in the first place.*
306
308
307
309
Taking advantage of the `Staging` and `Production` deployments allows you to achieve a workflow like the following (feel free to customize!):
308
310
309
-
1. Release a CodePush update to your `Staging` deployment using the `code-push release-react`command (or `code-push release`if you need more control)
311
+
1. Release a CodePush update to your `Staging` deployment using the `appcenter codepush release-react`command (or `appcenter codepush release`if you need more control)
310
312
311
313
2. Run your staging/beta build of your app, sync the update from the server, and verify it works as expected
312
314
313
-
3. Promote the tested release from `Staging` to `Production` using the `code-push promote` command
315
+
3. Promote the tested release from `Staging` to `Production` using the `appcenter codepush promote` command
314
316
315
317
4. Run your production/release build of your app, sync the update from the server and verify it works as expected
316
318
317
-
*NOTE: If you want to get really fancy, you can even choose to perform a "staged rollout" as part of #3, which allows you to mitigate additional potential risk with the update (like did your testing in #2 touch all possible devices/conditions?) by only making the production update available to a percentage of your users (for example `code-push promote <APP_NAME> Staging Production -r 20%`). Then, after waiting for a reasonable amount of time to see if any crash reports or customer feedback comes in, you can expand it to your entire audience by running `code-push patch <APP_NAME> Production -r 100%`.*
319
+
*NOTE: If you want to take a more cautious approach, you can even choose to perform a "staged rollout" as part of #3, which allows you to mitigate additional potential risk with the update (like did your testing in #2 touch all possible devices/conditions?) by only making the production update available to a percentage of your users (for example `appcenter codepush promote -a <ownerName>/<appName> -s Staging -d Production -r 20`). Then, after waiting for a reasonable amount of time to see if any crash reports or customer feedback comes in, you can expand it to your entire audience by running `appcenter codepush patch -a <ownerName>/<appName> Production -r 100`.*
318
320
319
321
You'll notice that the above steps refer to a "staging build" and "production build" of your app. If your build process already generates distinct binaries per "environment", then you don't need to read any further, since swapping out CodePush deployment keys is just like handling environment-specific config for any other service your app uses (like Facebook). However, if you're looking for examples (**including demo projects**) on how to setup your build process to accommodate this, then refer to the following sections, depending on the platform(s) your app is targeting:
320
322
@@ -346,10 +348,10 @@ Since we recommend using the `Staging` deployment for pre-release testing of you
346
348
347
349
```javascript
348
350
// #1) Create your new deployment to hold releases of a specific app variant
appcenter codepush release-react -a <ownerName>/<appName> -d test-variant-one
353
355
```
354
356
355
357
*NOTE: The total user count that is reported in your deployment's "Install Metrics" will take into account users that have "switched" from one deployment to another. For example, if your `Production` deployment currently reports having 1 total user, but you dynamically switch that user to `Staging`, then the `Production` deployment would report 0 total users, while `Staging` would report 1 (the user that just switched). This behavior allows you to accurately track your release adoption, even in the event of using a runtime-based deployment redirection solution.*
@@ -382,7 +384,7 @@ Additionally, if you're looking to get started with React Native + CodePush, and
382
384
383
385
The `sync` method includes a lot of diagnostic logging out-of-the-box, so if you're encountering an issue when using it, the best thing to try first is examining the output logs of your app. This will tell you whether the app is configured correctly (like can the plugin find your deployment key?), if the app is able to reach the server, if an available update is being discovered, if the update is being successfully downloaded/installed, etc. We want to continue improving the logging to be as intuitive/comprehensive as possible, so please [let us know](mailto:[email protected]) if you find it to be confusing or missing anything.
384
386
385
-
The simplest way to view these logs is to run the `code-push debug` command for the specific platform you are currently working with (e.g. `code-push debug ios`). This will output a log stream that is filtered to just CodePush messages, for the specified platform. This makes it easy to identify issues, without needing to use a platform-specific tool, or wade through a potentially high volume of logs.
387
+
The simplest way to view these logs is to add the flag `--debug` for each command. This will output a log stream that is filtered to just CodePush messages. This makes it easy to identify issues, without needing to use a platform-specific tool, or wade through a potentially high volume of logs.
@@ -404,7 +406,7 @@ Now you'll be able to see CodePush logs in either debug or release mode, on both
404
406
|-----------------|-------------------|
405
407
| Compilation Error | Double-check that your version of React Native is [compatible](#supported-react-native-platforms) with the CodePush version you are using. |
406
408
| Network timeout / hang when calling `sync` or `checkForUpdate` in the iOS Simulator | Try resetting the simulator by selecting the `Simulator -> Reset Content and Settings..` menu item, and then re-running your app. |
407
-
| Server responds with a `404` when calling `sync` or `checkForUpdate` | Double-check that the deployment key you added to your `Info.plist` (iOS), `build.gradle` (Android) or that you're passing to `sync`/`checkForUpdate`, is in fact correct. You can run `code-push deployment ls [APP_NAME] -k` to view the correct keys for your app deployments. |
409
+
| Server responds with a `404` when calling `sync` or `checkForUpdate` | Double-check that the deployment key you added to your `Info.plist` (iOS), `build.gradle` (Android) or that you're passing to `sync`/`checkForUpdate`, is in fact correct. You can run `appcenter codepush deployment list <ownerName>/<appName> --displayKeys` to view the correct keys for your app deployments. |
408
410
| Update not being discovered | Double-check that the version of your running app (like `1.0.0`) matches the version you specified when releasing the update to CodePush. Additionally, make sure that you are releasing to the same deployment that your app is configured to sync with. |
409
411
| Update not being displayed after restart | If you're not calling `sync` on app start (like within `componentDidMount` of your root component), then you need to explicitly call `notifyApplicationReady` on app start, otherwise, the plugin will think your update failed and roll it back. |
410
412
| I've released an update for iOS but my Android app also shows an update and it breaks it | Be sure you have different deployment keys for each platform in order to receive updates correctly |
Copy file name to clipboardExpand all lines: docs/multi-deployment-testing-android.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
The [Android Gradle plugin](https://google.github.io/android-gradle-dsl/current/index.html) allows you to define custom config settings for each "build type" (like debug, release). This mechanism allows you to easily configure your debug builds to use your CodePush staging deployment key and your release builds to use your CodePush production deployment key.
8
8
9
-
*NOTE: As a reminder, you can retrieve these keys by running `code-push deployment ls <APP_NAME> -k` from your terminal.*
9
+
*NOTE: As a reminder, you can retrieve these keys by running `appcenter codepush deployment list -a <ownerName>/<appName> -k` from your terminal.*
Copy file name to clipboardExpand all lines: docs/setup-android.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,8 +59,8 @@ In order to integrate CodePush into your Android project, please perform the fol
59
59
```
60
60
61
61
4. Add the Deployment key to `strings.xml`:
62
-
63
-
To let the CodePush runtime know which deployment it should query for updates, open your app's `strings.xml` file and add a new string named `CodePushDeploymentKey`, whose value is the key of the deployment you want to configure this app against (like the key for the `Staging` deployment for the `FooBar` app). You can retrieve this value by running `code-push deployment ls <appName> -k` in the CodePush CLI (the `-k` flag is necessary since keys aren't displayed by default) 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 (like Staging) will not work. The "friendly name" is intended only for authenticated management usage from the CLI, and not for public consumption within your app.
62
+
63
+
To let the CodePush runtime know which deployment it should query for updates, open your app's `strings.xml` file and add a new string named `CodePushDeploymentKey`, whose value is the key of the deployment you want to configure this app against (like the key for the `Staging` deployment for the `FooBar` app). You can retrieve this value by running `appcenter codepush deployment list -a <ownerName>/<appName> -k` in the CodePush CLI (the `-k` flag is necessary since keys aren't displayed by default) and copying the value of the `Key` column which corresponds to the deployment you want to use (see below). Note that using the deployment's name (like Staging) will not work. The "friendly name" is intended only for authenticated management usage from the CLI, and not for public consumption within your app.
@@ -101,7 +101,7 @@ In order to accommodate as many developer preferences as possible, the CodePush
101
101
102
102
*Note: If you don't already have RNPM installed, you can do so by simply running `npm i -g rnpm` and then executing the above command.*
103
103
104
-
2. If you're using RNPM >=1.6.0, you will be prompted for the deployment key you'd like to use. If you don't already have it, you can retrieve this value by running `code-push deployment ls <appName> -k`, or you can choose to ignore it (by simply hitting `<ENTER>`) and add it in later. To get started, we would recommend just using your `Staging` deployment key, so that you can test out the CodePush end-to-end.
104
+
2. If you're using RNPM >=1.6.0, you will be prompted for the deployment key you'd like to use. If you don't already have it, you can retrieve this value by running `appcenter codepush deployment list -a <ownerName>/<appName> -k`, or you can choose to ignore it (by simply hitting `<ENTER>`) and add it in later. To get started, we would recommend just using your `Staging` deployment key, so that you can test out the CodePush end-to-end.
105
105
106
106
And that's it for installation using RNPM! Continue below to the [Plugin Configuration](#plugin-configuration-for-react-native-lower-than-060-android) section to complete the setup.
107
107
@@ -168,7 +168,7 @@ public class MainApplication extends Application implements ReactApplication {
168
168
protected List<ReactPackage> getPackages() {
169
169
// 3. Instantiate an instance of the CodePush runtime and add it to the list of
170
170
// existing packages, specifying the right deployment key. If you don't already
171
-
// have it, you can run "code-push deployment ls <appName> -k" to retrieve your key.
171
+
// have it, you can run "appcenter codepush deployment list -a <ownerName>/<appName> -k" to retrieve your key.
172
172
return Arrays.<ReactPackage>asList(
173
173
new MainReactPackage(),
174
174
new CodePush("deployment-key-here", MainApplication.this, BuildConfig.DEBUG)
@@ -245,7 +245,7 @@ public class MainActivity extends ReactActivity {
245
245
protectedList<ReactPackage>getPackages() {
246
246
// 3. Instantiate an instance of the CodePush runtime and add it to the list of
247
247
// existing packages, specifying the right deployment key. If you don't already
248
-
// have it, you can run "code-push deployment ls <appName> -k" to retrieve your key.
248
+
// have it, you can run "appcenter codepush deployment list -a <ownerName>/<appName> -k" to retrieve your key.
0 commit comments