以下操作真实实验过,安卓,苹果均可成功

环境
  • Mac 10.13.6
  • Xcode 11
  • 翻墙代理:Lantern 专业版
  • Python 2.7.10
设置 git 代理
#设置git代理
$ git config --global http.proxy http://127.0.0.1:xxxx
$ git config --global https.proxy https://127.0.0.1:xxxx
#清空git代理
$ git config --global --unset http.proxy
$ git config --global --unset https.proxy
  • 注意:代理地址的端口要用Lantern代理监听的端口地址
安装 Depot_tools
  • git 命令获取 depot_tools:
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  • 配置坏境变量
$ echo -e "\nexport PATH=$PWD/depot_tools:$PATH" >> $HOME/.bash_profile
$ echo -e "\nexport DEPOT_TOOLS_UPDATE=0" >> $HOME/.bash_profile
$ source $HOME/.bash_profile
  • 检测配置是否成功
$ echo $PATH
安装 ninja
  • ninja 是 WebRTC 的编译工具,我们需要对其进行编译,步骤如下:
$ git clone git://github.com/martine/ninja.git
$ cd ninja/
$ ./bootstrap.py
  • 复制到系统目录(也可配置坏境变量)
$ sudo cp ninja /usr/local/bin/
$ sudo chmod a+rx /usr/local/bin/ninja
设置 boto 代理
  • 创建http_proxy.boto文件,在里面输入如下内容:
[Boto]
proxy=127.0.0.1
proxy_port=xxxx #此端口号为Lantern的监听的端口号
  • 配置坏境变量
$ echo -e "\nexport NO_AUTH_BOTO_CONFIG=$PWD/http_proxy.boto" >> $HOME/.bash_profile
$ source $HOME/.bash_profile
  • 检测配置是否成功
$ echo $NO_AUTH_BOTO_CONFIG
下载源代码

$ export GYP_DEFINES="OS=ios"
$ fetch --nohooks webrtc_ios
$ gclient sync
$ gclient runhooks

//或可以指定版本号
$ gclient sync -r 6f21dc245689c29730002da09534a8d275e6aa92 --force

安卓的话
 # 选择android 分支版本
fetch --nohooks webrtc_android
# 同步代码
gclient sync

等待源码下载..

如果出错常试以下方法,利用google几十兆的外网下载,很快

获取代码

gclient在更新代码时,会读取trunk下的DEPS文件,根据文件中配置的路径和版本号更新代码。trunk下的DEPS文件在查找某些库时,依赖chromium_deps目录下的DEPS文件来获取路径。gclient会先执行sync,再执行hooks,这两个阶段都需要联网下载相关资源。所以仅仅是sync完成,不一定下载完了所有工具链,gyp生成工程文件后,也有可能缺少编译、运行需要的资源,只有在运行起来后才能保证相关平台的代码和工具链都下载完了。

官方推荐步骤:

$ gclient config http://webrtc.googlecode.com/svn/trunk
$ gclient sync --force

但是由于墙的存在,这种方法几乎无法成功。可以尝试vpngit、修改依赖库地址、多次尝试下载等各种方法,然后祈祷代码可以下载完整。

执行了gclient config http://webrtc.googlecode.com/svn/trunk后,.gclient的内容变成如下:

$ cat .gclient
solutions = [
{ "name" : "trunk",
"url" : "http://webrtc.googlecode.com/svn/trunk",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
},
"safesync_url": "",
},
]
cache_dir = None

更改成通过git的方式获取,使用如下命令:

$ gclient config --name trunk 'https://git.chromium.org/git/external/webrtc.git'
$ gclient sync --force

.gclient内容如下:

$ cat .gclient
solutions = [
{ "name" : "trunk",
"url" : "https://git.chromium.org/git/external/webrtc.git",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
},
},
]
cache_dir = None

错误集锦

无法下载库

下载过程中,很有可能因为墙的原因或其它一些诡异的未知问题导致某一个库下载不下来。例如以下的一个错误:

[0:01:17] error: RPC failed; result=56, HTTP code = 200
[0:01:17] fatal: The remote end hung up unexpectedly
[0:01:17] fatal: early EOF
[0:01:17] fatal: index-pack failed
Traceback (most recent call last):
File "/opt/depot_tools/gclient_scm.py", line 881, in _Clone
self._Run(clone_cmd, options, cwd=self._root_dir, retry=True)
File "/opt/depot_tools/gclient_scm.py", line 1166, in _Run
gclient_utils.CheckCallAndFilterAndHeader(cmd, env=env, **kwargs)
File "/opt/depot_tools/gclient_utils.py", line 292, in CheckCallAndFilterAndHeader
return CheckCallAndFilter(args, **kwargs)
File "/opt/depot_tools/gclient_utils.py", line 538, in CheckCallAndFilter
rv, args, kwargs.get('cwd', None), None, None)
CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src/third_party /srv/example/webrtc/src/_gclient_third_party_1reibo' returned non-zero exit status 128 in /srv/example/webrtc
----------------------------------------
Traceback (most recent call last):
File "/opt/depot_tools/gclient.py", line 2128, in <module>
sys.exit(main(sys.argv[1:]))
File "/opt/depot_tools/gclient.py", line 2114, in main
return dispatcher.execute(OptionParser(), argv)
File "/opt/depot_tools/subcommand.py", line 252, in execute
return command(parser, args[1:])
File "/opt/depot_tools/gclient.py", line 1876, in CMDsync
ret = client.RunOnDeps('update', args)
File "/opt/depot_tools/gclient.py", line 1363, in RunOnDeps
work_queue.flush(revision_overrides, command, args, options=self._options)
File "/opt/depot_tools/gclient_utils.py", line 1037, in run
self.item.run(*self.args, **self.kwargs)
File "/opt/depot_tools/gclient.py", line 772, in run
file_list)
File "/opt/depot_tools/gclient_scm.py", line 156, in RunCommand
return getattr(self, command)(options, args, file_list)
File "/opt/depot_tools/gclient_scm.py", line 417, in update
self._Clone(revision, url, options)
File "/opt/depot_tools/gclient_scm.py", line 889, in _Clone
if os.listdir(tmp_dir):
OSError: [Errno 2] No such file or directory: '/srv/example/webrtc/src/_gclient_third_party_1reibo'

遇到以上错误时,直接使用命令方式下载:

$ git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/chromium/src/third_party

无法下载android_tools

一直提示如下的信息:

[0:03:02] Still working on:
[0:03:02] src/third_party/android_tools [0:03:12] Still working on:
[0:03:12] src/third_party/android_tools [0:03:22] Still working on:
[0:03:22] src/third_party/android_tools [0:03:32] Still working on:
[0:03:32] src/third_party/android_tools [0:03:42] Still working on:
[0:03:42] src/third_party/android_tools

使用如下命令下载:

$ git clone https://git.chromium.org/git/android_tools.git

然后将下载好的库拷贝到trunk/third_party/android_tools目录下。

webRTC client 源码环境工具配置的更多相关文章

  1. windows下IntelliJ IDEA搭建kafka源码环境

    于kafka核心原理的资料,网上有很多,但是如果不自己研究其源码,永远是知其然而不知所以然.下面就来演示如何在windows环境下来编译kafka源码,并通过IntelliJ IDEA开发工具搭建ka ...

  2. ubuntu下linux内核源码阅读工具和调试方法总结

    http://blog.chinaunix.net/uid-20940095-id-66148.html 一 linux内核源码阅读工具 windows下当然首选source insight, 但是l ...

  3. Linux Kafka源码环境搭建

    本文主要讲述的是如何搭建Kafka的源码环境,主要针对的Linux操作系统下IntelliJ IDEA编译器,其余操作系统或者IDE可以类推. 1.安装和配置JDK确认JDK版本至少为1.7,最好是1 ...

  4. 使用IntelliJ IDEA搭建kafka源码环境时遇到Output path错误解决办法

    kafka源码环境搭建好之后,需要在IntelliJ IDEA开发工具中以debug方式启动kafka服务器来测试消息的生产和消费. 但是在启动kafka.Kafka类中的main方法(也就是运行 k ...

  5. 曹工说mini-dubbo(2)--分析eureka client源码,想办法把我们的服务提供者注册到eureka server(上)

    前言 eureka是spring cloud Netflix技术体系中的重要组件,主要完成服务注册和发现的功能:那现在有个问题,我们自己写的rpc服务,如果为了保证足够的开放性和功能完善性,那肯定要支 ...

  6. 基于Eclipse搭建Hadoop源码环境

    Hadoop使用ant+ivy组织工程,无法直接导入Eclipse中.本文将介绍如何基于Eclipse搭建Hadoop源码环境. 准备工作 本文使用的操作系统为CentOS.需要的软件版本:hadoo ...

  7. 【原】Spark中Client源码分析(二)

    继续前一篇的内容.前一篇内容为: Spark中Client源码分析(一)http://www.cnblogs.com/yourarebest/p/5313006.html DriverClient中的 ...

  8. [转]VS2015 Git 源码管理工具简单入门

    VS2015 Git 源码管理工具简单入门   1.VS Git插件 1.1 环境 VS2015+GitLab 1.2 Git操作过程图解 1.3 常见名词解释 拉取(Pull):将远程版本库合并到本 ...

  9. Windows平台下源码分析工具

    最近这段时间在阅读 RTKLIB的源代码,目前是将 pntpos.c文件的部分看完了,准备写一份文档记录下这些代码的用处.处理过程.理论公式来源.注意事项,自己还没有弄明白的地方.目前的想法是把每一个 ...

随机推荐

  1. ICEM-空心圆柱体

    原视频下载地址:https://pan.baidu.com/s/1boG49MB 密码: 4iq6

  2. linux服务器磁盘挂载

    1.先查看当前服务器挂载的磁盘个数 fdisk -l 2.将vdb磁盘挂载到/data目录下 mount /dev/vdb /data 3.df -h  检查磁盘挂载的情况

  3. Cucumber介绍

    Cucumber是一个提供能让我们都理解的普通语言,通过普通语言来描述的测试用例,并支持行为驱动开发的测试工具.Cucumber支持大多数变成语言,如Ruby.Java和Python等. 官方地址:h ...

  4. Spring cloud微服务安全实战-8-1课程总结

    总结 首先讲了api的安全.安全常见的风险.安全措施.然后我们把简单的api演化成一个这种微服务的架构. 首先讲了在网关上可以做哪些安全的措施.然后讲了如何搭建一个安全中心,也就是认证服务器,包括一些 ...

  5. Spring cloud微服务安全实战-7-5配置grafana图表及报警

    先过一下grafana的配置文件 grafana的配置文件. 右键服务的地址.发信人 账号 和面等 配置要连到prometheus上. 登陆的密码是多少,第二行是不允许用户注册. dashboard. ...

  6. tp3.2升级tp5需要注意的变化

    I方法用input代替:D和M方法没了,需要的话自己封装.C方法没了,需要自己封装,配置文件说明官方文档写的不对,无法使用 Session的使用发生很大变化 模板渲染,控制器传空值会报错 模板内置标签 ...

  7. idea切换工作目录后无法重启问题记录

    1.idea每次重新打开新项目或者切换新的工作空间后,总是半天起不来.有时候知道是缓存或者其他的问题,有时候莫名其妙就好了. 本次原因是:

  8. javascript中this、new、apply和call详解

    如果在javascript语言里没有通过new(包括对象字面量定义).call和apply改变函数的this指针,函数的this指针都是指向window的,重要的话要说三遍.... 讲解this指针的 ...

  9. AC与AP的安装使用(未经实战,仅供参考,未完待续)

    AC:无线控制器(Wireless Access Point Controller) AP:无线访问接入点(WirelessAccessPoint) 以信锐AC为例 AC设备的管理口为MANAGE(E ...

  10. Centos7.3使用脚本自动静默安装oracle11.2.0.4数据库

    一直想着写一个脚本实现自动化安装oracle数据库.以下内容实验过几次了,可能还存在些小问题,如果在跑以下脚本中遇到问题,自己仔细排查即可 挣扎了好久,总算还是没实现,目前只能通过依次执行多个脚本来安 ...