【官网】html
http://www.webrtc.org/reference/getting-startedios
【步骤】git
参照官网的步骤,要下载和编译源码,须要安装两个工具 depot_tools 和 gitweb
1. 安装gitbash
http://www.cnblogs.com/ccdev/archive/2012/09/12/2682098.htmlapp
2.安装depot_toolside
a 启动终端,当前路径为:/Users/xxx : svn
b git 命令获取depot_tools:git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git工具
c 把depot_tools 设置到PATH中ui
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的,可是编译还有一个错误未解决,待续...