当前位置: 首页 > news >正文

【Android】【多屏】多屏异显异触调试技巧总结

这里写目录标题

      • 如何获取多屏IDs
      • 获取多屏的size/density
      • 如何启动应用到指定DisplayId
      • 多屏截屏/录屏
        • screencap
        • screenrecord
        • 发送按键到指定DisplayId

如何获取多屏IDs

dumpsys display | grep mDisplayIdtrinket:/ # dumpsys display | grep mDisplayIdmDisplayId=0mDisplayId=2
trinket:/ #

获取多屏的size/density

trinket:/ # wm
Window manager (window) commands:helpPrint this help text.size [reset|WxH|WdpxHdp] [-d DISPLAY_ID]Return or override display size.width and height in pixels unless suffixed with 'dp'.density [reset|DENSITY] [-d DISPLAY_ID]Return or override display density.folded-area [reset|LEFT,TOP,RIGHT,BOTTOM]Return or override folded area.overscan [reset|LEFT,TOP,RIGHT,BOTTOM] [-d DISPLAY ID]Set overscan area for display.scaling [off|auto] [-d DISPLAY_ID]Set display scaling mode.dismiss-keyguardDismiss the keyguard, prompting user for auth if necessary.set-user-rotation [free|lock] [-d DISPLAY_ID] [rotation]Set user rotation mode and user rotation.set-fix-to-user-rotation [-d DISPLAY_ID] [enabled|disabled]Enable or disable rotating display for app requested orientation.tracing (start | stop)Start or stop window tracing.

通过指令 wm size -d xxx; // xxx 代表ID

trinket:/ # wm size -d 0
Physical size: 1080x1920
trinket:/ # wm size -d 2
Physical size: 1280x720
trinket:/ #

通过指令 wm density -d xxx; // xxx 代表ID

trinket:/ # wm density -d 0
Physical density: 320
Override density: 240
trinket:/ # wm density -d 2
Physical density: 213

如何启动应用到指定DisplayId

am start -n com.android.settings/.Settings --display 2

多屏截屏/录屏

screencap
trinket:/ # screencap  -h
usage: screencap [-hp] [-d display-id] [FILENAME]-h: this message-p: save the file as a png.-d: specify the physical display ID to capture (default: 19260879647709569)see "dumpsys SurfaceFlinger --display-id" for valid display IDs.
If FILENAME ends with .png it will be saved as a png.
If FILENAME is not given, the results will be printed to stdout.

指令如下:

//display id 0,界面截屏
screencap -p -d 0 sdcard/0.png
//display id 2,界面截屏
screencap -p -d 2 sdcard/2.png
screenrecord

当前android平台没有指令支持。

发送按键到指定DisplayId
//发送 back 按键到display id 2
input -d 2 keyevent 4//发送屏幕点击事件
input -d 2 tap 200 200 //发送屏幕滑动事件
//swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
input -d 2 siwpe 200 200 200 500 40

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • adb shell ps -T打印出来参数的含义,以及D,T,Z代表的状态含义是什么?
  • 3-2 梯度与反向传播
  • 论文辅导 | 基于多尺度分解的LSTM⁃ARIMA锂电池寿命预测
  • 数字流的秩
  • PHP框架中环境变量的管理和最佳实践
  • 数据可视化之智慧农业的窗口与引擎
  • Centos7删除MariaDB
  • 计算机网络——数据链路层(以太网)
  • Java对象
  • 合并区间(python3)
  • 【已解决】“import ... =“ 只能在 TypeScript 文件中使用
  • 前端八股文 说一下盒模型
  • 昇腾910B部署Qwen2-7B-Instruct进行流式输出【pytorch框架】NPU推理
  • 代码随想录算法训练营第13天|二叉树的递归遍历、二叉树的迭代遍历、二叉树的统一迭代法、102.二叉树的层序遍历
  • K8S 部署 EFK
  • SegmentFault for Android 3.0 发布
  • (ckeditor+ckfinder用法)Jquery,js获取ckeditor值
  • 【MySQL经典案例分析】 Waiting for table metadata lock
  • CSS中外联样式表代表的含义
  • Facebook AccountKit 接入的坑点
  • go append函数以及写入
  • Next.js之基础概念(二)
  • OpenStack安装流程(juno版)- 添加网络服务(neutron)- controller节点
  • 从重复到重用
  • 发布国内首个无服务器容器服务,运维效率从未如此高效
  • 强力优化Rancher k8s中国区的使用体验
  • 推荐一个React的管理后台框架
  • 移动端 h5开发相关内容总结(三)
  • 如何在 Intellij IDEA 更高效地将应用部署到容器服务 Kubernetes ...
  • #APPINVENTOR学习记录
  • (2)从源码角度聊聊Jetpack Navigator的工作流程
  • (3)选择元素——(14)接触DOM元素(Accessing DOM elements)
  • (7)STL算法之交换赋值
  • (C语言)fgets与fputs函数详解
  • (Mac上)使用Python进行matplotlib 画图时,中文显示不出来
  • (ZT)一个美国文科博士的YardLife
  • (附源码)springboot高校宿舍交电费系统 毕业设计031552
  • (免费领源码)python#django#mysql校园校园宿舍管理系统84831-计算机毕业设计项目选题推荐
  • (三)uboot源码分析
  • (十五)、把自己的镜像推送到 DockerHub
  • (一)模式识别——基于SVM的道路分割实验(附资源)
  • (杂交版)植物大战僵尸
  • (转载)hibernate缓存
  • .NET CORE Aws S3 使用
  • .Net Core 中间件验签
  • .NET 的程序集加载上下文
  • .net 受管制代码
  • .NET 项目中发送电子邮件异步处理和错误机制的解决方案
  • .NET_WebForm_layui控件使用及与webform联合使用
  • .NET单元测试使用AutoFixture按需填充的方法总结
  • .NET设计模式(2):单件模式(Singleton Pattern)
  • .NET微信公众号开发-2.0创建自定义菜单
  • :“Failed to access IIS metabase”解决方法
  • [ vulhub漏洞复现篇 ] Celery <4.0 Redis未授权访问+Pickle反序列化利用
  • [2013AAA]On a fractional nonlinear hyperbolic equation arising from relative theory