筆記:
Command:
發佈:
預設是Stage
code-push release-react <App Name> <android or iOS> --noDuplicateReleaseError發Production:加個 --d Production
code-push release-react <App Name> <android or iOS> --d Production --noDuplicateReleaseError
察看發送版本:
code-push deployment ls <App Name>
包版生成bundle:
1. 先在專案資料夾下打 mk bundle
2. 以Android為例
react-native bundle --platform android --entry-file index.android.js --bundle-output ./bundles/index.android.bundle --dev false
3.以iOS為例
react-native bundle --platform ios --entry-file index.ios.js --bundle-output ./bundles/index.ios.bundle --dev false
發佈:
Android 為例:
code-push release <App Name> ./bundles/index.android.bundle 4.0.1 --deploymentName <Staging or Production> --mandatory true
iOS 為例:
code-push release <App Name> ./bundles/index.ios.bundle 4.0.1 --deploymentName <Staging or Production> --mandatory true
坑:
[Error] The uploaded package is identical to the contents of the specified deployment's current release.
起因,發佈新stage上去後產生的錯誤
解法:command 後 加上 --noDuplicateReleaseError
code-push release-react <AppName> android --noDuplicateReleaseError
2.