Useful Commands

React-Native

CommandDescription
npx react-native@latest init AwesomeProjectCreating a new application
react-native run-androidrun app on android
react-native run-iosrun app on android
react-native link [LIBRARY-NAME]Link dependencies
npm install babel-plugin-transform-decorators-legacy --save
npm install babel-plugin-transform-class-properties --save
Install Babel for JSX
react-native bundle --dev false --platform android --entry-file index.android.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug

cd android
./gradlew assembleDebug
apk in android/app/build/outputs/apk/app-debug.apk

Create debug build
react-native start
# OR if you don't have react-native installed in the machine
npx react-native start
Start Metro Server
watchman watch-del-allWatchman Clean
react-native -vreact-native version
npm view react-native versionactual react native version
npm installinstall project dependencies
npm view react-scripts versionreact-native script version
npx react-native ram-bundleOptimize the loading of the bundle by using the RAM format
npx react-native bundleJavaScript bundle for offline use:

Flutter

CommandDescription
flutter create my_appCreate an App
flutter analyze -d <DEVICE_ID>Analyze the Dart Code
flutter run <DART_FILE>Run a Dart file
flutter pub getDownload Dependencies/Packages
flutter pub updateUpdate Flutter packages
flutter --help --verboseGet Help
flutter doctorCheck Project Health
flutter versionCheck Version
flutter channel <CHANNEL_NAME>Check Channels
flutter build Build the Project
flutter devices -d <DEVICE_ID>List Connected Devices
flutter upgradeUpgrade Flutter Version
flutter assemble -o Get necessary Packages for Project
flutter downgradeDowngrade Flutter/Dart SDKs
flutter emulatorsList available Emulators
flutter install -d <DEVICE_IDInstall Flutter App on a Device
flutter logsView Terminal logs

Cordova

CommandDescription
cordova cleanclean project
ionic cordova plugin listsee plugin list
ionic cordova remove plugin-nameremove a plugin
ionic cordova platform add androidadd android platform
ionic cordova platform add iosadd ios platform
ionic cordova build androidbuild an app for android
ionic cordova run androidrun-app for android
ionic cordova build iosbuild an app for ios
ionic cordova run-iosrun-app for ios
ionic start myApp blankcreate an app without tabs
ionic start myApp tabscreate an app with tabs

Capacitor

CommandDescription
npm init @capacitor/appNew Capacitor app
ionic integrations enable capacitorEnable capacitor in Existing Project
npm i @capacitor/app @capacitor/haptics @capacitor/keyboard @capacitor/status-barInstall Capacitor Plugin Dependencies
ionic capacitor add android
ionic capacitor add ios
Add Platforms
ionic cap run android -l --externalRun app with live reload (Android)
ionic cap run ios -l --externalRun app with live reload (iOS)
ionic capacitor copy android --prod && cd android && ./gradlew assembleRelease && cd ..Generate a release APK without opening the android studio
ionic capacitor copy android && cd android && ./gradlew assembleDebug && cd ..Generate a debug APK without opening the android studio
cordova-res --skip-config --copyGenerate icons & splash screen without specifying platform
ionic capacitor copy android && cd android && ./gradlew assembleDebug && ./gradlew installDebug && cd ..Build and run apk directly on the device from CLI