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>
相关推荐
。puppy15 小时前
MySQL 远程登录实验:通过 IP 地址跨机器连接实战指南
android·adb
q***448116 小时前
mysql配置环境变量——(‘mysql‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件解决办法)
数据库·mysql·adb
q***3751 天前
MySQL输入密码后闪退?
数据库·mysql·adb
杨DaB1 天前
【MySQL】03 数据库的CRUD
数据库·mysql·adb
Lxinccode1 天前
python(62) : 环境变量管理
android·python·adb·环境变量·变量管理
m0_731048201 天前
adb 命令的介绍与使用
adb
q***64971 天前
mysql的主从配置
android·mysql·adb
q***49861 天前
MySQL root用户密码忘记怎么办(Reset root account password)
数据库·mysql·adb
m0_731048201 天前
MuMu模拟器,配置ADB端口
adb
2501_941225682 天前
C++高性能数据库访问与连接池实战分享:大规模数据处理与优化策略经验
adb