adb获取包名和界面名

adb获取包名和界面名

  • mac
    • adb shell dumpsys window windows | grep mFocusedApp
  • windows
    • adb shell dumpsys window windows | findstr mFocusedApp

这个是在当前手机打开哪个界面获取的就是哪个界面的包名与界面

注意第一次连接时会有提示,需要连接两次才可以

复制代码
C:\Users\i5ba0>adb shell dumpsys window windows | findstr mFocusedApp
adb server version (31) doesn't match this client (41); killing...
* daemon started successfully
adb.exe: device offline


C:\Users\i5ba0>adb shell dumpsys window windows | findstr mFocusedApp
  mFocusedApp=AppWindowToken{25d14d77 token=Token{27267376 ActivityRecord{1ee68611 u0 com.android.launcher3/.Launcher t1}}}

C:\Users\i5ba0>

当我们打开设置时,包名与界面名变成了com.android.settings/.Settings t2

复制代码
C:\Users\i5ba0>adb shell dumpsys window windows | findstr mFocusedApp
  mFocusedApp=AppWindowToken{3eede788 token=Token{3525d72b ActivityRecord{28fd037a u0 com.android.settings/.Settings t2}}}

C:\Users\i5ba0>
相关推荐
Edingbrugh.南空9 小时前
Flink MySQL CDC 环境配置与验证
mysql·adb·flink
陈卓41012 小时前
MySQL-主从复制&分库分表
android·mysql·adb
ladymorgana14 小时前
【docker】修改 MySQL 密码后 Navicat 仍能用原密码连接
mysql·adb·docker
好奇的菜鸟2 天前
如何在Ubuntu上检查MySQL是否启动并放开3306端口
mysql·ubuntu·adb
OneT1me2 天前
adb shell中执行system用户权限命令的方法
adb
Polaris_YJH2 天前
360安全卫士占用5037端口(ADB端口)解决方案
adb·端口占用·5037
雨之小12 天前
RK3588调试之旅:adbd服务配置全攻略
adb·rk3588
Chrison_mu13 天前
python运行android adb命令获取版本号
android·python·adb
奔跑吧邓邓子14 天前
一文吃透ADB,从入门到精通
adb·从入门到精通
鹏说大数据14 天前
MySQL5.7 慢查询SQL语句集合
android·sql·adb