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>
相关推荐
loosed19 小时前
Ubuntu mysql8 tar.xz 安装
linux·ubuntu·adb
坐吃山猪1 天前
AutoGLMPhone05-源码-ADB模块
adb
菜择贰1 天前
ubantu下载mysql
数据库·mysql·adb
坐吃山猪1 天前
AutoGLMPhone03-adb模块
adb·llm·glm
今晚务必早点睡1 天前
MySQL 新手避坑指南:安装、区分、检查一步到位
数据库·mysql·adb
我的offer在哪里2 天前
mysql修改密码
adb
编程小Y2 天前
MySQL 与 MCP 集成全解析(核心原理 + 实战步骤 + 应用场景)
数据库·mysql·adb
嘻哈baby2 天前
MySQL主从复制与读写分离实战指南
数据库·mysql·adb
Neolnfra2 天前
系统敏感安全文件路径
linux·windows·安全·web安全·网络安全·adb·系统安全
何妨呀~3 天前
mysql 8服务器实验
android·mysql·adb