鴻蒙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

浙公網安備 33010602011771號