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: cli/README.md
+41-36Lines changed: 41 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,11 +227,11 @@ When the metrics cell reports `No installs recorded`, that indicates that the se
227
227
228
228
Once your app has been configured to query for updates against the CodePush server, you can begin releasing updates to it. In order to provide both simplicity and flexibility, the CodePush CLI includes three different commands for releasing updates:
229
229
230
-
1.[General](#releasing-updates-general) - Simply uploads an update to the CodePush server, and therefore, provides the most flexibility in terms of how to generate the update in the first place (e.g. are you using a `gulp` task? running a custom shell script?), since it doesn't apply any opinion about it.
230
+
1.[General](#releasing-updates-general) - Releases an update to the CodePush server that was generated by an external tool or build script (e.g. a Gulp task, the `react-native bundle` command). This provides the most flexibility in terms of fitting into existing workflows, since it strictly deals with CodePush-specific step, and leaves the app-specific compilation process to you.
231
231
232
-
2.[React Native](#releasing-updates-react-native) - Performs the same functionality as the general release command, but also handles the work of generating the updated contents for you (JS bundle and assets), instead of requiring you to run both `react-native bundle` and then `code-push release`.
232
+
2.[React Native](#releasing-updates-react-native) - Performs the same functionality as the general release command, but also handles the task of generating the updated app contents for you (JS bundle and assets), instead of requiring you to run both `react-native bundle` and then `code-push release`.
233
233
234
-
3.[Cordova](#releasing-updates-cordova) - Performs the same functionality as the general release command, but also handles the work of preparing the app update for you, instead of requiring you to run both `cordova prepare` and then `code-push release`.
234
+
3.[Cordova](#releasing-updates-cordova) - Performs the same functionality as the general release command, but also handles the task of preparing the app update for you, instead of requiring you to run both `cordova prepare` and then `code-push release`.
235
235
236
236
Which of these commands you should use is mostly a matter of requirements and/or preference. However, we generally recommend using the relevant platform-specific command to start (since it greatly simplifies the experience), and then leverage the general-purpose `release` command if/when greater control is needed.
This specifies the name of the CodePush app that this update is being released for.
251
+
This specifies the name of the CodePush app that this update is being released for. This value corresponds to the friendly name that you specified when originally calling `code-push app add` (e.g. "MyApp-Android"). If you need to look it up, you can run the `code-push app ls` command to see your list of apps.
252
252
253
253
#### Update contents parameter
254
254
255
-
This specifies the location of the code and assets you want to release. You can provide either a single file (e.g. a JS bundle for a React Native app), or a path to a directory (e.g. the `/platforms/ios/www` folder for a Cordova app). You don't need to zip up multiple files or directories in order to deploy those changes, since the CLI will automatically zip them for you.
255
+
This specifies the location of the updated app code and assets you want to release. You can provide either a single file (e.g. a JS bundle for a React Native app), or a path to a directory (e.g. the `/platforms/ios/www` folder for a Cordova app). Note that you don't need to ZIP up multiple files or directories in order to deploy those changes, since the CLI will automatically ZIP them for you.
256
256
257
-
It's important that the path you specify refers to the platform-specific, prepared/bundled version of your app. The following table outlines which command you should run before releasing, as well as the location you can subsequently point at using the `updateContents` parameter:
257
+
It's important that the path you specify refers to the platform-specific, prepared/bundled version of your app. The following table outlines which command you should run before releasing, as well as the location you can subsequently refer to using the `updateContents` parameter:
@@ -310,12 +310,6 @@ This provides an optional "change log" for the deployment. The value is simply r
310
310
311
311
*NOTE: This parameter can be set using either "--description" or "-desc"*
312
312
313
-
#### Disabled parameter
314
-
315
-
This specifies whether an update should be disabled. A disabled update is one that is not acquirable by clients. If left unspecified, the update will not be disabled, i.e. clients configured to receive updates from the particular deployment will receive the update [if it applies to them](#target-binary-version-parameter).
316
-
317
-
*NOTE: This parameter can be set using either "--disabled" or "-x"*
318
-
319
313
#### Mandatory parameter
320
314
321
315
This specifies whether the update should be considered mandatory or not (e.g. it includes a critical security fix). This attribute is simply round tripped to the client, who can then decide if and how they would like to enforce it.
@@ -354,6 +348,12 @@ This specifies the percentage of users (as an integer between `1` and `100`) tha
354
348
355
349
*NOTE: This parameter can be set using either `--rollout` or `-r`*
356
350
351
+
#### Disabled parameter
352
+
353
+
This specifies whether an update should be acquirable by end users or not. If left unspecified, the update will not be disabled (i.e. users will download it the moment your app calls `sync`). This parameter can be valuable if you want to release an update that isn't immediately available, until you expicitly [patch it](#patching-releases) when you want end users to be able to download it (e.g. an announcement blog post went live).
354
+
355
+
*NOTE: This parameter can be set using either "--disabled" or "-x"*
356
+
357
357
### Releasing Updates (React Native)
358
358
359
359
```shell
@@ -407,10 +407,6 @@ This is the same parameter as the one described in the [above section](#app-name
407
407
408
408
This specifies which platform the current update is targeting, and can be either `ios` or `android` (case-insensitive).
409
409
410
-
#### Bundle name parameter
411
-
412
-
This specifies the file name that should be used for the generated JS bundle. If left unspecified, the standard bundle name will be used for the specified platform: `main.jsbundle` (iOS) and `index.android.bundle` (Android).
413
-
414
410
#### Deployment name parameter
415
411
416
412
This is the same parameter as the one described in the [above section](#deployment-name-parameter).
@@ -419,34 +415,38 @@ This is the same parameter as the one described in the [above section](#deployme
419
415
420
416
This is the same parameter as the one described in the [above section](#description-parameter).
421
417
422
-
#### Development parameter
418
+
#### Mandatory parameter
423
419
424
-
This specifies whether to generate a unminified, development JS bundle. If left unspecified, this defaults to `false` where warnings are disabled and the bundle is minified.
420
+
This is the same parameter as the one described in the [above section](#mandatory-parameter).
421
+
422
+
#### Rollout parameter
423
+
424
+
This is the same parameter as the one described in the [above section](#rollout-parameter). If left unspecified, the release will be made available to all users.
425
+
426
+
#### Target binary version parameter
427
+
428
+
This is the same parameter as the one described in the [above section](#target-binary-version-parameter). If left unspecified, this defaults to targeting the exact version specified in the app's `Info.plist` (for iOS) and `build.gradle` (for Android) files.
425
429
426
430
#### Disabled parameter
427
431
428
432
This is the same parameter as the one described in the [above section](#disabled-parameter).
429
433
434
+
#### Development parameter
435
+
436
+
This specifies whether to generate a unminified, development JS bundle. If left unspecified, this defaults to `false` where warnings are disabled and the bundle is minified.
437
+
430
438
#### Entry file parameter
431
439
432
440
This specifies the relative path to app's root/entry JavaScript file. If left unspecified, this defaults to `index.ios.js` (for iOS) or `index.android.js` (for Android) if that file exists, or `index.js` otherwise.
433
441
434
-
#### Mandatory parameter
442
+
#### Bundle name parameter
435
443
436
-
This is the same parameter as the one described in the [above section](#mandatory-parameter).
444
+
This specifies the file name that should be used for the generated JS bundle. If left unspecified, the standard bundle name will be used for the specified platform: `main.jsbundle` (iOS) and `index.android.bundle` (Android).
437
445
438
446
#### Sourcemap output parameter
439
447
440
448
This specifies the relative path to where the generated JS bundle's sourcemap file should be written. If left unspecified, sourcemaps will not be generated.
441
449
442
-
#### Target binary version parameter
443
-
444
-
This is the same parameter as the one described in the [above section](#target-binary-version-parameter). If left unspecified, this defaults to targeting the exact version specified in the app's `Info.plist` (for iOS) and `build.gradle` (for Android) files.
445
-
446
-
#### Rollout parameter
447
-
448
-
This is the same parameter as the one described in the [above section](#rollout-parameter). If left unspecified, the release will be made available to all users.
449
-
450
450
### Releasing Updates (Cordova)
451
451
452
452
```shell
@@ -495,25 +495,25 @@ This is the same parameter as the one described in the [above section](#deployme
495
495
496
496
This is the same parameter as the one described in the [above section](#description-parameter).
497
497
498
-
#### Disabled parameter
499
-
500
-
This is the same parameter as the one described in the [above section](#disabled-parameter).
501
-
502
498
#### Mandatory parameter
503
499
504
500
This is the same parameter as the one described in the [above section](#mandatory-parameter).
505
501
502
+
#### Rollout parameter
503
+
504
+
This is the same parameter as the one described in the [above section](#rollout-parameter). If left unspecified, the release will be made available to all users.
505
+
506
506
#### Target binary version parameter
507
507
508
508
This is the same parameter as the one described in the [above section](#target-binary-version-parameter). If left unspecified, the command defaults to targeting only the specified version in the project's metadata (`Info.plist` if this update is for iOS clients, and `build.gradle` for Android clients).
509
509
510
-
#### Rollout parameter
510
+
#### Disabled parameter
511
511
512
-
This is the same parameter as the one described in the [above section](#rollout-parameter). If left unspecified, the release will be made available to all users.
512
+
This is the same parameter as the one described in the [above section](#disabled-parameter).
513
513
514
514
## Patching Updates
515
515
516
-
After releasing an update, there may be scenarios where you need to modify one or more of the attributes associated with the release (e.g. you forgot to mark a critical bug fix as mandatory, you want to increase the rollout percentage of an update). You can easily do this by running the following command:
516
+
After releasing an update, there may be scenarios where you need to modify one or more of the attributes associated with it (e.g. you forgot to mark a critical bug fix as mandatory, you want to increase the rollout percentage of an update). You can easily do this by running the following command:
Aside from the `appName` and `deploymentName`, all parameters are optional, and therefore, you can use this command to update just a single attribute or all of them at once. Calling the `patch` command without specifying any attribute flag will result in a no-op.
527
527
528
+
```shell
529
+
code-push patch MyApp Production -m
530
+
code-push patch MyApp Production -l v23 -rollout 50%
531
+
```
532
+
528
533
#### Label Parameter
529
534
530
-
Indicates which release (e.g. `v23`) you want to update within the specified deployment. If ommitted, the requested changes will be applied to the latest release in the specified deployment.
535
+
Indicates which release (e.g. `v23`) you want to update within the specified deployment. If ommitted, the requested changes will be applied to the latest release in the specified deployment. In order to look up the label for the release you want to update, you can run the `code-push deployment history` command and refer to the `Label` column.
531
536
532
537
*NOTE: This parameter can be set using either `--label` or `-l`*
0 commit comments