WebRTC ios平台编译

配置代理环境:

git config --global http.proxy http://127.0.0.1:1087

git config --global https.proxy http://127.0.0.1:1087

export http_proxy=http://127.0.0.1:1087

export https_proxy=http://127.0.0.1:1087

curl ip.cn 检查是否设置成功

参考文献:

https://www.jianshu.com/p/c49da1d93df4

mkdir webrtc_build

cd webrtc_build

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

把depot_tools 设置到PATH中:echo "export PATH=$PWD/depot_tools:$PATH" > $HOME/.bash_profile

使PATH设置生效:source $HOME/.bash_profile

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

设置要编译的平台到环境变量中:export GYP_DEFINES="OS=ios"

1、mkdir webrtc

2、fetch --nohooks webrtc

3、gclient sync

设置 gclient 代理,原因是 gclient 无法使用 $HTTP_PROXY 设置代理,而要使用 .boto 文件来设置。

export NO_AUTH_BOTO_CONFIG=/home/webrtc_build/.boto # 可以写在 .bashrc 里

echo -e "[Boto]\nproxy = 10.211.55.2\nproxy_port = 1087" > /home/webrtc_build/.boto

进入WebRTC源码文件:cd src

根据需要编辑构建配置,编译iOS系统,设置为target_os="ios",编译iOS真机,target_cpu为"arm"或"arm64",编译iOS模拟器,target_cpu="x64",如:

gn gen out/ios_64 --args='target_os="ios" target_cpu="arm64"' gn gen out/ios_sim --args='target_os="ios" target_cpu="x64"'

开始编译:ninja -C out/ios_64 AppRTCMobile

使用脚本:

src/tools_webrtc/ios/build_ios_libs.sh

使用xcode编译

gn gen out/ios --args='target_os="ios" target_cpu="arm64"' --ide=xcode

最后的目录结构如下:

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容