Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Android Command Line Quickref
This is a work in progress.
==========================================
ABD
==========================================
List devices adb devices
Start shell adb shell
Install apk adb install path/to/apk
==========================================
SHELL COMMANDS
==========================================
Activity manager am
Package manager pm
==========================================
BUILDING
==========================================
Build debug ./gradlew assembleDebug
Build staging ./gradlew assembleStaging
==========================================
DEBUGGING
==========================================
List debuggable pids adb jdwp
Setup port forwarding adb forward tcp:<port #> jdwp:<relevant pid>
Launch jdb jdb -sourcepath <path to src> -attach localhost:<port #>
Breakpoint in method stop in com.myPackage.Class.methodName
Breakpoint by line # stop at com.myPackage.Class lineNumber
list show surrounding source code
step execute current line (step into)
next step over
step up step until current method returns
help see available commands
==========================================
CREATING PROJECTS
==========================================
List target SDKs android list targets
Create project android create project
==========================================
MANAGING AVDs
==========================================
Create AVD android create avd -n <name> -t <targetID>
Delete AVD android delete avd -n <name>
Update AVD paths android update avd -n <name>
Move AVD android move avd -n <name>
List AVDs android list avd
Start emulator emulator -avd <avd-name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment