muerwre.github.io/content/Frontend/React Native/Useful comands.md
2022-11-04 18:29:11 +06:00

1.3 KiB

Show android logcat

adb logcat com.application:I "*:S"

Get .apk's SHA-256

keytool -printcert -jarfile "$1"

Assemble debug release on Android

Packages release with bundled resources.

npx 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/

cd android && ./gradlew assembleDebug

# do your stuff

./gradlew clean

Send release to Android device

cd ./android \
  && ./gradlew assembleRelease \
  && adb install ./app/build/outputs/apk/release/app-release.apk
# ios 
xcrun simctl openurl booted $1

# android
adb shell am start -W -a android.intent.action.VIEW -d $1 \
com.application
PACKAGE="com.application"

adb shell pm set-app-links --package $PACKAGE 0 all && \
  adb shell pm verify-app-links --re-verify $PACKAGE