问题现象
首次下载Command Line Tools for Linux解压后在sdk/default/openharmony/toolchains目录下执行hdc -v提示错误:
Command 'hdc' not found, did you mean: command 'gdc' from deb gdc command 'hpc' from deb ghc command 'htc' from deb httptunnel command 'hsc' from deb hsc command 'hd' from deb bsdmainutils command 'hc' from deb httpcode command 'hyc' from deb python-hy command 'hyc' from deb python3-hy command 'hdp' from deb hdf4-tools command 'dc' from deb dc command 'sdc' from deb hpsockd command 'hcc' from deb lam4-dev command 'hcc' from deb uhexen2 command 'hcd' from deb hfsutils command 'tdc' from deb tdc Try: sudo apt install <deb name>
可能原因
终端中执行的hdc命令未找到,默认会从环境变量的PATH中寻找可执行程序路径,首次安装使用未配置环境变量导致出错。
解决措施
$ /path/to/hdc -v 注:实际使用时请替换为安装目录下的真实路径
$ ln -s /path/to/hdc /usr/bin/hdc 注:实际使用时请替换为安装目录下的真实路径