Important adb commands

sureshone 865 views 5 slides Aug 18, 2016
Slide 1
Slide 1 of 5
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5

About This Presentation

Android adb important and advanced commands


Slide Content

Activity Manager Adb shell am start - start activity A db shell am startservice or stopservice - start or stop service Adb shell am broadcast – send broadcast Adb shell switch-user <UID > - switch between users Package Manager Adb shell pm list packages or users or permissions Adb shell pm install or uninstall Adb shell pm enable or disable Adb shell pm hide or unhide Adb shell pm create-user or remove-user Snapshot 1. A db shell screencap <filepath > - screen shot 2. Adb shell screenrecord <filepath > - record video ADB

Inject Events Adb shell input tap x, y Adb shell swipe <x1> <y1> <x2> <y2 > Adb shell input keyevent <Key Code> Ex. Backbut-4, Lock-26 A db shell input text www.google.com -> ill update the current foucs edittext Update M ount -> adb shell mount -o remount,rw / system UnMount -> adb shell mount -o remount,ro /system Adb push or pull adb shell getprop  model/version.sdk/manufacturer/hardware/platform/serialno/product.name/brand Window Manager Adb shell wm size WxH – change window size Adb shell wm density ADB

Dumpsys dumpsys SurfaceFlinger – to analyse different layers Find Top Activity dumpsys window windows | findstr mCurrentFocus dumpsys activity activities adb shell "dumpsys activity | grep top-activity" dumpsys activity recents | find "Recent #0" Battery dumpsys batterystats dumpsys batterystats --charged <package-name > Memory dumpsys meminfo <packageName> - Mermory usage  for system memory -> dumpsys meminfo system 2. dumpsys procstats --hours 3 - Memory usage over time ADB

Dumpsys dumpsys cpuinfo - cpu inforamtion dumpsys account – all acounts dumpsys alarm – list of alarams present dumpsys audio - audio information dumpsys dbinfo – data base information dumpsys gfxinfo <packageName> - graphics information Logcat a db logcat a db logcat –c a db logcat -b <buffer> i.e radio,events,main Top –m 5 ADB

adb logcat *:V -> lowest priority, filter to only show Verbose level adb logcat *: D -> filter to only show Debug level adb logcat *:I -> filter to only show Info level adb logcat *:W -> filter to only show Warning level adb logcat *:E -> filter to only show Error level adb logcat *:F -> filter to only show Fatal level adb logcat *:S -> Silent , highest priority, on which nothing is ever printed adb logcat -f -> test.logs Writes log message output to test.logs . adb logcat -g -> Prints the size of the specified log buffer and exits. adb logcat -n < count > -> Sets the maximum number of rotated logs to <count>. ADB Logcat filter