1. Common commands
// Delete the folderRm -rf Directory name// Lists the occupied ports
lsof -n -i4TCP:8081
// Find the corresponding PID and delete it
kill -9 <PID>
// Rerun the project
react-native run-ios/android
// Package command
npm run bundle-ios
"bundle-ios":"node node_modules/react-native/local-cli/cli.js bundle --entry-file index.ios.js --platform ios --dev false --bundle-output ./ios/bundle/index.ios.jsbundle --assets-dest ./ios/bundle"sudo npm install --save react-native-code-push sudo npm update --save react-native-gesture-handler sudo react-native link react-native-gesture-handler sudo npm install --save react-native-code-push sudo react-native link react-native-code-push react-native install react-native-code-push sudo react-native install react-native-code-push sudo npm install --save react-native-code-push -unsafe-perm=true --allow-root --save-dev grunt
npm install react-native-code-push --save
1Clear watchman watches: Watchman watch-del-all2Delete the node_modules folder: rm -rf node_modules && NPM install.3Reset packager cache: rm -fr $TMPDIR/react-* or NPM start -- reset-cache** react-native init BloomBeautyRN --version0.591.
"react-native": "0.59.1".//React Native version degraded
react-native init --version=0.42. 0
npm install --save react-native@0.42
// Update library references
npm update jshare-react-native
npm update react-navigation-tabs
// Install the react-native git-upgrade module
$ sudo npm install -g react-native-git-upgrade
// This will directly upgrade React Native to the latest version
$ react-native-git-upgrade
// Upgrade React Native to the specified X.Y.Z version
$ react-native-git-upgrade X.Y.Z
指定运行
react-native run-ios --simulator "iPhone 5"In XCode's Project Navigator, right-click Libraries ➜ Add Files to [your Project name] * go to node_modules ➜ react-native update ➜ In the project navigator in XCode, select your project and add it to Build Phases ➜ Link Binary WithLibraries Librcthotupdate. a * Continue to Search for Header Search Path in Build Settings, add $(SRCROOT)/.. /node_modules/react-native-update/ios * Run your project (Cmd+R0.13to0.14Version, or0.28to0.29React-native bundle builds js offline bundlesOptions: -h, --help Displays information about how to use --entry-file <path> Path to the RN entry file, --platform [string] ios or andorID --transformer [string] Specify a custom transformer to be used --dev If it is [Boolean]false, warnings will not be displayed and the size of the packets will be smaller --prepack when passing, Prepack output will be formatted using Prepack --bridge-config [string] Prepack a JSON file __fbBatchedBridgeConfig for example: /bridgeconfig. Json --bundle-output <string> Output directory of packaged files, for example:/tmp/gRoups. bundle --bundle-encoding [string] Roups. bundle --bundle-encoding [string]//nodejs.org/api/buffer.html#buffer_buffer.--sourcemap-output [string] Generate SourceMap, but0.14The source map will no longer be generated automatically. You need to specify this parameter manually. Ex. :/tmp/gRoups. map --assets-dest [string] Storage path of image resources when packaging --verbose displays the packaging process --reset-cache Removes cache files --config [string] Configuration file path of the command lineCopy the code
2.Code push version
/ / reference: [https://www.jianshu.com/p/88b54e003027] (https://www.jianshu.com/p/88b54e003027)
// Issue the command
/ / formal:
code-push release-react BloomBeautyRN ios --t 1.0. 0 --dev false --d Production --des "xxxxxx" --m true
/ / test:
code-push release-react BloomBeautyRN ios --t 1.01. --dev true --d Staging --des "xxxxxx" --m true
// Displays the historical version
code-push deployment history BloomBeautyRN Staging
Copy the code