OpenHarmony设备截屏的5种方式

本文转载自 OpenHarmony设备截屏的5种方式 **》,作者**westinyang

目录

演示视频:【开鸿教学2.0】OpenHarmony截屏的5种方式_哔哩哔哩_bilibili

方式1:系统控制中心

  • 顶部下滑在控制中心里点击截屏
  • 这种方式最普遍,截图后可到相册查看,不过要注意有些三方移植固件可能不支持这个功能
  • 通过下面这条命令可以拉取设备截图目录到电脑上
复制代码
hdc file recv /storage/media/100/local/files/Pictures/Screenshots`
`

方式2:OHScrcpy投屏工具 推荐

OHScrcpy是我在2023-06-03开发的一款OpenHarmony设备投屏PC的工具,目前最新版为1.0-Beta2,Beta3还在开发中,下面有视频演示、下载地址和相关话题

右键选择截屏或者按F1快捷键,如下图所示

方式3:DevEcoStudio截屏功能

点击下方日志,再点击左下角设备截屏按钮即可

方式4:hdc shell snapshot_display

一般质量jpeg

官方没有文档描述,通过反编译和分析DevEcoStudio部分jar包,看到内部的一些实现

复制代码
hdc` `shell` `"snapshot_display -f /data/0.jpeg"`
`hdc` `file` `recv` `/data/0.jpeg`
`

方式5:hdc shell wukong

高质量png

wukong本来是OpenHarmony提供的一个稳定性测试工具,同时也附带的有截屏功能,官方文档

复制代码
hdc` `shell` `wukong` `special` `-p`
`

执行上面的命令会输出如下内容

复制代码
PS` `C:\Users\westinyang\Desktop> hdc shell wukong special -p`
`Start connect to AAMS`
`Success connect to AAMS`
`INF` `:` `(`  `115) EnvInit :` `"Report currentTestDir: (/data/local/tmp/wukong/report/20230724_072217/)"`
`INF` `:` `(`  `120) EnvInit :` `"Report CSV: (/data/local/tmp/wukong/report/20230724_072217/wukong_report.csv)"`
`INF` `:` `(`  `121) EnvInit :` `"Report JSON: (/data/local/tmp/wukong/report/20230724_072217/data.js)"`
`INF` `:` `(`  `124) EnvInit :` `"Report exception dir: (/data/local/tmp/wukong/report/20230724_072217/exception/)"`
`INF` `:` `(`   `92) StartCrashDirListen : create listener thread`
`INF` `:` `(`   `94) StartCrashDirListen : thread detach`
`INF` `:` `(`   `68) InitCsvFile :` `"CSV: (/data/local/tmp/wukong/wukong_20230724_072217.csv)"`
`INF` `:` `(`   `55) ListenCrashDir : init notify`
`INF` `:` `(`   `60) ListenCrashDir : add_watch`

`

截屏就在这段输出中的 currentTestDir 目录中,使用如下命令拉取到电脑,注意这个路径是随机的

复制代码
hdc file recv /data/local/tmp/wukong/report/20230724_072217/`
`

持续关注

相关推荐
国医中兴3 小时前
Flutter 三方库 dson 的鸿蒙化适配指南 - 极简的序列化魔法、在鸿蒙端实现反射式 JSON 映射实战
flutter·harmonyos·鸿蒙·openharmony
国医中兴5 小时前
Flutter 三方库 cloudflare_r2_uploader 的鸿蒙化适配指南 - 云端存储的疾速通道、在鸿蒙端实现 R2 分段上传实战
flutter·harmonyos·鸿蒙·openharmony·cloudflare_r2_uploader
国医中兴6 小时前
Flutter 三方库 weaver 的鸿蒙化适配指南 - 玩转轻量级服务发现、在鸿蒙端实现模块化治理与解构实战
flutter·harmonyos·鸿蒙·openharmony
国医中兴6 小时前
Flutter 三方库 tapper 的鸿蒙化适配指南 - 单元测试的“闪电侠”、在鸿蒙端实现极简函数式测试实战
flutter·harmonyos·鸿蒙·openharmony
国医中兴1 天前
Flutter 三方库 ngrouter 鸿蒙适配指南 - 实现高性能扁平化路由导航管理实战
flutter·harmonyos·鸿蒙·openharmony
国医中兴1 天前
Flutter 三方库 inject_generator 的鸿蒙化适配指南 - 自动化依赖注入注入生成器、驱动鸿蒙大型工程解耦实战
flutter·harmonyos·鸿蒙·openharmony·inject_generator
国医中兴1 天前
Flutter 三方库 themed_color_palette 的鸿蒙化适配指南 - 定义语义化调色板、在鸿蒙端实现像素级的主题切换实战
flutter·harmonyos·鸿蒙·openharmony·themed_color_palette
国医中兴1 天前
Flutter 三方库 schedules 的鸿蒙化适配指南 - 玩转复杂时间调度算法、构建高效的鸿蒙办公协作系统实战
flutter·harmonyos·鸿蒙·openharmony
亚历克斯神2 天前
Flutter 三方库 fft 的鸿蒙化适配指南 - 实现端侧高性能快速傅里叶变换、支持音频频谱分析与信号处理域的频域特征提取实战
flutter·harmonyos·鸿蒙·openharmony
键盘鼓手苏苏3 天前
Flutter 组件 reaxdb_dart 适配鸿蒙 HarmonyOS 实战:响应式 NoSQL 数据库,构建高性能本地持久化与分布式状态同步架构
flutter·harmonyos·鸿蒙·openharmony·reaxdb_dart