1.硬盘空间:

WebRTC官方原话:

The checkout size is large due the use of the Chromium build toolchain and many dependencies. Estimated size:

Linux: 6.4 GB.
Linux (with Android): 16 GB (of which ~8 GB is Android SDK+NDK images).
Mac (with iOS support): 5.6GB

2.破墙:

Ubuntu破墙:http://www.cnblogs.com/hcbin/p/8489041.html

3.将socks5协议转http协议

proxychains使用socks5协议,但cipd不支持,会报出这样的错误:

[...] cipd: connectivity error ...

所以只能将socks5协议转http协议

使用polipo进行转换:

git clone https://github.com/jech/polipo.git

安装

cd polipo
sudo make all
sudo make install

打开编辑器,新建文件

vim /etc/polipo.conf

添加如下内容,保存关闭(绿字是设置polipo的代理,红字是破墙代理)

daemonise = false
pidFile = /tmp/polipo.pid
proxyAddress="0.0.0.0"
proxyPort=
socksParentProxy = "127.0.0.1:1080"
socksProxyType = socks5
diskCacheRoot = ""

执行polipo(PS:终端会卡住),打开新终端执行操作,命令可以省略proxychains前缀直接破墙

/usr/local/bin/polipo -c /etc/polipo.conf

参考:https://hk.saowen.com/a/fa13ead9f226de7d089a75fc4f56c77e836c43d7317b4fced023af6d133b448e

4.设置depot_tools代理

不设置的话download_from_google_storage会提示NO_AUTH_BOTO_CONFIG

打开编辑器,新建文件

vim /etc/gclient_boto.cfg

添加如下内容,保存关闭(绿字是polipo代理)

[Boto]
proxy = 127.0.0.1
proxy_port =

终端设置变量

export NO_AUTH_BOTO_CONFIG=/etc/gclient_boto.cfg

参考:https://blog.csdn.net/qq_22716879/article/details/53760879

5.设置git

git config --global core.packedgitlimit 10g
git config --global core.packedgitwindowsize 10g
git config --global core.bigfilethreshold 10g
git config --global core.compression 0
git config --global core.autocrlf false
git config --global core.filemode false
git config --global pack.deltacachesize 10g
git config --global pack.packsizelimit 10g
git config --global pack.windowmemory 10g
git config --global pack.threads 4

可选

git config --global branch.autosetupmerge always
git config --global branch.autosetuprebase always

下载代码,下载中断用gclient sync命令继续下载,整个下载过程需要几个小时(视乎网络速度)

PS:建议插网线,一般网线传输速率比WIFI快和稳定,WIFI受路由发送速率与无线网卡接收速率限制

mkdir webrtc-android && cd webrtc-android
fetch --nohooks webrtc_android
gclient sync

因为异常中断,使用gclient sync继续下载

如中断时发现某个文件无法下载,请手动下载,并复制到提示的文件夹中,然后多尝试用gclient sync继续下载

root@ubuntu:/home/hcbin/webrtc-android# gclient sync
Running depot tools as root is sad.
Syncing projects: 23% (15/63) src/third_party/accessibility_test_framework:chromium/third_party/accessibility-test-frameSyncing projects: 25% (16/63) src/third_party/android_support_test_runner:chromium/third_party/android_support_test_runnSyncing projects: 26% (17/63) src/third_party/bazel:chromium/third_party/bazel Syncing projects: 30% (19/63) src/third_party/byte_buddy:chromium/third_party/byte_buddy
________ running 'cipd ensure -log-level error -root /home/hcbin/webrtc-android/src -ensure-file /tmp/tmp78dpke.ensure' in '.'
Bootstrapping cipd client for linux-amd64 from https://chrome-infra-packages.appspot.com/client?platform=linux-amd64&version=git_revision:ae28364c740acff97ae118adcb2808b6cb5129c5...
curl: (7) Failed to connect to chrome-infra-packages.appspot.com port 443: Connection refused
Syncing projects: 68% (44/64) src/third_party/junit/src
[0:02:33] Still working on:
[0:02:33] src/third_party/icu [0:02:43] Still working on:
[0:02:43] src/third_party/icu [0:02:53] Still working on:
[0:02:53] src/third_party/icu [0:03:03] Still working on:
[0:03:03] src/third_party/icu [0:03:14] Still working on:
[0:03:14] src/third_party/icu [0:03:18] Still working on:
[0:03:18] src/third_party/icu
Syncing projects: 70% (45/64) src/third_party/icu src/third_party/apk-patch-size-estimator:chromium/third_party/apk-patch-size-estimator (ERROR)
----------------------------------------
[0:00:47] Started.
----------------------------------------
Error: Command 'cipd ensure -log-level error -root /home/hcbin/webrtc-android/src -ensure-file /tmp/tmp78dpke.ensure' returned non-zero exit status 7
root@ubuntu:/home/hcbin/webrtc-android#

参考:https://blog.csdn.net/qq_22716879/article/details/53760879

6.编译

下载依赖

cd src
./build/install-build-deps.sh

确定当前工作目录是src,使用GN生成项目

gn gen out/Release --args='target_os="android" target_cpu="arm"'

ARM64 使用 target_cpu="arm64"

32-bit x86: 使用 target_cpu="x86"

64-bit x64: 使用 target_cpu="x64"

编译

ninja -C out/Release

参考:https://webrtc.org/native-code/android/

[Android]Linux下WebRTC下载与编译的更多相关文章

  1. [转]Caffe在Linux下的安装,编译,实验

    Caffe在Linux下的安装,编译,实验  原文地址:http://www.cnblogs.com/evansyang/p/6150118.html 第一部分:Caffe 简介 caffe是有伯克利 ...

  2. Linux下校验下载文件的完整性(MD5,SHA1,PGP)

    查看: Linux下校验下载文件的完整性(MD5,SHA1,PGP) http://blog.useasp.net/archive/2014/03/29/use-md5-sha1-or-pgp-to- ...

  3. Linux下librdkafka客户端的编译运行

    Linux下librdkafka客户端的编译运行 librdkafka是一个开源的Kafka客户端C/C++实现,提供了Kafka生产者.消费者接口. 由于项目需要,我要将Kafka生产者接口封装起来 ...

  4. Linux下FFmpeg的安装编译过程【转】

    本文转载自:http://www.linuxidc.com/Linux/2013-06/85628.htm 详细说下在Linux下FFmpeg的安装编译过程.参考 Ubuntu 10.04安装编译FF ...

  5. I.MX6 Android 5.1.1 下载、编译

    /************************************************************************* * I.MX6 Android 5.1.1 下载. ...

  6. Android源码的下载和编译

    由于公司会安排我做硬解码这块,所以最近一直想研究一下Android源码,可是Android源码的下载真的挺麻烦的(可能是我第一次下载),参照网上的方法,没有一个可行的,现在就将我的下载过程和大家分享一 ...

  7. Android系统源代码的下载与编译

    http://www.jianshu.com/p/aeaceda41798 目录 1.简介 2.官方同步源代码 3.镜像同步源代码 4.已有源代码更新 5.编译源代码 5.1编译Android 4.1 ...

  8. [zhuan] linux 下 wxWidgets 安装,编译

      http://blog.csdn.net/yuzhenxiong0823/article/details/7727133 wxWidgets在Linux下有wxGTK和wxX11供使用,各需要GT ...

  9. linux下motion摄像头监控编译与配置

    利用linxu下的开源的motion搭建嵌入式视频动态监控系统 所谓移动图像监测,简单来说就是利用摄像头定点监测某个区域,当有移动物体经过时,摄像头便自动抓拍(要监测多大物体.按拍照速率都是可调的), ...

随机推荐

  1. Asteroids 爆破彗星

    发售年份 1979 平台 街机 开发商 雅达利(Atari) 类型 射击 https://www.youtube.com/watch?v=WYSupJ5r2zo

  2. Yii2 设计模式——工厂方法模式

    工厂方法模式 模式定义 工厂方法模式(Factory Method Pattern)定义了一个创建对象的接口,但由子类决定要实例化的类是哪一个.工厂方法让类吧实例化推迟到子类. 什么意思?说起来有这么 ...

  3. 16.1 解决SecureCRT的Home+End+Del不好用使用方法

    有些时候 securecrt 的快捷键 与我们使用习惯不一致时,可以自己动手修改下映射文件. SecureCRT菜单 :工具→键映射编辑器,在弹出的键盘中点击“home”,会弹出一个窗口,在“发送字符 ...

  4. C# System.Collections

    System.collection类: 动态数组ArrayList 代表了可被单独索引的对象的有序集合.也就是说他是一个动态的数组,你可以通过索引来进行增删改等操作,数组会自动调整数组的大小.允许在列 ...

  5. (转)InnoDB与MyISAM引擎区别

    MyISAM与InnoDB两者之间区别与选择,详细总结,性能对比 2015年06月25日 21:58:42 阅读数:1827更多 个人分类: mysql   1.MyISAM:默认表类型,它是基于传统 ...

  6. EasyTouch和NGUI的使用心得

    今天来写一写Unity3D中两个比较常用插件:EasyTouch和NGUI的学习心得.我用的版本分别是EasyTouch 3.1.1和NGUI 3.6.0,下面也是对这两个版本的学习心得. 1. Ea ...

  7. Eclipse导入hadoop源码

    在windows中,使用Eclipse阅读hadoop源码,首先到apache官网下载tar.gz的hadoop源码压缩文件,解压. 方法1:(hadoop技术内幕推荐) 打开Eclipse,新建ja ...

  8. php7带来的性能升级

    前言本文是一篇讲座听后+后续研究的总结. 话说当年追时髦,php7一出就给电脑立马装上了,php5和php7共存,也是立马写了个超级耗时间的循环脚本测了一番,确实php7给力很多,然后也是注意了一些新 ...

  9. c# excel如何导入到sqlserver数据库

    最近在做这个如何把excel导入到数据库中,经过多方查找,终于找到一个适合的,并且经过自己的完善可以正常使用(忘记原作者博客的链接地址了,敬请见谅) 首先是窗体的创建,文本框显示文件的路径,按钮执行操 ...

  10. 读完这一篇,字符串格式化界的“白富美”(f-strings)抱回家!

    f-strings 从Python 3.6开始,新引入了一种字符串格式化方法,称为“格式化字符串常量”(formatted string literal),简称f-strings.相比于%.str.f ...