React Native: Useful command lines

Clear cache

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf /tmp/haste-map-react-native-packager-* && rm -rf node_modules/ && yarn cache clean && yarn install && yarn --reset-cache
watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf /tmp/haste-map-react-native-packager-* && rm -rf node_modules/ && yarn cache clean && yarn install && yarn --reset-cache
watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf /tmp/haste-map-react-native-packager-* && rm -rf node_modules/ && yarn cache clean && yarn install && yarn --reset-cache

Clean Android gradle

SDK location not found

Create “local.properties” file

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cd android
vim local.properties
sdk.dir=/Users/*****/Library/Android/sdk
cd android vim local.properties sdk.dir=/Users/*****/Library/Android/sdk
cd android
vim local.properties
sdk.dir=/Users/*****/Library/Android/sdk

Rebuild Android dependencies

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cd android
./gradlew clean
cd android ./gradlew clean
cd android
./gradlew clean

Clean iOS pod

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cd ios
rm -rf Podfile.lock
pod install
cd ios rm -rf Podfile.lock pod install
cd ios
rm -rf Podfile.lock
pod install

react-devtools

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
react-devtools
react-devtools
react-devtools

pod install

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
pod update && pod cache clean --all && pod install
pod update && pod cache clean --all && pod install
pod update && pod cache clean --all && pod install

Test deep link on iOS simulator

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
xcrun simctl openurl booted "deeplink_url"
xcrun simctl openurl booted "deeplink_url"
xcrun simctl openurl booted "deeplink_url"

Debug on real Android device

Install adb

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask install android-platform-tools
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew cask install android-platform-tools
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew cask install android-platform-tools

Debug

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
adb devices
adb -s <device name> reverse tcp:8081 tcp:8081
yarn android
adb devices adb -s <device name> reverse tcp:8081 tcp:8081 yarn android
adb devices
adb -s <device name> reverse tcp:8081 tcp:8081
yarn android

Android – Keystore file not found for signing config ‘debug’.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cd android/app/
keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
cd android/app/ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
cd android/app/
keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

Bundle commands

Release

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
react-native bundle --minify --entry-file index.js --platform ios --dev false --bundle-output main.jsbundle
react-native bundle --minify --entry-file index.js --platform ios --dev false --bundle-output main.jsbundle
react-native bundle --minify --entry-file index.js --platform ios --dev false --bundle-output main.jsbundle

Debug

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
react-native bundle --minify --entry-file index.js --platform ios --dev true --bundle-output main.jsbundle
react-native bundle --minify --entry-file index.js --platform ios --dev true --bundle-output main.jsbundle
react-native bundle --minify --entry-file index.js --platform ios --dev true --bundle-output main.jsbundle

Be the first to comment

Leave a Reply

Your email address will not be published.


*