Command Line Instructions
Check version installed
Section titled “Check version installed”$ react-native -vExample Output
react-native-cli: 0.2.0react-native: n/a - not inside a React Native project directory //Output from different folderreact-native: react-native: 0.30.0 // Output from the react native project directoryInitialize and getting started with React Native project
Section titled “Initialize and getting started with React Native project”To initialize
react-native init MyAwesomeProjectTo initialize with a specific version of React Native
react-native init --version="0.36.0" MyAwesomeProjectTo Run for Android
cd MyAwesomeProjectreact-native run-androidTo Run for iOS
cd MyAwesomeProjectreact-native run-iosUpgrade existing project to latest RN version
Section titled “Upgrade existing project to latest RN version”In the app folder find package.json and modify the following line to include the latest version, save the file and close.
"react-native": "0.32.0"In terminal:
$ npm installFollowed by
$ react-native upgradeLogging
Section titled “Logging”Android
$ react-native log-androidiOS
$ react-native log-iosStart React Native Packager
Section titled “Start React Native Packager”$ react-native startOn latest version of React Native, no need to run the packager. It will run automatically.
By default this starts the server at port 8081. To specify which port the server is on
$ react-native start --port PORTNUMBERAdd android project for your app
Section titled “Add android project for your app”If you either have apps generated with pre-android support or just did that on purpose, you can always add android project to your app.
$ react-native androidThis will generate android folder and index.android.js inside your app.