Android抓取当前运行apk包名和类名
16lz
2021-01-25
现象:
需要获取指定apk的包名和活动名;
解决方案:
打开apk,进入你需要抓取的activity,执行:
adb shell dumpsys window | grep mCurrentFocus
返回结果:(例如打开了Google的Chrome)
mCurrentFocus=Window{15145d93 u0 com.android.chrome/com.google.android.apps.chrome.ChromeTabbedActivity}
这里面的com.android.chrome就是需要的包名,com.google.android.apps.chrome.ChromeTabbedActivity就是需要的activity,同时也抓到了其类名;
以上~
更多相关文章
- 高级Redis应用进阶课 一站式Redis解决方案
- Android(安卓)- 安卓报错Error:Could not determine artifacts f
- 【嗨兴科技】Android(安卓)Studio 3 在导入NDK工程的时候报"(inc
- This version of android studio is incompatible with the grad
- Android细节问题总结(二)
- 使用ndk开发android 5.0 平台错误处理(1)
- 使用大量checkbox的时候可能出现的小问题
- android报The content of the adapter has changed but ListView
- android Studio Error: 前言中不允许有内容