adb多设备多屏幕调试

开发中有一种场景,就是将不同的应用界面投到不同的设备上,那么我们可以用以下方法

adb 多屏幕调试

准备工作
  • 1、获取设备ID,SN码
  • 2、查看目前有几块屏幕,获取display-id

  • 通过以下命令查看device-id(SN)

    adb devices -l

  • 通过以下命令dump SurfaceFlinger查看 display-id

    adb shell dumpsys SurfaceFlinger --display-id

  • 多屏场景,adb开启某个应用到指定屏幕调试,根据屏幕的display-id进行显示

    adb -s device-id shell am start -n com.xxx.demo/com.xxx.demo.MainActivity --display display-id
    //例如到折叠屏外屏
    adb -s device-id shell am start -n com.xxx.demo/com.xxx.demo.MainActivity --display 1

  • 单设备直接

    adb shell am start -n com.xxx.demo/com.xxx.demo.MainActivity


以上方法可以满足python自动化测试的时候连接多个设备,或者手机有多块显示屏的场景(如折叠屏)

相关推荐
Austindatabases13 小时前
OceanBase SeekDB SQL优化案例---MySQL在客户端会没有市场的
数据库·sql·mysql·adb·oceanbase
gjc59213 小时前
MySQL全实例备份脚本 (用于从库部署)
mysql·adb
Just_Paranoid1 天前
【AOSP】Android Dump 信息快速定位方法
android·adb·framework·service·aosp·dumpsys
佳哥的技术分享1 天前
System.setProperty vs adb setprop (Android SystemProperties)
android·adb
Channing Lewis1 天前
mysql.connector.errors.OperationalError: 1040 (08004): Too many connections
数据库·mysql·adb
Railshiqian1 天前
通过adb命令获取某个window或View/子View的绘制内容并输出为png图片的方法
android·adb·dump view
weixin_439706251 天前
Windows MySQL的主从复制配置记录
windows·mysql·adb
Edward.W2 天前
PyQt6 打造苹果风格 ADB 图形化工具:adbUI 深度测评与实战指南
python·adb·pyqt
Edward.W2 天前
Android (ADB)、iOS、OpenHarmony 常用调试命令对照表
android·ios·adb
Railshiqian2 天前
DeepSeek反馈的,如何通过adb获取某个Window或View的绘制内容的方法
android·adb