下载编译webrtc for ios

本文档提供了详细的步骤说明如何下载并编译WebRTC源码。首先需要安装git和depot_tools工具,然后通过gclient配置WebRTC源码仓库。针对iOS平台,还需要额外配置目标操作系统参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

【官网】

http://www.webrtc.org/reference/getting-started

【步骤】

参照官网的步骤,要下载和编译源码,需要安装两个工具 depot_tools 和 git

1. 安装git

http://www.cnblogs.com/ccdev/archive/2012/09/12/2682098.html

 

2.安装depot_tools

a 启动终端,当前路径为:/Users/xxx : 

b git 命令获取depot_tools:git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

c 把depot_tools 设置到PATH中

   vi ~/.bash_profile

   export PATH="$PATH":`pwd`/depot_tools

 按“ESC”,输入 ":wq!" 保存退出;

  source ~/.bash_profile   使PATH设置生效

  echo $PATH 查看设置是否生效。

c可以简化为export PATH="$PATH":`pwd`/depot_tools

echo $PATH 查看设置是否生效。

3. 获取WebRTC 源码。

a 新建WebRTC文件夹,并在终端进入该文件夹

b 执行命令 : 

  gclient config http://webrtc.googlecode.com/svn/trunk

我们在当前目录下可以看到.gclient文件,若看不到这个文件则运行以下命令:(显示Mac隐藏文件的命令)

defaults write com.apple.finder AppleShowAllFiles  YES

在.gclient文件中添加以下内容:
target_os = ['ios']
target_os_only = True

gclient sync --force

gclient runhooks --force

gclient sync过程中可能遇到错误:

Error: Command download_from_google_storage --directory --recursive --num_threads=10 --no_auth --bucket chromium-webrtc-resources trunk/resources returned non-zero exit status 1

解决方法:

注释掉

trunk/DEPS文件里

{
# Download test resources, i.e. video and audio files from Google Storage.
"pattern": "\\.sha1",
"action": ["download_from_google_storage",
"--directory",
"--recursive",
"--num_threads=10",
"--no_auth",
"--bucket", "chromium-webrtc-resources",
Var("root_dir") + "/resources"],
},

以上可以编译成功MAC的,ios的不行。

运行:

./build/gyp_chromium --depth=.  -DOS=ios -Dinclude_tests=0 -Denable_protobuf=0 -Denable_video=0 webrtcjingle.gyp
可以生成ios的,但是编译还有一个错误未解决,待续...

 

 

转载于:https://www.cnblogs.com/tkppain/p/3616660.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值