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>
相关推荐
SH11HF2 天前
小菜狗的云计算之旅,今天学习MySQL数据库基础知识及操作
adb
@Ryan Ding2 天前
MySQL主从复制与读写分离概述
android·mysql·adb
feifeigo1233 天前
升级到MySQL 8.4,MySQL启动报错:io_setup() failed with EAGAIN
数据库·mysql·adb
Edingbrugh.南空3 天前
Flink MySQL CDC 环境配置与验证
mysql·adb·flink
陈卓4103 天前
MySQL-主从复制&分库分表
android·mysql·adb
ladymorgana3 天前
【docker】修改 MySQL 密码后 Navicat 仍能用原密码连接
mysql·adb·docker
好奇的菜鸟5 天前
如何在Ubuntu上检查MySQL是否启动并放开3306端口
mysql·ubuntu·adb
OneT1me5 天前
adb shell中执行system用户权限命令的方法
adb
Polaris_YJH5 天前
360安全卫士占用5037端口(ADB端口)解决方案
adb·端口占用·5037
雨之小15 天前
RK3588调试之旅:adbd服务配置全攻略
adb·rk3588