Mac用repo下载鸿蒙OS源码

注册码云账户,配置SSH公钥,配置Git,这些步骤以前做过,不再描述,可以看官方教程。

1 安装repo

curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo
chmod a+x /usr/local/bin/repo
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple requests

2 下载源码

mkdir openharmony
cd openharmony
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c -j2

我用1.0版本

repo init -u https://gitee.com/openharmony/manifest.git -b OpenHarmony-1.0

10分钟左右下完。1.64GB。

报错

  • Mac拉取源码,报错
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify

Downloading Repo source from https://gitee.com/oschina/repo.git
fatal: Cannot get https://gitee.com/oschina/repo.git/clone.bundle
fatal: error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
fatal: cloning the git-repo repository failed, will remove '.repo/repo' 

原因是mac的python3.6使用自带的openssl,需要安装证书。

解:

open /Applications/Python\ 3.6/Install\ Certificates.command

参考:
https://stackoverflow.com/a/61818074/7996308

  • 用清华的repo会有一些错误,要改用gitee的repo。

参考

get-code/源码获取.md · OpenHarmony/docs - Gitee.com
https://gitee.com/openharmony/docs/blob/master/get-code/源码获取.md

posted @ 2020-10-07 16:04  奥巴荣  阅读(1044)  评论(0编辑  收藏  举报