1# hdc\_std Usage Guidelines<a name="EN-US_TOPIC_0000001080478129"></a> 2 3- [Preparations](#section05992022154916) 4- [Important Notes](#section19543134915210) 5- [Option-related Commands](#section618522925119) 6 - [-h/help -v/version](#section51533527212) 7 - [-t key](#section1180555115159) 8 9- [Querying the Device List](#section174891132104218) 10 - [list targets\[-v\]](#section12911142313168) 11 12- [Service Process Commands](#section680531510497) 13 - [target mount](#section396717571168) 14 - [smode \[off\]](#section179951621713) 15 - [kill \[-r\]](#section419144621712) 16 - [start \[-r\]](#section184811812183) 17 18- [Network Commands](#section71176123212) 19 - [tconn host\[:port\]\[-remove\]](#section191911334206) 20 - [tmode usb](#section17840182562015) 21 - [tmode port port-number](#section101113462113) 22 23- [File Commands](#section173133523013) 24 - [file send local remote](#section126223231307) 25 - [file recv \[-a\] remote local](#section26966541304) 26 27- [App Commands](#section2072647133819) 28 - [install \[-r/-d/-g\] package](#section49615195111) 29 - [uninstall \[-k\] package](#section167618461814) 30 31- [Debugging Commands](#section112861250195015) 32 - [hilog](#section32171612221) 33 - [shell \[command\]](#section524235625) 34 35- [Troubleshooting](#section592920255582) 36 - [hdc\_std Fails to Connect to a Device](#section74019384588) 37 38- [hdc\_std Fails to Run](#section6825095917) 39 40hdc\_std \(OpenHarmony Device Connector\) is a command line tool provided by OpenHarmony for debugging. With this tool, you can interact with real devices or simulators from a Windows or Linux OS. 41 42This section describes how to set up the hdc\_std environment and use its common commands. 43 44## Preparations<a name="section05992022154916"></a> 45 46**Obtaining hdc\_std:** 47 48Obtain hdc\_std from the **developtools\_hdc\_standard** repository in the **prebuilt** directory. 49 50**Example:** 51 52To obtain hdc\_std on Windows, obtain the executable file **hdc\_std.exe** from **prebuilt/windows** and place it in a directory on the disk. 53 54## Important Notes<a name="section19543134915210"></a> 55 56- If an exception occurs when you are using hdc\_std, run the **hdc\_std kill** command to kill the hdc\_std service or run the **hdc\_std start -r** command to restart the service process. 57- If no device information is obtained after **hdc\_std list targets** is executed, use the task manager to check whether the **hdc.exe** process exists. If it exists, kill the process. 58 59## Option-related Commands<a name="section618522925119"></a> 60 61The following commands are available: 62 63### -h/help -v/version<a name="section51533527212"></a> 64 65Obtains hdc help and version information. 66 67**Table 1** Command description 68 69<a name="table2560141891610"></a> 70<table><tbody><tr id="row11561818151618"><td class="cellrowborder" valign="top" width="50%"><p id="p1656118183162"><a name="p1656118183162"></a><a name="p1656118183162"></a><strong id="b1041812818435"><a name="b1041812818435"></a><a name="b1041812818435"></a>Return Value</strong></p> 71</td> 72<td class="cellrowborder" valign="top" width="50%"><p id="p55613181166"><a name="p55613181166"></a><a name="p55613181166"></a><strong id="b14295163017435"><a name="b14295163017435"></a><a name="b14295163017435"></a>Description</strong></p> 73</td> 74</tr> 75<tr id="row19561618141617"><td class="cellrowborder" valign="top" width="50%"><p id="p15615185161"><a name="p15615185161"></a><a name="p15615185161"></a>Required information</p> 76</td> 77<td class="cellrowborder" valign="top" width="50%"><p id="p135611718111618"><a name="p135611718111618"></a><a name="p135611718111618"></a>hdc help or version information</p> 78</td> 79</tr> 80</tbody> 81</table> 82 83Examples: 84 85hdc\_std -h / hdc\_std help 86 87hdc\_std -v / hdc\_std version 88 89### -t key<a name="section1180555115159"></a> 90 91Connects to a device with a specified key. 92 93**Table 2** Command description 94 95<a name="table16605101217544"></a> 96<table><tbody><tr id="row14605141255412"><td class="cellrowborder" valign="top" width="50%"><p id="p14605121212541"><a name="p14605121212541"></a><a name="p14605121212541"></a><strong id="b1693351765919"><a name="b1693351765919"></a><a name="b1693351765919"></a>Parameter</strong></p> 97</td> 98<td class="cellrowborder" valign="top" width="50%"><p id="p18605111285411"><a name="p18605111285411"></a><a name="p18605111285411"></a><strong id="b3538122335916"><a name="b3538122335916"></a><a name="b3538122335916"></a>Description</strong></p> 99</td> 100</tr> 101<tr id="row260514129547"><td class="cellrowborder" valign="top" width="50%"><p id="p1060512126548"><a name="p1060512126548"></a><a name="p1060512126548"></a><span>key</span></p> 102</td> 103<td class="cellrowborder" valign="top" width="50%"><p id="p26051123547"><a name="p26051123547"></a><a name="p26051123547"></a>Key that identifies the device. The value is in the <em id="i15978153415214"><a name="i15978153415214"></a><a name="i15978153415214"></a>IP address:Port number</em> format or is a USB serial number.</p> 104</td> 105</tr> 106<tr id="row46051121548"><td class="cellrowborder" valign="top" width="50%"><p id="p11605111285411"><a name="p11605111285411"></a><a name="p11605111285411"></a><strong id="b4943122111415"><a name="b4943122111415"></a><a name="b4943122111415"></a>Return Value</strong></p> 107</td> 108<td class="cellrowborder" valign="top" width="50%"><p id="p18605101265413"><a name="p18605101265413"></a><a name="p18605101265413"></a><strong id="b828172265915"><a name="b828172265915"></a><a name="b828172265915"></a>Description</strong></p> 109</td> 110</tr> 111<tr id="row1760531211546"><td class="cellrowborder" valign="top" width="50%"><p id="p232481834"><a name="p232481834"></a><a name="p232481834"></a>1. error: device '***' not found</p> 112<p id="p12191171320"><a name="p12191171320"></a><a name="p12191171320"></a>②Nothing to do...</p> 113</td> 114<td class="cellrowborder" valign="top" width="50%"><p id="p85527328314"><a name="p85527328314"></a><a name="p85527328314"></a>1. The device does not exist.</p> 115<p id="p10343124416277"><a name="p10343124416277"></a><a name="p10343124416277"></a>2. The command appended to <strong id="b18734194624117"><a name="b18734194624117"></a><a name="b18734194624117"></a>-t key</strong> does not exist.</p> 116</td> 117</tr> 118</tbody> 119</table> 120 121Examples: 122 123This option must be used together with a specific operation command. The following uses the shell command as an example: 124 125**hdc\_std list targets** \(obtain device information\) 126 127**hdc\_std -t _key_ shell** \(replace _key_ with the device information obtained\) 128 129> **NOTE:** 130>You can connect to multiple devices from the device you use for development. Each device has a unique key. The key can be _IP address:Port number_ for a device connected through a network or the serial number for a device connected through USB. 131 132## Querying the Device List<a name="section174891132104218"></a> 133 134The following command is used to query the device list: 135 136### list targets\[-v\]<a name="section12911142313168"></a> 137 138Displays all the connected devices. 139 140**Table 3** Command description 141 142<a name="table1233315596432"></a> 143<table><tbody><tr id="row1033313596434"><td class="cellrowborder" valign="top" width="50%"><p id="p13333115919432"><a name="p13333115919432"></a><a name="p13333115919432"></a><strong id="b629174175516"><a name="b629174175516"></a><a name="b629174175516"></a>Parameter</strong></p> 144</td> 145<td class="cellrowborder" valign="top" width="50%"><p id="p033320595430"><a name="p033320595430"></a><a name="p033320595430"></a><strong id="b1654018421552"><a name="b1654018421552"></a><a name="b1654018421552"></a>Description</strong></p> 146</td> 147</tr> 148<tr id="row733310596437"><td class="cellrowborder" valign="top" width="50%"><p id="p13333115911433"><a name="p13333115911433"></a><a name="p13333115911433"></a>-v</p> 149</td> 150<td class="cellrowborder" valign="top" width="50%"><p id="p123331159134314"><a name="p123331159134314"></a><a name="p123331159134314"></a>Prints detailed device information.</p> 151</td> 152</tr> 153<tr id="row1833305944314"><td class="cellrowborder" valign="top" width="50%"><p id="p833445916438"><a name="p833445916438"></a><a name="p833445916438"></a><strong id="b143101411185710"><a name="b143101411185710"></a><a name="b143101411185710"></a>Return Value</strong></p> 154</td> 155<td class="cellrowborder" valign="top" width="50%"><p id="p23341159134320"><a name="p23341159134320"></a><a name="p23341159134320"></a><strong id="b102594345918"><a name="b102594345918"></a><a name="b102594345918"></a>Description</strong></p> 156</td> 157</tr> 158<tr id="row03341859154311"><td class="cellrowborder" valign="top" width="50%"><p id="p13334659154310"><a name="p13334659154310"></a><a name="p13334659154310"></a>1. Device information</p> 159<p id="p19553114217533"><a name="p19553114217533"></a><a name="p19553114217533"></a>②[Empty]</p> 160</td> 161<td class="cellrowborder" valign="top" width="50%"><p id="p6334859174310"><a name="p6334859174310"></a><a name="p6334859174310"></a>1. A list of connected devices</p> 162<p id="p57581926125318"><a name="p57581926125318"></a><a name="p57581926125318"></a>2. No device information is found.</p> 163</td> 164</tr> 165</tbody> 166</table> 167 168Examples: 169 170hdc\_std list targets 171 172hdc\_std list targets -v 173 174## Service Process Commands<a name="section680531510497"></a> 175 176The following commands are available: 177 178### target mount<a name="section396717571168"></a> 179 180Mounts a partition, such as **/system**, with the read and write permissions. 181 182**Table 4** Command description 183 184<a name="table5346719144119"></a> 185<table><tbody><tr id="row9346419124120"><td class="cellrowborder" valign="top" width="50%"><p id="p134612191413"><a name="p134612191413"></a><a name="p134612191413"></a><strong id="b1610754091316"><a name="b1610754091316"></a><a name="b1610754091316"></a>Parameter</strong></p> 186</td> 187<td class="cellrowborder" valign="top" width="50%"><p id="p12346141944113"><a name="p12346141944113"></a><a name="p12346141944113"></a><strong id="b1176325714137"><a name="b1176325714137"></a><a name="b1176325714137"></a>Description</strong></p> 188</td> 189</tr> 190<tr id="row1534681974114"><td class="cellrowborder" valign="top" width="50%"><p id="p16346131914118"><a name="p16346131914118"></a><a name="p16346131914118"></a>None</p> 191</td> 192<td class="cellrowborder" valign="top" width="50%"><p id="p18346191954119"><a name="p18346191954119"></a><a name="p18346191954119"></a>None</p> 193</td> 194</tr> 195<tr id="row18346131964114"><td class="cellrowborder" valign="top" width="50%"><p id="p1934671934110"><a name="p1934671934110"></a><a name="p1934671934110"></a><strong id="b84275081410"><a name="b84275081410"></a><a name="b84275081410"></a>Return Value</strong></p> 196</td> 197<td class="cellrowborder" valign="top" width="50%"><p id="p18346101911411"><a name="p18346101911411"></a><a name="p18346101911411"></a><strong id="b199052032147"><a name="b199052032147"></a><a name="b199052032147"></a>Description</strong></p> 198</td> 199</tr> 200<tr id="row19346919164116"><td class="cellrowborder" valign="top" width="50%"><p id="p44221428143012"><a name="p44221428143012"></a><a name="p44221428143012"></a>①Mount finish</p> 201<p id="p43471519204114"><a name="p43471519204114"></a><a name="p43471519204114"></a>2. Returned information</p> 202</td> 203<td class="cellrowborder" valign="top" width="50%"><p id="p1551336123011"><a name="p1551336123011"></a><a name="p1551336123011"></a>1. Information returned when the operation is successful.</p> 204<p id="p2034731984115"><a name="p2034731984115"></a><a name="p2034731984115"></a>2. Information returned when the operation fails.</p> 205</td> 206</tr> 207</tbody> 208</table> 209 210Example: 211 212hdc\_std target mount 213 214### smode \[off\]<a name="section179951621713"></a> 215 216Grants the root permission to a background service process. The **off** option is used to revoke the granted permission. 217 218Examples: 219 220hdc\_std smode 221 222hdc\_std smode off 223 224### kill \[-r\]<a name="section419144621712"></a> 225 226Stops a service process. 227 228**Table 5** Command description 229 230<a name="table540423782919"></a> 231<table><tbody><tr id="row8404937152910"><td class="cellrowborder" valign="top" width="50%"><p id="p7404113711295"><a name="p7404113711295"></a><a name="p7404113711295"></a><strong id="b2110200670"><a name="b2110200670"></a><a name="b2110200670"></a>Parameter</strong></p> 232</td> 233<td class="cellrowborder" valign="top" width="50%"><p id="p4405193792919"><a name="p4405193792919"></a><a name="p4405193792919"></a><strong id="b14394223434"><a name="b14394223434"></a><a name="b14394223434"></a>Description</strong></p> 234</td> 235</tr> 236<tr id="row174051037112912"><td class="cellrowborder" valign="top" width="50%"><p id="p134056375291"><a name="p134056375291"></a><a name="p134056375291"></a>-r</p> 237</td> 238<td class="cellrowborder" valign="top" width="50%"><p id="p18405337142911"><a name="p18405337142911"></a><a name="p18405337142911"></a>Triggers the service restart.</p> 239</td> 240</tr> 241<tr id="row164052037162913"><td class="cellrowborder" valign="top" width="50%"><p id="p124051837182918"><a name="p124051837182918"></a><a name="p124051837182918"></a><strong id="b486075369"><a name="b486075369"></a><a name="b486075369"></a>Return Value</strong></p> 242</td> 243<td class="cellrowborder" valign="top" width="50%"><p id="p8405113782918"><a name="p8405113782918"></a><a name="p8405113782918"></a><strong id="b1831332274"><a name="b1831332274"></a><a name="b1831332274"></a>Description</strong></p> 244</td> 245</tr> 246<tr id="row15405163702915"><td class="cellrowborder" valign="top" width="50%"><p id="p0976152811311"><a name="p0976152811311"></a><a name="p0976152811311"></a>①Kill server finish</p> 247<p id="p2405163713299"><a name="p2405163713299"></a><a name="p2405163713299"></a>2. Error information</p> 248</td> 249<td class="cellrowborder" valign="top" width="50%"><p id="p10405123732915"><a name="p10405123732915"></a><a name="p10405123732915"></a>1. Information returned when the operation is successful.</p> 250<p id="p19405337152916"><a name="p19405337152916"></a><a name="p19405337152916"></a>2. The operation fails.</p> 251</td> 252</tr> 253</tbody> 254</table> 255 256Example: 257 258hdc\_std kill 259 260### start \[-r\]<a name="section184811812183"></a> 261 262Starts a service process. 263 264**Table 6** Command description 265 266<a name="table11605125417348"></a> 267<table><tbody><tr id="row176051354123419"><td class="cellrowborder" valign="top" width="50%"><p id="p16605185413418"><a name="p16605185413418"></a><a name="p16605185413418"></a><strong id="b210257599"><a name="b210257599"></a><a name="b210257599"></a>Parameter</strong></p> 268</td> 269<td class="cellrowborder" valign="top" width="50%"><p id="p3605125413346"><a name="p3605125413346"></a><a name="p3605125413346"></a><strong id="b415620225414"><a name="b415620225414"></a><a name="b415620225414"></a>Description</strong></p> 270</td> 271</tr> 272<tr id="row1560575443411"><td class="cellrowborder" valign="top" width="50%"><p id="p17605135411347"><a name="p17605135411347"></a><a name="p17605135411347"></a>-r</p> 273</td> 274<td class="cellrowborder" valign="top" width="50%"><p id="p1860525413414"><a name="p1860525413414"></a><a name="p1860525413414"></a>Restarts the service process if it has started.</p> 275</td> 276</tr> 277<tr id="row14606154183415"><td class="cellrowborder" valign="top" width="50%"><p id="p160695453412"><a name="p160695453412"></a><a name="p160695453412"></a><strong id="b1555473538"><a name="b1555473538"></a><a name="b1555473538"></a>Return Value</strong></p> 278</td> 279<td class="cellrowborder" valign="top" width="50%"><p id="p1606154163419"><a name="p1606154163419"></a><a name="p1606154163419"></a><strong id="b773206990"><a name="b773206990"></a><a name="b773206990"></a>Description</strong></p> 280</td> 281</tr> 282<tr id="row7606135433416"><td class="cellrowborder" valign="top" width="50%"><p id="p716462216389"><a name="p716462216389"></a><a name="p716462216389"></a>None</p> 283</td> 284<td class="cellrowborder" valign="top" width="50%"><p id="p360645453415"><a name="p360645453415"></a><a name="p360645453415"></a>None</p> 285</td> 286</tr> 287</tbody> 288</table> 289 290Examples: 291 292hdc\_std start 293 294## Network Commands<a name="section71176123212"></a> 295 296The following commands are available: 297 298### tconn _host_\[:_port_\]\[-remove\]<a name="section191911334206"></a> 299 300Connects to a device with a specified IP address and port number. 301 302**Table 7** Command description 303 304<a name="table71285383412"></a> 305<table><tbody><tr id="row6128123818419"><td class="cellrowborder" valign="top" width="50%"><p id="p812814386413"><a name="p812814386413"></a><a name="p812814386413"></a><strong id="b1030315493346"><a name="b1030315493346"></a><a name="b1030315493346"></a>Parameter</strong></p> 306</td> 307<td class="cellrowborder" valign="top" width="50%"><p id="p131291038641"><a name="p131291038641"></a><a name="p131291038641"></a><strong id="b3236125017346"><a name="b3236125017346"></a><a name="b3236125017346"></a>Description</strong></p> 308</td> 309</tr> 310<tr id="row101292381149"><td class="cellrowborder" valign="top" width="50%"><p id="p712914385410"><a name="p712914385410"></a><a name="p712914385410"></a>host[:port]</p> 311</td> 312<td class="cellrowborder" valign="top" width="50%"><p id="p14129038443"><a name="p14129038443"></a><a name="p14129038443"></a>IP address and port number of the device to be connected</p> 313</td> 314</tr> 315<tr id="row18468719662"><td class="cellrowborder" valign="top" width="50%"><p id="p8469141919614"><a name="p8469141919614"></a><a name="p8469141919614"></a>-remove</p> 316</td> 317<td class="cellrowborder" valign="top" width="50%"><p id="p24693194612"><a name="p24693194612"></a><a name="p24693194612"></a>Disconnects from the specified device.</p> 318</td> 319</tr> 320<tr id="row12129133811418"><td class="cellrowborder" valign="top" width="50%"><p id="p121301738546"><a name="p121301738546"></a><a name="p121301738546"></a><strong id="b196328104518"><a name="b196328104518"></a><a name="b196328104518"></a>Return Value</strong></p> 321</td> 322<td class="cellrowborder" valign="top" width="50%"><p id="p413019381140"><a name="p413019381140"></a><a name="p413019381140"></a><strong id="b945423234519"><a name="b945423234519"></a><a name="b945423234519"></a>Description</strong></p> 323</td> 324</tr> 325<tr id="row1813093818415"><td class="cellrowborder" valign="top" width="50%"><p id="p453212235494"><a name="p453212235494"></a><a name="p453212235494"></a>1. Error information</p> 326<p id="p753222334914"><a name="p753222334914"></a><a name="p753222334914"></a>2. None</p> 327</td> 328<td class="cellrowborder" valign="top" width="50%"><p id="p1353282314492"><a name="p1353282314492"></a><a name="p1353282314492"></a>1. The operation fails.</p> 329<p id="p053312316491"><a name="p053312316491"></a><a name="p053312316491"></a>2. The operation is successful.</p> 330</td> 331</tr> 332</tbody> 333</table> 334 335Example: 336 337hdc\_std tconn 192.168.0.100:8710 338 339### tmode usb<a name="section17840182562015"></a> 340 341Restarts the daemon process and connects to the device using USB. 342 343**Table 8** Command description 344 345<a name="table94491851798"></a> 346<table><tbody><tr id="row3450451595"><td class="cellrowborder" valign="top" width="50%"><p id="p1450551394"><a name="p1450551394"></a><a name="p1450551394"></a><strong id="b846114213215"><a name="b846114213215"></a><a name="b846114213215"></a>Parameter</strong></p> 347</td> 348<td class="cellrowborder" valign="top" width="50%"><p id="p1645016511493"><a name="p1645016511493"></a><a name="p1645016511493"></a><strong id="b1460217222219"><a name="b1460217222219"></a><a name="b1460217222219"></a>Description</strong></p> 349</td> 350</tr> 351<tr id="row245010513917"><td class="cellrowborder" valign="top" width="50%"><p id="p64509517910"><a name="p64509517910"></a><a name="p64509517910"></a>None</p> 352</td> 353<td class="cellrowborder" valign="top" width="50%"><p id="p134501517910"><a name="p134501517910"></a><a name="p134501517910"></a>None</p> 354</td> 355</tr> 356<tr id="row184501851891"><td class="cellrowborder" valign="top" width="50%"><p id="p18450205118919"><a name="p18450205118919"></a><a name="p18450205118919"></a><strong id="b5890324142117"><a name="b5890324142117"></a><a name="b5890324142117"></a>Return Value</strong></p> 357</td> 358<td class="cellrowborder" valign="top" width="50%"><p id="p44504518913"><a name="p44504518913"></a><a name="p44504518913"></a><strong id="b477462615214"><a name="b477462615214"></a><a name="b477462615214"></a>Description</strong></p> 359</td> 360</tr> 361<tr id="row3450551196"><td class="cellrowborder" valign="top" width="50%"><p id="p819142715546"><a name="p819142715546"></a><a name="p819142715546"></a>1. Error information</p> 362<p id="p11911427195411"><a name="p11911427195411"></a><a name="p11911427195411"></a>2. None</p> 363</td> 364<td class="cellrowborder" valign="top" width="50%"><p id="p81911527145413"><a name="p81911527145413"></a><a name="p81911527145413"></a>1. The operation fails.</p> 365<p id="p4191192720546"><a name="p4191192720546"></a><a name="p4191192720546"></a>2. The operation is successful.</p> 366</td> 367</tr> 368</tbody> 369</table> 370 371Example: 372 373hdc\_std tmode usb 374 375### tmode port _port-number_<a name="section101113462113"></a> 376 377Restarts the daemon process and connects to the device over TCP. 378 379**Table 9** Command description 380 381<a name="table019772118177"></a> 382<table><tbody><tr id="row11972213173"><td class="cellrowborder" valign="top" width="50%"><p id="p319752111178"><a name="p319752111178"></a><a name="p319752111178"></a><strong id="b36026232916"><a name="b36026232916"></a><a name="b36026232916"></a>Parameter</strong></p> 383</td> 384<td class="cellrowborder" valign="top" width="50%"><p id="p17198121121713"><a name="p17198121121713"></a><a name="p17198121121713"></a><strong id="b19575432914"><a name="b19575432914"></a><a name="b19575432914"></a>Description</strong></p> 385</td> 386</tr> 387<tr id="row519812161713"><td class="cellrowborder" valign="top" width="50%"><p id="p819872114179"><a name="p819872114179"></a><a name="p819872114179"></a>port-number</p> 388</td> 389<td class="cellrowborder" valign="top" width="50%"><p id="p18198921171715"><a name="p18198921171715"></a><a name="p18198921171715"></a>Port number used to connect to the device</p> 390</td> 391</tr> 392<tr id="row1519872118175"><td class="cellrowborder" valign="top" width="50%"><p id="p219882112179"><a name="p219882112179"></a><a name="p219882112179"></a><strong id="b8133858163410"><a name="b8133858163410"></a><a name="b8133858163410"></a>Return Value</strong></p> 393</td> 394<td class="cellrowborder" valign="top" width="50%"><p id="p10198621111710"><a name="p10198621111710"></a><a name="p10198621111710"></a><strong id="b5734135914341"><a name="b5734135914341"></a><a name="b5734135914341"></a>Description</strong></p> 395</td> 396</tr> 397<tr id="row1019822118176"><td class="cellrowborder" valign="top" width="50%"><p id="p742693415541"><a name="p742693415541"></a><a name="p742693415541"></a>1. Error information</p> 398<p id="p2426234155414"><a name="p2426234155414"></a><a name="p2426234155414"></a>2. None</p> 399</td> 400<td class="cellrowborder" valign="top" width="50%"><p id="p17426133416542"><a name="p17426133416542"></a><a name="p17426133416542"></a>1. The operation fails.</p> 401<p id="p20426834195419"><a name="p20426834195419"></a><a name="p20426834195419"></a>2. The operation is successful.</p> 402</td> 403</tr> 404</tbody> 405</table> 406 407Example: 408 409hdc\_std tmode port 8710 410 411> **NOTE:** 412>After this command is executed, the remote daemon process exits and restarts, and the TCP connection is enabled by default. If you do not include **port-number** in this command, a random port will be used to connect to the device. 413 414## File Commands<a name="section173133523013"></a> 415 416The following commands are available: 417 418### file send _local remote_<a name="section126223231307"></a> 419 420Sends a file to a remote device. 421 422**Table 10** Command description 423 424<a name="table14621451193116"></a> 425<table><tbody><tr id="row1062451113113"><td class="cellrowborder" valign="top" width="50%"><p id="p1262115173111"><a name="p1262115173111"></a><a name="p1262115173111"></a><strong id="b15171734193117"><a name="b15171734193117"></a><a name="b15171734193117"></a>Parameter</strong></p> 426</td> 427<td class="cellrowborder" valign="top" width="50%"><p id="p1362135193113"><a name="p1362135193113"></a><a name="p1362135193113"></a><strong id="b1515353518311"><a name="b1515353518311"></a><a name="b1515353518311"></a>Description</strong></p> 428</td> 429</tr> 430<tr id="row9627518318"><td class="cellrowborder" valign="top" width="50%"><p id="p14620519314"><a name="p14620519314"></a><a name="p14620519314"></a><span>l</span><span>ocal</span></p> 431</td> 432<td class="cellrowborder" valign="top" width="50%"><p id="p176225193115"><a name="p176225193115"></a><a name="p176225193115"></a>Path of the file to send</p> 433</td> 434</tr> 435<tr id="row1462451183119"><td class="cellrowborder" valign="top" width="50%"><p id="p14622051193115"><a name="p14622051193115"></a><a name="p14622051193115"></a><span>r</span><span>emote</span></p> 436</td> 437<td class="cellrowborder" valign="top" width="50%"><p id="p1634515316"><a name="p1634515316"></a><a name="p1634515316"></a>Destination path on the remote device</p> 438</td> 439</tr> 440<tr id="row2063145116319"><td class="cellrowborder" valign="top" width="50%"><p id="p4632515314"><a name="p4632515314"></a><a name="p4632515314"></a><strong id="b5438824103211"><a name="b5438824103211"></a><a name="b5438824103211"></a>Return Value</strong></p> 441</td> 442<td class="cellrowborder" valign="top" width="50%"><p id="p136375117312"><a name="p136375117312"></a><a name="p136375117312"></a><strong id="b1492063173210"><a name="b1492063173210"></a><a name="b1492063173210"></a>Description</strong></p> 443</td> 444</tr> 445<tr id="row663125113314"><td class="cellrowborder" valign="top" width="50%"><p id="p17550131319559"><a name="p17550131319559"></a><a name="p17550131319559"></a>1. Error information</p> 446<p id="p0550151385512"><a name="p0550151385512"></a><a name="p0550151385512"></a>2. File transfer result</p> 447</td> 448<td class="cellrowborder" valign="top" width="50%"><p id="p1955091315517"><a name="p1955091315517"></a><a name="p1955091315517"></a>1. The operation fails.</p> 449<p id="p1555041375519"><a name="p1555041375519"></a><a name="p1555041375519"></a>2. The operation is successful.</p> 450</td> 451</tr> 452</tbody> 453</table> 454 455Example: 456 457hdc\_std file send E:\\a.txt /data/local/tmp/a.txt 458 459### file recv \[-a\] _remote local_<a name="section26966541304"></a> 460 461Receives a file from a remote device. 462 463**Table 11** Command description 464 465<a name="table158381145153317"></a> 466<table><tbody><tr id="row17838945183314"><td class="cellrowborder" valign="top" width="50%"><p id="p383884515338"><a name="p383884515338"></a><a name="p383884515338"></a><strong id="b1561985893318"><a name="b1561985893318"></a><a name="b1561985893318"></a>Parameter</strong></p> 467</td> 468<td class="cellrowborder" valign="top" width="50%"><p id="p583844511335"><a name="p583844511335"></a><a name="p583844511335"></a><strong id="b77671759123312"><a name="b77671759123312"></a><a name="b77671759123312"></a>Description</strong></p> 469</td> 470</tr> 471<tr id="row1983814583315"><td class="cellrowborder" valign="top" width="50%"><p id="p1383834510332"><a name="p1383834510332"></a><a name="p1383834510332"></a><span>-a</span></p> 472</td> 473<td class="cellrowborder" valign="top" width="50%"><p id="p18391745103318"><a name="p18391745103318"></a><a name="p18391745103318"></a>File retention timestamp mode</p> 474</td> 475</tr> 476<tr id="row1683910452331"><td class="cellrowborder" valign="top" width="50%"><p id="p14839164511331"><a name="p14839164511331"></a><a name="p14839164511331"></a><span>l</span><span>ocal</span></p> 477</td> 478<td class="cellrowborder" valign="top" width="50%"><p id="p1783912455333"><a name="p1783912455333"></a><a name="p1783912455333"></a>Path on the local device to receive the file</p> 479</td> 480</tr> 481<tr id="row3941318173410"><td class="cellrowborder" valign="top" width="50%"><p id="p49411618153419"><a name="p49411618153419"></a><a name="p49411618153419"></a><span>r</span><span>emote</span></p> 482</td> 483<td class="cellrowborder" valign="top" width="50%"><p id="p179411118193416"><a name="p179411118193416"></a><a name="p179411118193416"></a>File path on the remote device</p> 484</td> 485</tr> 486<tr id="row88390451339"><td class="cellrowborder" valign="top" width="50%"><p id="p2839194516338"><a name="p2839194516338"></a><a name="p2839194516338"></a><strong id="b527817345362"><a name="b527817345362"></a><a name="b527817345362"></a>Return Value</strong></p> 487</td> 488<td class="cellrowborder" valign="top" width="50%"><p id="p683984533315"><a name="p683984533315"></a><a name="p683984533315"></a><strong id="b14550163610360"><a name="b14550163610360"></a><a name="b14550163610360"></a>Description</strong></p> 489</td> 490</tr> 491<tr id="row48391459333"><td class="cellrowborder" valign="top" width="50%"><p id="p13206132716566"><a name="p13206132716566"></a><a name="p13206132716566"></a>1. Error information</p> 492<p id="p620632745613"><a name="p620632745613"></a><a name="p620632745613"></a>2. None</p> 493</td> 494<td class="cellrowborder" valign="top" width="50%"><p id="p120662717562"><a name="p120662717562"></a><a name="p120662717562"></a>1. The operation fails.</p> 495<p id="p182060275563"><a name="p182060275563"></a><a name="p182060275563"></a>2. The operation is successful.</p> 496</td> 497</tr> 498</tbody> 499</table> 500 501Example: 502 503hdc\_std file recv /data/local/tmp/a.txt ./a.txt 504 505## App Commands<a name="section2072647133819"></a> 506 507The following commands are available: 508 509### install \[-r/-d/-g\] _package_<a name="section49615195111"></a> 510 511Installs the OpenHarmony application. 512 513**Table 12** Command description 514 515<a name="table17750145274216"></a> 516<table><tbody><tr id="row20750115294217"><td class="cellrowborder" valign="top" width="50%"><p id="p075011520420"><a name="p075011520420"></a><a name="p075011520420"></a><strong id="b11989104513717"><a name="b11989104513717"></a><a name="b11989104513717"></a>Parameter</strong></p> 517</td> 518<td class="cellrowborder" valign="top" width="50%"><p id="p8750352174213"><a name="p8750352174213"></a><a name="p8750352174213"></a><strong id="b557147153718"><a name="b557147153718"></a><a name="b557147153718"></a>Description</strong></p> 519</td> 520</tr> 521<tr id="row10750145215423"><td class="cellrowborder" valign="top" width="50%"><p id="p87501852144219"><a name="p87501852144219"></a><a name="p87501852144219"></a>package</p> 522</td> 523<td class="cellrowborder" valign="top" width="50%"><p id="p1175045234218"><a name="p1175045234218"></a><a name="p1175045234218"></a><span id="text16401191544314"><a name="text16401191544314"></a><a name="text16401191544314"></a>OpenHarmony</span> application installation package</p> 524</td> 525</tr> 526<tr id="row675055212422"><td class="cellrowborder" valign="top" width="50%"><p id="p875111524420"><a name="p875111524420"></a><a name="p875111524420"></a>-r</p> 527</td> 528<td class="cellrowborder" valign="top" width="50%"><p id="p117511052144218"><a name="p117511052144218"></a><a name="p117511052144218"></a>Replaces an existing application.</p> 529</td> 530</tr> 531<tr id="row27512529425"><td class="cellrowborder" valign="top" width="50%"><p id="p975125234214"><a name="p975125234214"></a><a name="p975125234214"></a>-d</p> 532</td> 533<td class="cellrowborder" valign="top" width="50%"><p id="p13784141616446"><a name="p13784141616446"></a><a name="p13784141616446"></a>Allows downgraded installation.</p> 534</td> 535</tr> 536<tr id="row137312316446"><td class="cellrowborder" valign="top" width="50%"><p id="p6374623104414"><a name="p6374623104414"></a><a name="p6374623104414"></a>-g</p> 537</td> 538<td class="cellrowborder" valign="top" width="50%"><p id="p6374122319440"><a name="p6374122319440"></a><a name="p6374122319440"></a>Grants permission dynamically</p> 539</td> 540</tr> 541<tr id="row12751652184219"><td class="cellrowborder" valign="top" width="50%"><p id="p475195234219"><a name="p475195234219"></a><a name="p475195234219"></a><strong id="b1597414419421"><a name="b1597414419421"></a><a name="b1597414419421"></a>Return Value</strong></p> 542</td> 543<td class="cellrowborder" valign="top" width="50%"><p id="p117511452174214"><a name="p117511452174214"></a><a name="p117511452174214"></a><strong id="b19771771427"><a name="b19771771427"></a><a name="b19771771427"></a>Description</strong></p> 544</td> 545</tr> 546<tr id="row1275111528426"><td class="cellrowborder" valign="top" width="50%"><p id="p472019319564"><a name="p472019319564"></a><a name="p472019319564"></a>1. Error information</p> 547<p id="p5720123110569"><a name="p5720123110569"></a><a name="p5720123110569"></a>2. None</p> 548</td> 549<td class="cellrowborder" valign="top" width="50%"><p id="p16720113145610"><a name="p16720113145610"></a><a name="p16720113145610"></a>1. The operation fails.</p> 550<p id="p8720031185611"><a name="p8720031185611"></a><a name="p8720031185611"></a>2. The operation is successful.</p> 551</td> 552</tr> 553</tbody> 554</table> 555 556Example: 557 558hdc\_std install _hwadmin.hap_ 559 560### uninstall \[-k\] _package_<a name="section167618461814"></a> 561 562Uninstalls the OpenHarmony application. 563 564**Table 13** Command description 565 566<a name="table35114624716"></a> 567<table><tbody><tr id="row125646174717"><td class="cellrowborder" valign="top" width="50%"><p id="p166204610478"><a name="p166204610478"></a><a name="p166204610478"></a><strong id="b1037216202443"><a name="b1037216202443"></a><a name="b1037216202443"></a>Parameter</strong></p> 568</td> 569<td class="cellrowborder" valign="top" width="50%"><p id="p96146184715"><a name="p96146184715"></a><a name="p96146184715"></a><strong id="b1421672174417"><a name="b1421672174417"></a><a name="b1421672174417"></a>Description</strong></p> 570</td> 571</tr> 572<tr id="row26164617475"><td class="cellrowborder" valign="top" width="50%"><p id="p26124612474"><a name="p26124612474"></a><a name="p26124612474"></a>package</p> 573</td> 574<td class="cellrowborder" valign="top" width="50%"><p id="p1634674710"><a name="p1634674710"></a><a name="p1634674710"></a><span id="text442592314413"><a name="text442592314413"></a><a name="text442592314413"></a>OpenHarmony</span> application installation package</p> 575</td> 576</tr> 577<tr id="row06104616471"><td class="cellrowborder" valign="top" width="50%"><p id="p1461146144719"><a name="p1461146144719"></a><a name="p1461146144719"></a>-k</p> 578</td> 579<td class="cellrowborder" valign="top" width="50%"><p id="p19613463476"><a name="p19613463476"></a><a name="p19613463476"></a>Retains <strong id="b57611340114410"><a name="b57611340114410"></a><a name="b57611340114410"></a>/data/cache</strong>.</p> 580</td> 581</tr> 582<tr id="row3624614478"><td class="cellrowborder" valign="top" width="50%"><p id="p46114644719"><a name="p46114644719"></a><a name="p46114644719"></a><strong id="b117338433441"><a name="b117338433441"></a><a name="b117338433441"></a>Return Value</strong></p> 583</td> 584<td class="cellrowborder" valign="top" width="50%"><p id="p186114618474"><a name="p186114618474"></a><a name="p186114618474"></a><strong id="b11453164518441"><a name="b11453164518441"></a><a name="b11453164518441"></a>Description</strong></p> 585</td> 586</tr> 587<tr id="row17654616471"><td class="cellrowborder" valign="top" width="50%"><p id="p2071893615564"><a name="p2071893615564"></a><a name="p2071893615564"></a>1. Error information</p> 588<p id="p1971893615560"><a name="p1971893615560"></a><a name="p1971893615560"></a>2. None</p> 589</td> 590<td class="cellrowborder" valign="top" width="50%"><p id="p167181136125610"><a name="p167181136125610"></a><a name="p167181136125610"></a>1. The operation fails.</p> 591<p id="p1371811369562"><a name="p1371811369562"></a><a name="p1371811369562"></a>2. The operation is successful.</p> 592</td> 593</tr> 594</tbody> 595</table> 596 597Example: 598 599hdc\_std uninstall _package_ 600 601## Debugging Commands<a name="section112861250195015"></a> 602 603The following commands are available: 604 605### hilog<a name="section32171612221"></a> 606 607Obtains logs for debugging. 608 609**Table 14** Command description 610 611<a name="table1494175214518"></a> 612<table><tbody><tr id="row1994119527515"><td class="cellrowborder" valign="top" width="50%"><p id="p19411552205117"><a name="p19411552205117"></a><a name="p19411552205117"></a><strong id="b975982755219"><a name="b975982755219"></a><a name="b975982755219"></a>Parameter</strong></p> 613</td> 614<td class="cellrowborder" valign="top" width="50%"><p id="p139412052195113"><a name="p139412052195113"></a><a name="p139412052195113"></a><strong id="b82231429105217"><a name="b82231429105217"></a><a name="b82231429105217"></a>Description</strong></p> 615</td> 616</tr> 617<tr id="row994275265110"><td class="cellrowborder" valign="top" width="50%"><p id="p69421852115119"><a name="p69421852115119"></a><a name="p69421852115119"></a>None</p> 618</td> 619<td class="cellrowborder" valign="top" width="50%"><p id="p1694213525517"><a name="p1694213525517"></a><a name="p1694213525517"></a>None</p> 620</td> 621</tr> 622<tr id="row149421752145113"><td class="cellrowborder" valign="top" width="50%"><p id="p16942152205114"><a name="p16942152205114"></a><a name="p16942152205114"></a><strong id="b624913217525"><a name="b624913217525"></a><a name="b624913217525"></a>Return Value</strong></p> 623</td> 624<td class="cellrowborder" valign="top" width="50%"><p id="p5942452195116"><a name="p5942452195116"></a><a name="p5942452195116"></a><strong id="b13941933175217"><a name="b13941933175217"></a><a name="b13941933175217"></a>Description</strong></p> 625</td> 626</tr> 627<tr id="row11942105275116"><td class="cellrowborder" valign="top" width="50%"><p id="p194213523517"><a name="p194213523517"></a><a name="p194213523517"></a>Returned information</p> 628</td> 629<td class="cellrowborder" valign="top" width="50%"><p id="p4942155215112"><a name="p4942155215112"></a><a name="p4942155215112"></a>Obtained logs</p> 630</td> 631</tr> 632</tbody> 633</table> 634 635Example: 636 637hdc\_std hilog 638 639### shell \[_command_\]<a name="section524235625"></a> 640 641Executes a command remotely or enters an interactive command environment. 642 643**Table 15** Command description 644 645<a name="table365554575617"></a> 646<table><tbody><tr id="row26551545185617"><td class="cellrowborder" valign="top" width="50%"><p id="p126558451567"><a name="p126558451567"></a><a name="p126558451567"></a><strong id="b7597114010310"><a name="b7597114010310"></a><a name="b7597114010310"></a>Parameter</strong></p> 647</td> 648<td class="cellrowborder" valign="top" width="50%"><p id="p16655164518568"><a name="p16655164518568"></a><a name="p16655164518568"></a><strong id="b154431541936"><a name="b154431541936"></a><a name="b154431541936"></a>Description</strong></p> 649</td> 650</tr> 651<tr id="row1465534525610"><td class="cellrowborder" valign="top" width="50%"><p id="p1265511453563"><a name="p1265511453563"></a><a name="p1265511453563"></a><span>command</span></p> 652</td> 653<td class="cellrowborder" valign="top" width="50%"><p id="p365616459567"><a name="p365616459567"></a><a name="p365616459567"></a>Command to be executed</p> 654</td> 655</tr> 656<tr id="row7656245165619"><td class="cellrowborder" valign="top" width="50%"><p id="p865624565611"><a name="p865624565611"></a><a name="p865624565611"></a><strong id="b1597017555312"><a name="b1597017555312"></a><a name="b1597017555312"></a>Return Value</strong></p> 657</td> 658<td class="cellrowborder" valign="top" width="50%"><p id="p10656194595611"><a name="p10656194595611"></a><a name="p10656194595611"></a><strong id="b061175715310"><a name="b061175715310"></a><a name="b061175715310"></a>Description</strong></p> 659</td> 660</tr> 661<tr id="row9656114585615"><td class="cellrowborder" valign="top" width="50%"><p id="p765624513561"><a name="p765624513561"></a><a name="p765624513561"></a>Returned information</p> 662</td> 663<td class="cellrowborder" valign="top" width="50%"><p id="p2481349195711"><a name="p2481349195711"></a><a name="p2481349195711"></a>Execution result of the command</p> 664</td> 665</tr> 666</tbody> 667</table> 668 669Examples: 670 671hdc\_std shell 672 673## Troubleshooting<a name="section592920255582"></a> 674 675### hdc\_std Fails to Connect to a Device<a name="section74019384588"></a> 676 677- **Symptom** 678 679 **\[Empty\]** is displayed in the output after the **hdc\_std list targets** command is executed. 680 681- **Solutions** 682 1. The device cannot be identified. 683 684 Check whether **HDC Device** exists in the universal serial bus device of the device manager. If **HDC Device** does not exist, the device cannot be connected. In this case, remove and then insert the device or burn the latest image for the device. 685 686 2. hdc\_std works improperly. 687 688 Run the **hdc kill** or **hdc start -r** command to kill or restart the hdc service. Then, run the **hdc list targets** command to check whether device information can be obtained. 689 690 3. hdc\_std does not match the device. 691 692 If the latest image is burnt on the device, the latest hdc\_std version must be used. As hdc\_std is updated continuously, obtain hdc\_std of the latest version from the **developtools\_hdc\_standard** repository in the **prebuilt** directory. 693 694 695 696## hdc\_std Fails to Run<a name="section6825095917"></a> 697 698- **Symptom** 699 700 The **hdc\_std.exe** file does not run after being clicked. 701 702- **Solutions** 703 704 **hdc\_std.exe** requires no installation. It can be directly used on a disk or added to environment variables. Open the cmd window and run the **hdc\_std** command to use **hdc\_std.exe**. 705 706 707