diff --git a/README.md b/README.md index e8bf46662d85c2a1ffb2cf0f899efd2545e34f2e..652cc57924230c719938bef8adf9668126ec6685 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,51 @@ echo "export OHOS_SDK=/home/hsun21/ohos-sdk/linux" >> ~/.bashrc # 执行.bashrc内的命令 source ~/.bashrc ``` +### 2.3 Mac环境 + +#### 2.3.1 安装 Python环境 + +使用 brew安装python3 + +```bash +brew install python3.8 +``` +#### 2.3.2 安装 conan + +使用 pip3 安装conan +```bash +pip3 install conan==2.0.14 +``` +使用 conan 指令检查是否安装成功: +```bash + +conan --version + +``` + 如果出现回显`zsh: command not found: conan` 则需要在系统配置中配置conan路径: + +搜索 conan 路径,定位到 canon 在`/Users/{user_name}/Library/Python/3.9/bin`路径下。 + +在`~/.bash_profile` 或 `~/.zshrc` 文件中增加一行: + +> 修改.bash_profile或.zshrc 文件取决于 mac 上面终端用的是 bash 还是 zsh。 + +```bash +export PATH=$PATH:/Users/{user_name}/Library/Python/3.9/bin +``` +然后执行: +```bash +source ~/.zshrc #或者 source ~/.zshrc +``` + 此时在任意验证 `conan --version` 可执行命令 + +#### 2.3.3设置 SDK + +在~/.bash_profile 或者source ~/.zshrc 文件中增加一行: + +```bash +export OHOS_SDK={鸿蒙 SDK 路径} +``` # 三、如何使用