Skip to content

Instantly share code, notes, and snippets.

@yomybaby
Last active April 17, 2019 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yomybaby/f4a6610d84a92c045a5e39b7038dff36 to your computer and use it in GitHub Desktop.
Save yomybaby/f4a6610d84a92c045a5e39b7038dff36 to your computer and use it in GitHub Desktop.
Collection of CLI for iOS/Android Simulator/Emulator with react-native

Launch & Terminate Application

# iOS
xcrun simctl terminate booted org.reactjs.native.example.codejong-example
xcrun simctl launch booted org.reactjs.native.example.codejong-example

# Android
adb shell am start -n com.codejong_example/com.codejong_example.MainActivity
adb shell am force-stop com.codejong_example

Delete App

# iOS
xcrun simctl uninstall booted org.reactjs.native.example.codejong-example

# Android
adb uninstall com.codejong_example

Open URL

# iOS
xcrun simctl openurl booted mychat://chat/Eric

# Android
adb shell am start -W -a android.intent.action.VIEW -d "mychat://mychat/chat/Eric" com.simpleapp

Send Text

# iOS : If you know how to send key stroke form cli to simulator without activating simulator, please let me know :)

# Android : Refresh React Nativ app
adb shell input text "RR"

# Android : Show Dev Menu (Send Text)
adb shell input keyevent 82

Get App Container directory path

# iOS
xcrun simctl get_app_container booted org.reactjs.native.example.codejong-example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment