在主机上执行 docker
docker run --rm \
-v ${HOME}/下载/webrtc/webrtc/:/webrtc/ \
-it \
piasy/webrtc-build
以下均为在 docker 中执行
设置代理并开始下载代码
export http_proxy=192.168.3.195:9001
export https_proxy=192.168.3.195:9001
cd /depot_tools && git pull
cd /webrtc
fetch --nohooks webrtc_android
fetch 完成之后的效果
千万别在看到 Syncing projects: 100% (232/232), done.
时按 CTRL + C
键。
[1:06:22] Still working on:
[1:06:22] src/third_party/android_ndk
[1:06:32] Still working on:
[1:06:32] src/third_party/android_ndk
[1:06:34] Still working on:
[1:06:34] src/third_party/android_ndk
Syncing projects: 100% (232/232), done.
Running: git submodule foreach 'git config -f $toplevel/.git/config submodule.$name.ignore all'
Running: git config --add remote.origin.fetch '+refs/tags/*:refs/tags/*'
Running: git config diff.ignoreSubmodules all
执行 gsync
- 修改 .gclient, 将
target_os = ["android", "unix"]
改为target_os = ["android", "linux"]
cd /webrtc/ && vim .gclient
修改后内容为:
solutions = [
{
"url": "https://webrtc.googlesource.com/src.git",
"managed": False,
"name": "src",
"deps_file": "DEPS",
"custom_deps": {},
},
]
target_os = ["android", "linux"]
- 修改 .boto
cd /boot/ && vim .boto
修改后内容为:
[Boto]
proxy= http://192.168.3.195
proxy_port =9001
- 设置环境变量
set NO_AUTH_BOTO_CONFIG=/root/.boto
执行 gclient sync
gclient sync
# 中间如果退出了,再次执行时不想重复下载以前的内容
gclient sync --nohooks
参考:
1.《WebRTC Native 开发实战》- 作者许建林
2.https://webrtc.github.io/webrtc-org/native-code/android/