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>
相关推荐
程序猿老A5 小时前
轻量应用服务器怎么配置mysql
android·mysql·adb
遥不可及zzz16 小时前
Android ADB 实战:使用 adb pull 获取 SDCard 下的文件及日志
adb·mac adb
应用市场1 天前
安卓底层拆解(五)· user 版的 adb 授权与 RSA 密钥
android·adb
普通人61 天前
MySQL 特殊场景启动命令完全指南(8.0 / 5.7 差异全标注)
数据库·mysql·adb
Qlittleboy2 天前
虚拟主机phpmyadmin上传限制50M,用bigdump.php上传
android·adb·php
marszszzl3 天前
ADB 多显示屏截图命令总结
adb·车载系统·截图
行者-全栈开发12 天前
SpringBoot API 网关实战:Spring Cloud Gateway 路由/限流/熔断/鉴权一体化方案
spring boot·后端·adb
MSTcheng.13 天前
【MySQL】MySQL数据库——表的操作
数据库·mysql·adb
小Ti客栈17 天前
MySQL 常用函数速查(完整篇)
数据库·mysql·adb