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=8090
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 = 8090

终端设置变量

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. Linux下boost库的编译、安装详解

    1.下载源文件 去官网下载:http://www.boost.org/ 这里下载最新版本 wget https://dl.bintray.com/boostorg/release/1.64.0/sou ...

  2. Android源码的下载,编译,刷机

    上篇说到<framework开发环境搭建>,本篇继续介绍Android源码的下载.编译.刷机 先贴上Android源码官网地址:https://source.android.com/doc ...

  3. Linux 下 离线下载服务部署 CCAA的安装使用

    Linux 下 离线下载服务部署 CCAA的安装使用 我的小站.Github CCAA 是服务器离线下载解决⽅案包,组件包含了Aria2 提供离线下载,ccaa_web⽀撑AriaNg运⾏, Aria ...

  4. Linux下C/C++程序编译链接加载过程中的常见问题及解决方法

    Linux下C/C++程序编译链接加载过程中的常见问题及解决方法 1 头文件包含的问题 报错信息 该错误通常发生在编译时,常见报错信息如下: run.cpp:2:10: fatal error: dl ...

  5. 在Linux下巧下载

    个人感觉在Linux下,下载有时候是个问题.虽然现在已经完全脱离Windows了,可是总是对thunder没有Linux版本这个事情耿耿于怀--当初我在Win下时可是迅雷看看的忠实fans. 相信大家 ...

  6. Android Linux下的常用命令行

     安卓下面有个软件叫终端模拟器,其实就是Linux下的命令行,使用这些命令能有效处理问题. 基本知识 "/",这个英文字母斜杠指的是根目录,类似Windows的C:\,但是Li ...

  7. android 例子源码_AOSP系列文章(一)-Android系统源码下载和编译

    前期准备 从这里开始,我们就去做android系统的修改,相信会有更多的同学有更多的玩法. android是开源的,在源代码里没有秘密. 同学们可以去修改系统,做成自己喜欢的样子.做汽车的车机,到家里 ...

  8. Android,linux常用资源下载链接

    1 uboot 源码下载: http://www.denx.de/wiki/U-Boot,该网址上有关于uboot的源码和文档 2 交叉编译工具下载: GNU Toolchain for ARM Pr ...

  9. Android Linux下开发环境搭建

    开发环境--这个没有要求你一定得在什么系统下开发,你对哪个环境熟悉就用哪个. 如果习惯Windows的话,那在Windows下开发:如果对Linux比较熟,那你就用Linux. 不过,话说回来,Lin ...

最新文章

  1. 图像配准----RANSAC
  2. 机器学习Tips:关于Scikit-Learn的 10 个小秘密
  3. Linux_系统破坏性修复实验
  4. mysql主从复制原理 简书_mysql主从复制,从原理讲到安装配置,全干货
  5. esp32 rtc 时钟设置不对_「STM32」实时时钟(RTC)实验
  6. exec 执行结果_php执行系统外部命令的4种方法
  7. Oracle中NUMBER类型如果不指定长度和小数点精度默认是多长
  8. BZOJ2199: [Usaco2011 Jan]奶牛议会
  9. easyui combobox java_Easyui的combobox实现动态数据级联效果
  10. 标准布局类(11中布局类)
  11. python locals_Python locals()
  12. 在线教育公司的硬件雄心:1秒查词,网易有道发布词典笔二代
  13. Ignite基础知识原理
  14. 安全帽检测/人脸识别系统国标GB28181协议云服务EasyGBS搭建智慧工地 助力智慧建筑生态圈
  15. 计算机科学类专升本复习之“C语言结构体”详解(初稿)
  16. 获取指定年份的工作日和节假日后导入Excel
  17. 如何updateR的version
  18. 简析客户流失的原因及解决办法
  19. Android实现LED数字显示
  20. 炫龙新笔记本安装Ubuntu1804遇到的问题

热门文章

  1. 在xml文件的Preference标签中,用extra给intent标签加参数
  2. nginx 报错 99: Cannot assign requested address
  3. 自动化Cobbler安装
  4. c++ STL平常练习-1
  5. 几个免费高质量图标搜索引擎。
  6. lua cocos 动画回调
  7. CodeForces - 1341D Nastya and Scoreboard(dp+贪心)
  8. HYSBZ - 1208 宠物收养所(Splay)
  9. 洛谷 - P1036 选数(递归)
  10. POJ - 1847 Tram(最短路)