现象:

需要获取指定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,同时也抓到了其类名;

以上~

更多相关文章

  1. 高级Redis应用进阶课 一站式Redis解决方案
  2. Android(安卓)- 安卓报错Error:Could not determine artifacts f
  3. 【嗨兴科技】Android(安卓)Studio 3 在导入NDK工程的时候报"(inc
  4. This version of android studio is incompatible with the grad
  5. Android细节问题总结(二)
  6. 使用ndk开发android 5.0 平台错误处理(1)
  7. 使用大量checkbox的时候可能出现的小问题
  8. android报The content of the adapter has changed but ListView
  9. android Studio Error: 前言中不允许有内容

随机推荐

  1. 去掉listview的分割线和分割线的颜色,高度
  2. Android智能指针sp wp详解
  3. Android五大布局特性
  4. Android开发本地及网络Mp3音乐播放器(三)
  5. Android socket网络编程要注意
  6. Android中定时器Timer和TimerTask的启动,
  7. android 签名文件
  8. Android常用控件以及用法
  9. android中的分享功能
  10. 国内中文Android开发者社区和论坛