欢迎大家关注,持续更新~ {droyon}
1、快速查看SettingsProvider数据库表信息:
adb shell settings list [system][secure][global]
2、依据Name查看SettingsProvider数据库表格
adb shell settings get [system][secure][global] [Name]
3、依据Name向对应的数据库中插入value
adb shell settings put [system][secure][global] [Name] [Value]
4、查看启动页面intent部分详情以及确认请求部分详情
adb logcat -v time -s "ActivityManager"
5、获取包名对应的PMS信息
adb shell dumpsys package {包名}
6、显示当前展示页面的信息,可以用于确认启动activity的包名等信息
adb shell dumpsys window visible
7、显示activity详情
adb shell dumpsys activity com.android.settings/com.android.settings.Settings
8、显示系统组件详情
- 8.1、显示服务详情
adb shell dumpsys activity service com.android.settings/.SettingsDumpService
- 8.2、显示系统服务详情
adb shell dumpsys notification
- 8.3、显示Provider服务详情:
adb shell dumpsys activity provider
com.android.providers.settings/com.android.providers.settings.SettingsProvider
9、抓取手指点击事件时间
adb logcat -v time -s InputDispatcher
输出案例:
07-29 11:04:56.258 I/ViewRootImpl( 8295): finishMotionEvent: handled = true stage=10:
View Post IME stage,inputElapseTime=2 eventTime = 68608867
downTime = 68608867 title= com.android.launcher3/com.android.launcher3.Launcher
10、输出AMS intent请求信息:
adb logcat -v time -s "ActivityManager"
输出案例:
07-29 11:29:48.520 I/ActivityManager( 6692): START u0 {act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10200000
mCallingUid=10012 cmp=com.android.settings/.Settings bnds=[1056,1804][1392,2222] (has extras)}
from uid 10012 on display 0
11、输出页面启动时间
adb logcat -v time -s "ActivityManager" |grep Display
输出案例:
07-29 11:18:16.557 I/ActivityManager( 1579): Displayed com.android.settings/.SubSettings: +299ms
12、开机向导不正常导致HOME键和返回键不可用修正方案:
adb shell settings put global device_provisioned 1
adb shell settings put secure user_setup_complete 1
13、获得Intent请求来源以及activityResult目标详细log信息
[adb shell dumpsys activity a] [adb shell dumpsys activity]
adb shell dumpsys activity -d list:
输出案例:
ENABLE_THERMAL = true
0 . DEBUG_ALL = false
1 . DEBUG_BACKUP = false
2 . DEBUG_BROADCAST = false
3 . DEBUG_BROADCAST_LIGHT = false
4 . DEBUG_BROADCAST_BACKGROUND = false
5 . DEBUG_CLEANUP = false
6 . DEBUG_CONFIGURATION = false
7 . DEBUG_FOCUS = false
8 . DEBUG_IMMERSIVE = false
9 . DEBUG_LOCKSCREEN = false
10. DEBUG_LRU = false
11. DEBUG_MU = false
13. DEBUG_OOM_ADJ = false
14. DEBUG_PAUSE = false
15. DEBUG_POWER = false
16. DEBUG_POWER_QUICK = false
17. DEBUG_PROCESSES = false
18. DEBUG_PROCESS_OBSERVERS = false
19. DEBUG_PROVIDER = false
20. DEBUG_RESULTS = false
21. DEBUG_SERVICE = false
22. DEBUG_SERVICE_EXECUTING = false
23. DEBUG_STACK = true
24. DEBUG_SWITCH = true
25. DEBUG_TASKS = true
26. DEBUG_THUMBNAILS = false
27. DEBUG_TRANSITION = false
28. DEBUG_URI_PERMISSION = false
29. DEBUG_USER_LEAVING = false
30. DEBUG_VISIBILITY = false
31. DEBUG_PSS = false
32. DEBUG_RECENTS = false
33. DEBUG_THERMAL = false
34. DEBUG_ADD_REMOVE = false
35. DEBUG_APP = false
36. DEBUG_CONTAINERS = false
37. DEBUG_IDLE = false
38. DEBUG_RELEASE = false
39. DEBUG_SAVED_STATE = false
40. DEBUG_SCREENSHOTS = false
41. DEBUG_STATES = false
42. DEBUG_VISIBLE_BEHIND = false
可以选择将如下三项打开:
23. DEBUG_STACK = true
24. DEBUG_SWITCH = true
25. DEBUG_TASKS = true
那么,使用如下命令抓取log信息:
adb logcat -v time -s "ActivityManager"
log备注:
01-02 05:47:11.624 12182 13492 I ActivityManager: START u0 {mCallingUid=1000 cmp=com.android.settings/.ChooseLockPattern (has extras)} from uid 1000 on display 0
01-02 05:47:11.624 12182 13492 I ActivityManager: sourceRecord = ActivityRecord{82c19d8 u0 com.android.settings/.ChooseLockGeneric$InternalActivity, isShadow:false t3}
01-02 05:47:11.624 12182 13492 D ActivityManager: startActivityLocked skipCheckAccessControl = true
01-02 05:47:11.634 12182 13492 I ActivityManager: startActivityUnchecked mReusedActivity=null r=ActivityRecord{a5b9d3b u0 com.android.settings/.ChooseLockPattern, isShadow:false t-1}
01-02 05:47:11.636 12182 13492 V ActivityManager: Starting new activity ActivityRecord{a5b9d3b u0 com.android.settings/.ChooseLockPattern, isShadow:false t3} in existing task TaskRecord{9629e54 #3 A=com.android.settings, isShadow:false U=0 StackId=1 sz=4} from source ActivityRecord{82c19d8 u0 com.android.settings/.ChooseLockGeneric$InternalActivity, isShadow:false t3}
注意:SourceRecord = 开头的字串
14、事件被消费:
adb logcat -v threadtime -s ViewRootImpl
可以看到如下log:
04-25 01:57:21.441 11173 11173 I ViewRootImpl: finishKeyEvent: handled = true keycode = 4 name=KEYCODE_BACK stage=10: View Post IME stage,inputElapseTime=4 eventTime = 4616876 downTime = 4616876 title= com.android.settings/com.android.settings.Settings
04-25 01:57:21.840 2920 2920 I ViewRootImpl: updateImmersive mode: gain focus