From 4b12a561fbfab0832b157c02c75f4e5856c4d22f Mon Sep 17 00:00:00 2001 From: harrysimply <837851874@qq.com> Date: Tue, 19 Mar 2024 11:42:35 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A1=A5=E5=85=85=20macOS=20=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: harrysimply <837851874@qq.com> --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index e8bf46662..fc189e29b 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,48 @@ 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 文件中增加一行: +```bash +export PATH=$PATH:/Users/{user_name}/Library/Python/3.9/bin +``` +然后执行: +```bash +source ~/.bash_profile +``` + 此时在任意验证 `conan --version` 可执行命令 + +#### 2.3.3设置 SDK + +在~/.bash_profile 文件中增加一行: + +```bash +export OHOS_SDK={鸿蒙 SDK 路径} +``` # 三、如何使用 -- Gitee From 0479280d39dfbdb3bc91fc2809464a1f8a24cf4d Mon Sep 17 00:00:00 2001 From: harrysimply <837851874@qq.com> Date: Wed, 20 Mar 2024 12:19:50 +0000 Subject: [PATCH 2/2] update README.md. Signed-off-by: harrysimply <837851874@qq.com> --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fc189e29b..652cc5792 100644 --- a/README.md +++ b/README.md @@ -164,19 +164,22 @@ conan --version 搜索 conan 路径,定位到 canon 在`/Users/{user_name}/Library/Python/3.9/bin`路径下。 -在~/.bash_profile 文件中增加一行: +在`~/.bash_profile` 或 `~/.zshrc` 文件中增加一行: + +> 修改.bash_profile或.zshrc 文件取决于 mac 上面终端用的是 bash 还是 zsh。 + ```bash export PATH=$PATH:/Users/{user_name}/Library/Python/3.9/bin ``` 然后执行: ```bash -source ~/.bash_profile +source ~/.zshrc #或者 source ~/.zshrc ``` 此时在任意验证 `conan --version` 可执行命令 #### 2.3.3设置 SDK -在~/.bash_profile 文件中增加一行: +在~/.bash_profile 或者source ~/.zshrc 文件中增加一行: ```bash export OHOS_SDK={鸿蒙 SDK 路径} -- Gitee