iMac 平台按照官方文档配置 hdc 命令不生效
操作步骤:1、按照下面文档配置 hdc 命令, https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/hdc-0000001815246474#ZH-CN_TOPIC_0000001864901001__%E5%8F%AF%E9%80%89%E9%85%8D%E7%BD%AE%E5%85%A8%E5%B1%80%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F具体信息如下:kevingpqi@KEVINGPQI-MC3 ~ % echo SHELL /bin/zsh kevingpqi@KEVINGPQI-MC3 ~ % cat ~/.zshrc export PATH="/usr/local/opt/icu4c/bin:PATH"export PATH="/usr/local/opt/icu4c/sbin:$PATH"
Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH=“<math><semantics><mrow><mi>P</mi><mi>A</mi><mi>T</mi><mi>H</mi><mo>:</mo></mrow><annotation encoding="application/x-tex">PATH:</annotation></semantics></math>PATH:HOME/.rvm/bin”export PATH="/Users/kevingpqi/Documents/01SoftWare/Qt5.13.0/5.13.0/clang_64/bin:$PATH"
source ~/.bash_profileexport PATH="/usr/local/opt/ruby/bin:<math><semantics><mrow><mi>P</mi><mi>A</mi><mi>T</mi><mi>H</mi><mi mathvariant="normal">"</mi><mi>e</mi><mi>x</mi><mi>p</mi><mi>o</mi><mi>r</mi><mi>t</mi><mi>P</mi><mi>A</mi><mi>T</mi><mi>H</mi><mo>=</mo><mi mathvariant="normal">"</mi><mi mathvariant="normal">/</mi><mi>u</mi><mi>s</mi><mi>r</mi><mi mathvariant="normal">/</mi><mi>l</mi><mi>o</mi><mi>c</mi><mi>a</mi><mi>l</mi><mi mathvariant="normal">/</mi><mi>o</mi><mi>p</mi><mi>t</mi><mi mathvariant="normal">/</mi><mi>b</mi><mi>i</mi><mi>n</mi><mi>u</mi><mi>t</mi><mi>i</mi><mi>l</mi><mi>s</mi><mi mathvariant="normal">/</mi><mi>b</mi><mi>i</mi><mi>n</mi><mo>:</mo></mrow><annotation encoding="application/x-tex">PATH" export PATH="/usr/local/opt/binutils/bin:</annotation></semantics></math>PATH"exportPATH="/usr/local/opt/binutils/bin:PATH"export PATH="/Users/kevingpqi/Documents/09Harmony/Tools/command-line-tools/bin:$PATH"export HDC_SERVER_PORT=7035launchctl setenv HDC_SERVER_PORT $HDC_SERVER_PORTexport HDC_SERVER_PORTkevingpqi@KEVINGPQI-MC3 ~ % source ~/.zshrckevingpqi@KEVINGPQI-MC3 ~ % hdc -hzsh: command not found: hdckevingpqi@KEVINGPQI-MC3 ~ %kevingpqi@KEVINGPQI-MC3 ~ %kevingpqi@KEVINGPQI-MC3 ~ % codelinter --helpUsage: codelinter [options] [dir]
Options:-v --version Displays the version information of CodeLinter.-c --config <configPath> Indicates the path of the CodeLinter configuration file, which must be in .json or .json5 format. Optional.–fix Specifies whether to automatically fix defects during code linting. Optional.-o --output <reportFile> Indicates the path of the linting report. Optional.-p --product <productName> Indicates the name of the currently active product. Optional.-f --format <outputFormat> Indicates the output format: default, json, or xml. Optional. The default value is default.-h --help Displays the help information of CodeLinter.Argument:[dir] Indicates the root directory of the project to lint. Optional. The default value is the current context directory.kevingpqi@KEVINGPQI-MC3 ~ %
已按照文档要求 “关闭并重启DevEco Studio” 无法找到 hdc 命令,在 IDE中的Termina 中也是如此
2、下面文档中的命令行设置无问题, 如上面执行的 codelinter --helphttps://developer.huawei.com/consumer/cn/doc/harmonyos-guides/ide-command-line-tools-0000001124588437
需要配置全局环境变量:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/hdc-0000001815246474#ZH-CN_TOPIC_0000001864901001__可选配置全局环境变量。