owt native ios sdk 构建

本文详细介绍了使用OWT客户端SDK构建iOS应用的过程,包括安装依赖、配置环境、克隆源码、执行gclient同步、构建不同架构的库,以及解决构建中遇到的警告和错误。特别关注了模拟器和设备上的库构建,以及与OpenSSL的集成。

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

owt native ios sdk

windows 的构建有些问题,回公司再看
我的macbook 256g的,勉为其难的构建一番ios的把
之前下周了webrtc,至少消耗了20g, 现在owt 也会下webrtc
不知道够不够用

  • 在路径 ~/tet/webrtc_build/owt-native/src 下面
  • 新建一个 .glient 文件,写入owt native 的git仓库地址

执行gclient sync

  • 自动下载 owt native 仓库
  • 自动下载需要的其他仓库
  • 成功
[4:48:25]   src/third_party/webrtc

[4:48:35] Still working on:
[4:48:35]   src/third_party/webrtc

[4:48:45] Still working on:
[4:48:45]   src/third_party/webrtc

[4:48:55] Still working on:
[4:48:55]   src/third_party/webrtc

[4:48:59] Still working on:
[4:48:59]   src/third_party/webrtc
Syncing projects: 100% (32/32), done.                
Running hooks:  43% (10/23) mac_toolchain                 
________ running 'vpython src/build/mac_toolchain.py' in '/Users/zhangbin/tet/webrtc_build/owt-native/src'
Skipping Mac toolchain installation for mac
Running hooks:  52% (12/23) clang        
________ running 'vpython src/tools/clang/scripts/update.py' in '/Users/zhangbin/tet/webrtc_build/owt-native/src'
Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Mac/clang-373424-64a362e7-1.tgz .......... Done.
Hook 'vpython src/tools/clang/scripts/update.py' took 82.84 secs
Running hooks:  65% (15/23) clang_format_mac
________ running 'download_from_google_storage --no_resume --platform=darwin --no_auth --bucket chromium-clang-format -s src/buildtools/mac/clang-format.sha1' in '/Users/zhangbin/tet/webrtc_build/owt-native/src'
0> Downloading src/buildtools/mac/clang-format...
Downloading 1 files took 49.783704 second(s)
Hook 'download_from_google_storage --no_resume --platform=darwin --no_auth --bucket chromium-clang-format -s src/buildtools/mac/clang-format.sha1' took 49.89 secs
Running hooks:  95% (22/23)                     
Hook 'download_from_google_storage --directory --recursive --num_threads=10 --no_auth --quiet --bucket chromium-webrtc-resources src/third_party/webrtc/resources' took 4309.82 secs
Running hooks: 100% (23/23) 
________ running 'vpython src/scripts/prepare_dev.py' in '/Users/zhangbin/tet/webrtc_build/owt-native/src'
Applying: Use OpenSSL for usrsctp
Applying: Use OpenSSL for libsrtp.
Applying: Remove webrtc_overrides
Applying: Fixed compile issue and disable thin archive for Linux
Applying: Fix examples path error.
Applying: Export WebRTC symbols on iOS.
Applying: Apply libjpeg_turbo fix for CVE-2018-20330 & CVE-2018-19664
Running hooks: 100% (23/23), done.
 zhangbin@pb6a80114  ~/tet/webrtc_build/owt-native/src   master  

构建 ios版本

  • 注意路径,我在src目录下做gclient sync, 下载到src目录
  • 所以owt native的代码在src/src 下
  • 在这个路径 执行python脚本
  • 这样就可以去src/src/build/下加载各种python脚本
 -  zhangbin@pb6a80114  ~/tet/webrtc_build/owt-native/src/src  ➦ e983dc8  python scripts/build.py
Done. Made 1471 targets from 225 files in 5226ms
ninja: Entering directory `out/Debug-device-arm64'
[130/2754] CC obj/third_party/opus/opus/debu

默认构建所有版本的ios库

https://github.com/open-webrtc-toolkit/owt-client-native.

You can refer to the readme doc to build it or follow bellow steps. 

1. install depot_tools and add it to path

2. build OpenSSL 1.1.0l or higher

3. clone the source code to src dir

4. Create file named .gclient under the same directory of src dir, with below contents:

solutions = [
  {
    "managed": False,
    "name": "src",
    "url": "https://github.com/open-webrtc-toolkit/owt-client-native.git",
    "custom_deps": {},
    "deps_file": "DEPS",
    "safesync_url": "",
  },
]
target_os = ["mac", "ios"]

5. run "gclient sync" command in src dir

6. run build script "python scripts/build.py --arch x64,arm,arm64 --skip_tests --ssl_root ~/Documents/OpenSSL-for-iPhone --scheme release" in src dir

 

模拟器版本

 zhangbin@pb6a80114  ~/tet/webrtc_build/owt-native/src/src  ➦ e983dc8  python scripts/build.py
Done. Made 1471 targets from 225 files in 5226ms
ninja: Entering directory `out/Debug-device-arm64'
[2754/2754] LIBTOOL-STATIC obj/talk/owt/libowt_sdk_base.a
ninja: Entering directory `out/Debug-device-arm64'
[7/7] LIBTOOL-STATIC obj/talk/owt/libowt_sdk_p2p.a
ninja: Entering directory `out/Debug-device-arm64'
[8/8] LIBTOOL-STATIC obj/talk/owt/libowt_sdk_conf.a
ninja: Entering directory `out/Debug-device-arm64'
[36/36] LIBTOOL-STATIC obj/talk/owt/libowt_sdk_objc.a
ninja: Entering directory `out/Debug-device-arm64'
[1/1] LIBTOOL-STATIC obj/talk/owt/libowt_deps.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (audio_receive_stream.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_receive_stream.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_receive_stream.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (audio_send_stream.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_send_stream.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_send_stream.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (audio_state.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_state.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_state.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (auto_correlation.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(auto_correlation.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(auto_correlation.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (base64.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(base64.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(base64.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (convert.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(convert.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(convert.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (cross_correlation.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(cross_correlation.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(cross_correlation.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (decoder_database.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(decoder_database.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(decoder_database.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (dtls_transport.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(dtls_transport.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(dtls_transport.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (encoded_frame.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(encoded_frame.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(encoded_frame.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (err.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(err.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(err.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (helpers.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(helpers.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(helpers.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (histogram.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(histogram.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(histogram.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (int128.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(int128.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(int128.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (jsep_ice_candidate.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(jsep_ice_candidate.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(jsep_ice_candidate.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (logging.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_sdk_base.a(logging.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(logging.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (moving_average.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(moving_average.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(moving_average.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (packet.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(packet.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(packet.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (packet_buffer.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(packet_buffer.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(packet_buffer.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (rtp_sender.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(rtp_sender.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(rtp_sender.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (sctp_transport.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(sctp_transport.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(sctp_transport.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (socket.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(socket.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(socket.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (splitting_filter.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(splitting_filter.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(splitting_filter.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (stream.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_sdk_base.a(stream.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(stream.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (sysinfo.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(sysinfo.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_sdk_base.a(sysinfo.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (thread.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(thread.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(thread.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (video_common.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_common.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_common.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (video_frame_buffer.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_frame_buffer.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_frame_buffer.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (video_receive_stream.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_receive_stream.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_receive_stream.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (video_send_stream.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_send_stream.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_send_stream.o) due to use of basename, truncation and blank padding
Done. Made 1509 targets from 227 files in 5366ms
Start running unit tests.
ninja: Entering directory `out/Debug-simulator-x64'
[1680/2918] CXX clang_x64/obj/buildtools/third_party/libc++/libc++/de

issue里有人遇到类似问题

  • https://github.com/open-webrtc-toolkit/owt-client-native/issues/303
Hi,

I'm really struggeling getting OWT running for iOS. I've tried building different branches and so on.

Environment:
OpenSSL version: 1.1.1d Sep 2019
gclient version: gclient.py 0.7
MacOS version: 10.15.2 Catalina
Xcode Version: 11.3.1 (11C504)
iOS test device: iPhone 7 @ iOS 13.3
Python version: 2.7.16

General
Tests fail due to sdk_info.FillXcodeVersion(settings) now requires 2 arguments. For all tests I've added None as the second parameter.

Branch master

Builds fine and tests pass.

Compile error in XCode after importing WebRTC/OWT.framework into a xcode ios project using conferencing:

XCode output
Branch 76

Compile error in XCode after importing WebRTC/OWT.framework into a xcode ios project using conferencing:

XCode output
Branch 79

Compiles, but tests fail.

Console output
Using the lib in a conferencing project results in runtime exception:

XCode output
Branch 79 (with modified .gclient file)

Changed url in .gclient to "url": "https://github.com/open-webrtc-toolkit/owt-client-native.git@origin/79" just to see if it makes a difference.

Testing failed:

Console output error only
Console output full
Using the lib anyway results in runtime error:

XCode output
Branch 4.1.x

Error during gclient sync

Console output full
Branch 4.2.x

Error during gclient sync

Console output full
Please advice, thank you.

ios demo

  • 这个issue 提到要构建 sioclient.a
  • 还需要自己构建openssl么?
With the new built libcrypto.a, libssl.a, it works.
https://github.com/x2on/OpenSSL-for-iPhone
./build-libssl.sh --version=1.1.0f --deprecated
  • demo 老说我是arm64的owt库

编译模拟器版本的

  • 根据arch默认的arm64 的,模拟器需要自己重新编译
parser.add_argument('--arch', default='arm64', dest='target_arch',
      help='Target architectures. Could be multiple values seperated by comma.')
  • 先编译一个openssl的模拟器版本?
 zhangbin@pb6a80114  ~/tet/webrtc_build/owt-native/OpenSSL-for-iPhone   master  ./build-libssl.sh 

Build options
  OpenSSL version: 1.1.1d
  Targets: ios-sim-cross-x86_64 ios64-cross-arm64 ios64-cross-arm64e tvos-sim-cross-x86_64 tvos64-cross-arm64
  iOS SDK: 13.2
  tvOS SDK: 13.2
  Number of make threads: 8
  Configure options:  no-deprecated
  Build location: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone

Downloading openssl-1.1.1d.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 8638k  100 8638k    0     0   360k      0  0:00:23  0:00:23 --:--:--  347k
Building openssl-1.1.1d for iPhoneSimulator 13.2 x86_64...
  Logfile: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/iPhoneSimulator13.2-x86_64.sdk/build-openssl-1.1.1d.log
  Configure...
  Make (using 8 thread(s))...
Building openssl-1.1.1d for iPhoneOS 13.2 arm64...
  Logfile: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/iPhoneOS13.2-arm64.sdk/build-openssl-1.1.1d.log
  Configure...
  Make (using 8 thread(s))...
Building openssl-1.1.1d for iPhoneOS 13.2 arm64e...
  Logfile: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/iPhoneOS13.2-arm64e.sdk/build-openssl-1.1.1d.log
  Configure...
  Make (using 8 thread(s))...
Building openssl-1.1.1d for AppleTVSimulator 13.2 x86_64...
  Logfile: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/AppleTVSimulator13.2-x86_64.sdk/build-openssl-1.1.1d.log
  Configure...
  Make (using 8 thread(s))...
Building openssl-1.1.1d for AppleTVOS 13.2 arm64...
  Logfile: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/AppleTVOS13.2-arm64.sdk/build-openssl-1.1.1d.log
  Configure...
  Make (using 8 thread(s))...
Build library for iOS...

=====>iOS SSL and Crypto lib files:
/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/lib/libssl.a
/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/lib/libcrypto.a
Build library for tvOS...

=====>tvOS SSL and Crypto lib files:
/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/lib/libssl-tvOS.a
/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/lib/libcrypto-tvOS.a

=====>Include directory:
/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/include/
Done.
 zhangbin@pb6a80114  ~/tet/webrtc_build/owt-native/OpenSSL-for-iPhone   master  

  • 模拟器
  • 很给力啊
  • 支持的体系结构有 arm arm64 x86 x64
ARCH_PARAM_DICT = {'arm':'device-arm32', 'arm64':'device-arm64',
    'x86':'simulator-x86','x64':'simulator-x64'}
python scripts/build.py --arch 'x64'  --ssl_root '/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/iPhoneSimulator13.2-x86_64.sdk' --scheme 'release'
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

等风来不如迎风去

你的鼓励是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值