鸿蒙hdc命令【杭州多测师】

1、查看版本

hdc -v

2、查看连接设备

hdc list targets

3、安装应用

hdc app install .\phone-launcher-default-signed.hap

// 覆盖安装

hdc app install -r .\phone-launcher-default-signed.hap

// 安装、更新,多HAP可以指定多个文件路径

hdc install C:\entry.hap C:\feature.hap

// 执行结果

install bundle successfully.

// 先执行hdc shell才能使用bm工具

hdc shell

// 安装、更新,多HAP可以指定多个文件路径

bm install -p /data/app/entry.hap /data/app/feature.hap

// 执行结果

install bundle successfully.

4、卸载应用

hdc app uninstall com.ohos.myapplication

// 卸载

bm uninstall -n com.example.myapplication

// 执行结果

uninstall bundle successfully.

// 卸载

hdc uninstall com.example.myapplication

// 执行结果

uninstall bundle successfully.

5、发送文件

hdc file send .\Laucher.hap system/app/com.ohos.launcher/Launcher.hap

6、接收文件

hdc file recv system/app/com.ohos.launcher/Launcher.hap D:\OpenHarmony\

7、查看日志

hdc hilog

8、获取UUID

hdc shell bm get --udid

9、杀掉hdc进程,类似adb kill-server

hdc kill

10、重启hdc

hdc start -r

11、重启设备

hdc shell reboot

12、启动Ability

hdc shell aa start -b 包名 -a Ability名称

hdc shell aa start -b ohos.samples.FormApplication -a ohos.samples.FormApplication.MainAbility

13、多设备操作

hdc list targets 查看设备后

hdc -t 设备 shell

hdc -t 7001005458323933328a250f004e3900 shell

14、清除应用缓存

hdc shell bm clean -n ohos.samples.FormApplication -c

15、清除应用数据

hdc shell bm clean -n ohos.samples.FormApplication -d

16、hdc shell bm 其他操作

禁止应用,应用在桌面消失

hdc shell bm disable -n ohos.samples.FormApplication

允许应用,应用在桌面显示

hdc shell bm enable -n ohos.samples.FormApplication

查看应用配置信息

hdc shell bm dump -n ohos.samples.FormApplication

help list available commands

install install a bundle with options

uninstall uninstall a bundle with options

dump dump the bundle info

clean clean the bundle data

enable enable the bundle

disable disable the bundle

get obtain device udid

getrm obtain the value of isRemovable by given bundle name and module name

setrm set module isRemovable by given bundle name and module name

17、hdc shell aa 其他操作

强制退出应用

hdc shell aa force-stop ohos.samples.FormApplication

查看当前任务栈的ability 信息

hdc shell aa dump -l

hdc shell aa 其他操作

help list available commands

start start ability with options

stop-service stop service with options

dump dump the ability info

force-stop <bundle-name> force stop the process with bundle name

test start the test framework with options

ApplicationNotRespondin Pass in pid with options

block-ability <ability-record-id> block ability with ability record id

block-ams-service block ams service

block-app-service block app service

18、hdc 其他操作

hdc discover

hdc tconn

hdc bugreport

hdc jpid

hdc keygen FILE

相关推荐
2501_9445210017 分钟前
rn_for_openharmony商城项目app实战-语言设置实现
javascript·数据库·react native·react.js·harmonyos
程序猿追1 小时前
【鸿蒙PC桌面端开发】使用ArkTS做出RGB 色环选择器
华为·harmonyos
C雨后彩虹2 小时前
书籍叠放问题
java·数据结构·算法·华为·面试
zhujian826372 小时前
二十五、【鸿蒙 NEXT】@ObservedV2/@Trace实现组件动态刷新
华为·harmonyos·trace·lazyforeach·observedv2
wszy18092 小时前
rn_for_openharmony_空状态与加载状态:别让用户对着白屏发呆
android·javascript·react native·react.js·harmonyos
SameX2 小时前
鸿蒙应用的“任意门”:Deep Linking 与 App Linking 的相爱相杀
harmonyos
AlbertZein2 小时前
HarmonyOS一杯冰美式的时间 -- @Watch 到 @Monitor
harmonyos
奋斗的小青年!!3 小时前
Flutter跨平台开发适配OpenHarmony:下拉刷新组件的实战优化与深度解析
flutter·harmonyos·鸿蒙
lili-felicity4 小时前
React Native for Harmony:订单列表页面状态筛选完整实现
react native·react.js·harmonyos
lili-felicity4 小时前
React Native 鸿蒙跨平台开发:纯原生IndexBar索引栏 零依赖 快速定位列表
react native·react.js·harmonyos