Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable Bitcode for WebRTC iOS framework?

How can I compile WebRTC iOS framework with Bitcode enabled. Currently I have to disable the Bitcode of my project due to WebRTC framework.

like image 484
abhimanyu jindal Avatar asked Nov 19 '17 10:11

abhimanyu jindal


People also ask

Should I enable Bitcode iOS?

Since the bitcode doesn't leave Apple's servers, enabling bitcode doesn't have any security implications at all (unless you consider Apple itself as an adversary in your threat model). iXGuard, our security solution for iOS applications and SDKs, requires a bitcode-enabled build.

What is a Bitcode iOS?

Bitcode is an Apple technology that enables you to recompile your app to reduce its size. The recompilation happens when you upload your app to App Store Connect or export it for Ad Hoc, Development, or Enterprise distribution.

Does Apple require Bitcode?

Including Bitcode is optional for iOS apps, but mandatory for watchOS or tvOS apps. "Meaning you can slice/segment it out for different processors, etc. once it's in the store, reducing the payload do the user accordingly."


2 Answers

You will need to build it yourself.
Something like:

# Clone the depot tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
# Add the tools to the path
export PATH=$PATH:"`pwd`/depot_tools"
# Download the WebRTC source code
mkdir webrtc_ios
cd webrtc_ios
# This will take some time
fetch --nohooks webrtc_ios
gclient sync
# Let's start building
cd src
# Build the framework, remove --arch "arm64 x64" to build ALL architectures, including 32 bit
tools_webrtc/ios/build_ios_libs.py --bitcode --arch arm64 x64
# The framework is at out_ios_libs/WebRTC.framework

Documentation: https://webrtc.github.io/webrtc-org/native-code/ios/

like image 116
Moshe Gottlieb Avatar answered Oct 19 '22 15:10

Moshe Gottlieb


according to the official doc, you have to compile manually. More details there:

  • main page: https://webrtc.org/native-code/development/
  • iOS page: https://webrtc.org/native-code/ios/

bottom of the page (last paragraph) includes instructions to build with bitcode support:

To build the framework with bitcode support, pass the --bitcode flag to the script like so

python build_ios_libs.py --bitcode

like image 35
Dr. Alex Gouaillard Avatar answered Oct 19 '22 14:10

Dr. Alex Gouaillard