To get the list of available emulator
1 |
emulator -list-avds |
To open a emulator
1 |
emulator -avd Pixel_API_30 |
Listing all available simulators
1 |
xcrun simctl list |
open -a Simulator
1 2 3 |
react-native run-ios --simulator="iPhone 4s" react-native run-ios --simulator="iPhone Xʀ" react-native run-ios --simulator="iPhone 6" |
Print log on Terminal
1 2 3 4 5 |
react-native log-android react-native log-ios react-native run-ios --device "Anshul’s iPhone" |
React Devtools
https://github.com/facebook/react-devtools/tree/master/packages/react-devtools
Reset Cache
1 |
npm start -- --reset-cache |
Update Dependency
1 2 3 |
npm i -g npm-check-updates ncu -u npm install |
1 |
react-native unlink react-native-gesture-handler --platforms ios |
1. Clear watchman watches: watchman watch-del-all
.
2. Delete the node_modules
folder: rm -rf node_modules && npm install
.
3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-*
or npm start -- --reset-cache
.
4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*
.
Build APK
1 |
keytool -genkey -v -keystore my-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000 |
1 2 3 4 |
cd android chmod +x gradlew ./gradlew assembleRelease ./gradlew assembleDebug |
if ./gradlew: Permission denied
1 |
chmod +x gradlew |
Import React-Native bundle
1 |
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res |
Follow this tutorial for creating SHA1 fingerprint for Google Map v2
For Debug mode::
1 |
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android |
for Release mode::
1 |
keytool -list -v -keystore {keystore_name} -alias {alias_name} |
example:
1 |
keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test |
Android Studio Heap Memory
if Android Studio give overload CG issue.
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true