1 2 OpenHarmony device connector(hdc) ... 3 4---------------------------------global commands:---------------------------------- 5 -h/help [verbose] - Print hdc help, 'verbose' for more other cmds 6 -v/version - Print hdc version 7 -t connectkey - Use device with given connect key 8 9---------------------------------component commands:------------------------------- 10session commands(on server): 11 list targets [-v] - List all devices status, -v for detail 12 start [-r] - Start server. If with '-r', will be restart server 13 kill [-r] - Kill server. If with '-r', will be restart server 14 15service commands(on daemon): 16 target mount - Set /system /vendor partition read-write 17 wait - Wait for the device to become available 18 target boot [-bootloader|-recovery] - Reboot the device or boot into bootloader\recovery. 19 target boot [MODE] - Reboot the into MODE. 20 smode [-r] - Restart daemon with root permissions, '-r' to cancel root 21 permissions 22 tmode usb - Reboot the device, listening on USB 23 tmode port [port] - Reboot the device, listening on TCP port 24 25---------------------------------task commands:------------------------------------- 26file commands: 27 file send [option] local remote - Send file to device 28 file recv [option] remote local - Recv file from device 29 option is -a|-s|-z 30 -a: hold target file timestamp 31 -sync: just update newer file 32 -z: compress transfer, not improve transmission efficiency 33 for compressed files 34 -m: mode sync 35 -b: send/receive file to debug application directory 36 37forward commands: 38 fport localnode remotenode - Forward local traffic to remote device 39 rport remotenode localnode - Reserve remote traffic to local host 40 node config name format 'schema:content' 41 examples are below: 42 tcp:<port> 43 localfilesystem:<unix domain socket name> 44 localreserved:<unix domain socket name> 45 localabstract:<unix domain socket name> 46 dev:<device name> 47 jdwp:<pid> (remote only) 48 ark:pid@tid@Debugger 49 fport ls - Display forward/reverse tasks 50 fport rm taskstr - Remove forward/reverse task by taskstring 51 52app commands: 53 install [-r|-s] src - Send package(s) to device and install them 54 src examples: single or multiple packages and directories 55 (.hap .hsp) 56 -r: replace existing application 57 -s: install shared bundle for multi-apps 58 uninstall [-k] [-s] package - Remove application package from device 59 -k: keep the data and cache directories 60 -s: remove shared bundle 61 62debug commands: 63 hilog [-h] - Show device log, -h for detail 64 shell [-b bundlename] [COMMAND...] - Run shell command (interactive shell if no command given) 65 -b: run command in specified debug application bundle path 66 bundle parameter only support non-interactive shell 67 bugreport [FILE] - Return all information from the device, stored in file if FILE is specified 68 jpid - List PIDs of processes hosting a JDWP transport 69 track-jpid [-a|-p] - Track PIDs of debug processes hosting a JDWP transport 70 -a: include debug and release processes 71 -p: don't display debug and release tags 72 73security commands: 74 keygen FILE - Generate public/private key; key stored in FILE and FILE.pub 75 76