Skip to content

Instantly share code, notes, and snippets.

@jefersondaniel
Last active April 13, 2021 17:53
Show Gist options
  • Save jefersondaniel/c1f5722c26229d8f990528cdcb91543e to your computer and use it in GitHub Desktop.
Save jefersondaniel/c1f5722c26229d8f990528cdcb91543e to your computer and use it in GitHub Desktop.
ADB Cheatsheet

Uninstall, Install, Run and Stop

adb uninstall com.package
adb install -r app.apk
adb shell am start -n com.package/com.package.Activity
adb shell am force-stop com.package

Take Screenshot

adb exec-out screencap -p > screen.png

Record Video

adb shell screenrecord /sdcard/video.mp4 # type Ctrl+C to finish
adb pull /sdcard/video.mp4
adb shell rm /sdcard/video.mp4

Simulate keyboard

adb shell input keyboard text "dos%srubias"
adb shell input keyevent 82
adb shell input text "RR"

Run with custom intent

adb shell am start -n com.package/com.package.Activity -a android.intent.action.VIEW -d scheme://data

Setup adb remote

adb tcpip 5555
adb connect 192.168.0.105:5555

Get logcat

adb logcat -d
adb logcat

Clear data

adb shell pm clear com.vix.fire.vixtv

Reverse

adb reverse tcp:8081 tcp:8081

Coonfigure HTTP Proxy

# Add
adb shell settings put global http_proxy <address>:<port>

# Delete
adb shell settings delete global http_proxy
adb shell settings delete global global_http_proxy_host
adb shell settings delete global global_http_proxy_port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment