# HG changeset patch # User Oleksandr Gavenko # Date 1401110417 -10800 # Node ID 1551e7edcfa0825aabdddc8a7fe5637c8bea6da9 # Parent 70096c1070dbad257dad7ab7be8ec3283f7756f4 ADB tips. diff -r 70096c1070db -r 1551e7edcfa0 android.rst --- a/android.rst Mon May 19 08:24:05 2014 +0300 +++ b/android.rst Mon May 26 16:20:17 2014 +0300 @@ -51,4 +51,54 @@ http://teamw.in/project/twrp2 Custom recovery built. +ADB tips. +========= +List available devices:: + + $ adb devices + +Install application from ``.apk`` file:: + + $ adb install -r /path/to/application.apk + +List installed package names:: + + $ adb shell 'pm list packages -f' + +Uninstall application by it name:: + + $ adb uninstall PACKAGE_NAME + +List currently run activities:: + + $ adb shell 'dumpsys activity' + +Find activities from package:: + + $ adb shell 'pm list packages -f' + $ adb pull APK_FROM_LIST + $ aapt dump badging APK_FILE + +Start an activity:: + + $ adb shell am start PACKAGE_NAME/ACTIVITY_IN_PACKAGE + $ adb shell am start PACKAGE_NAME/FULLY_QUALIFIED_ACTIVITY + +Take a screenshort:: + + $ adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png + +Power button:: + + $ adb shell input keyevent 26 + +Unlock screen:: + + $ adb shell input keyevent 82 + +Show system log:: + + $ adb logcat + $ adb logcat "*:W" +