Skip to content

Instantly share code, notes, and snippets.

@conorliv
Last active August 29, 2015 14:21
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 conorliv/7b1bba77869ee55d19d2 to your computer and use it in GitHub Desktop.
Save conorliv/7b1bba77869ee55d19d2 to your computer and use it in GitHub Desktop.
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