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>
相关推荐
爱技术的小伙子2 小时前
【 Docker 快速部署 MySQL 8.0(2026最新实践)—— 一键启动 + 数据持久化 + 常见优化】
mysql·adb·docker
橘子133 小时前
MySQL表的内外连接(九)
数据库·mysql·adb
betazhou1 天前
mysql备份脚本
android·mysql·adb·数据库备份
卿着飞翔1 天前
ubuntu上的mysql远程连不上root
mysql·ubuntu·adb
小句1 天前
MySQL慢查询日志详细使用指南
数据库·mysql·adb
L1624762 天前
KeepAlived 搭建 MySQL 双主模式高可用集群(详细安装配置教程)
数据库·mysql·adb
L1624762 天前
基于 Xenon 实现 MySQL 高可用集群(完整配置教程,含监控告警 + 定时备份)
android·mysql·adb
angushine2 天前
鲲鹏ARM服务MySQL镜像方式部署主从集群
android·mysql·adb
晓风残月淡3 天前
mysql数据库完整备份恢复方案(二)
数据库·mysql·adb
代码的奴隶(艾伦·耶格尔)4 天前
cdc实时监听数据库
adb