- Clear cache android
cd android && ./gradlew clean && cd ..
- Clear cache npm
npm cache clean --force
-
Run node service
- Use npm:
npm run start
- Use yarn:
yarn start
- Run with reset cache:
yarn start --reset-cache
-
Run app android
react-native run-android
- Run app ios
react-native run-ios
- Run app ios with simulator
react-native run-ios --simulator="iPhone 11 Pro Max"
- To show list simulator run command
xcrun simctl list devices
- Show log native android
adb logcat
- Show log native android
adb logcat --pid=`adb shell pidof -s com.yourpackage`
- Build app android release
cd android && ./gradlew assembleRelease && cd ..
- Build app android bundle release
cd android && ./gradlew bundleRelease && cd ..
-
Build app android release debug
- Step 1 run command
react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res
- Step 2 run
cd android && ./gradlew assembleDebug && cd ..
-
Open emulator android
- Show list emulator android
emulator -list-avds
- Open emulator
/Users/YourComputerName/Library/Android/sdk/emulator/emulator -avd EmulatorName -netdelay none -netspeed full
YourComputerName: Your computer name (Ex: MyComputer)
EmulatorName: Emulator name (Ex: Pixel_3a_API_30_x86)
- Login normal
npm login
- Login with scope
npm login —scope=@[scope]
- Create profile
npm init —scope=@[scope]
- Switch scope
npmrc [profile-name]
- Publish
npm publish --access public
- Unpublish
npm unpublish -f @[scope]/[package-name]n@[version]
(-f --> force)
- Create Tag
git tag v1.0.0
- Pushing a Tag
git push origin v1.0.0
- Create keystore
keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
- Create SHA-1 certificate fingerprints
keytool -list -v -keystore PathToYourApp/android/app/my-release-key.keystore -alias my-key-alias -storepass mystorepass -keypass mykeypass
- Copy ssh key
pbcopy < ~/.ssh/id_rsa.pub
adb shell am start -a android.intent.action.VIEW -d "your-deep-link” app-package-name
- Error verifyReleaseResources
// add to bottom of file android/build.gradle
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
}
}
}
}
- Error can't call api with http on android
// add to application tag of AndroidManifest.xml file
android:usesCleartextTraffic="true"