Skip to content

Instantly share code, notes, and snippets.

@matheuseduardo
Created August 14, 2016 04:37
Show Gist options
  • Save matheuseduardo/5fea6cfc5b564bd1b847a9b85f3cd2d2 to your computer and use it in GitHub Desktop.
Save matheuseduardo/5fea6cfc5b564bd1b847a9b85f3cd2d2 to your computer and use it in GitHub Desktop.
android adb commands
# Toggle Airplane Mode
# http://stackoverflow.com/questions/10506591/turning-airplane-mode-on-via-adb
am start -a android.settings.AIRPLANE_MODE_SETTINGS && input keyevent 19 && input keyevent 23 && input keyevent 4
# Turn on:
adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
# Turn off:
adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
# send keyevents / inputs
# http://stackoverflow.com/questions/7789826/adb-shell-input-events
adb shell input keyevent 82 # menu
adb shell input keyevent 66 # enter
adb shell input keyevent 3 # home
adb shell input keyevent 4 # back
adb shell input swipe 100 500 100 1450 100 # swipe
adb shell input text TEXTO # enviar textp
# shutdown
adb shell su -c 'svc power shutdown'
# broadcast shutdown
adb shell su -c 'am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN --ez KEY_CONFIRM true --activity-clear-task'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment