React Native Web CLI
create-react-native-web-app
A simple CLI tool to start your React Native Web project to develop same app for IOS Android and Web
Compatibility: React Native >= 0.63.
Installation
```shRun create-react-native-web-app
$ npx crnwa myApp
or
$ npx create-react-native-web-app myApp
if you previously installed this package globaly run this command first to uninstall the previous version:
npm uninstall -g create-react-native-web-app
cd into your
$ cd myApp
Run Web/Ios/Android development
Web
$ npm run web
IOS
$ npm run ios
Android
$ npm run android
```
- To work with IOS and Android - Install Xcode and Android studio and follow the react native instructions under the "React Native CLI Quickstart" tab
Folder structure
``` myApp ├── android (When opening with Android studio, open this folder) │ └── android project files ├── ios (When opening with Xcode, open this folder) │ └── ios project files ├── public │ ├── favicon.ico │ ├── index.html │ └── manifest.json └── src└── project code
```
Testing
```shWeb and Native
$ npm run test
Web
$ npm run test:web
Native
$ npm run test:native
```
Debugging
Open dev menu:- CMD+D (IOS) / CMD+M (Android)
- Press "Enable Live-Reload"
Build
```shWeb
$ npm run build
Android - upgrade the current build version in
Example:
versionCode 2
versionName "1.1"
android/app/build.gradle
file (both the versionCode
and the versionName
)And then run the build
$ cd android && ./gradlew assembleRelease
Open apk folder to find the release apk
$ open ./android/app/build/outputs/apk
```
React native docs - Android signed apk
React native docs for IOS