-
Notifications
You must be signed in to change notification settings - Fork 29
iOS SDK 3.x Framework Size Reduction
This guide provides steps to reduce the size of the iOS SDK by removing certain components that may not be essential for your use case. By following these instructions, you can optimize the SDK size by eliminating files related to specific features.
First, add the Webex SDK to your project using CocoaPods. Use the following command in your Podfile
:
# Webex SDK - Webex Calling flavor
pod 'WebexSDK/Wxc','~> 3.13.0'
Then, run the pod install command to install the pods.
1. Navigate to the wbxaecodec.xcframework directory:/Pods/WebexSDK/Frameworks/wbxaecodec.xcframework/ios-arm64/wbxaecodec.framework
2. Delete the ce_codec_lib_exports_723b8c1e_package_b1_v5.bin file:
* This file is part of the Xcodec, an AI-based audio codec that provides better audio quality in high packet loss networks. It does not support PSTN calls.
* Removing this file will result in the AI codec not being able to provide enhanced audio quality for non-PSTN calls.
* **Size Gain:** Approx. 23MB per architecture.
1. Navigate to the WebexSDK.xcframework directory:/Pods/WebexSDK/Frameworks/WebexSDK.xcframework/ios-arm64/WebexSDK.framework
2. Delete the following files:
• PortraitSeg.mlmodelc
• PortraitSegNew.mlmodelc
• wseFilter.metallib
* These files are used for the Virtual Background feature.
* Removing these files will result in the Virtual Background feature stopping working.
* **Size Gain:** Approx. 7MB per architecture.
After performing the above steps, the above directories should look like this:
- /Pods/WebexSDK/Frameworks/wbxaecodec.xcframework/ios-arm64/wbxaecodec.framework
- /Pods/WebexSDK/Frameworks/WebexSDK.xcframework/ios-arm64/WebexSDK.framework
By removing both the AI codec and Virtual Background files, you can achieve a total size reduction of approximately 30MB for one architecture (e.g., arm64).
By following these steps, you can significantly reduce the size of the iOS SDK for the Webex Calling flavor. However, be aware of the trade-offs, such as the loss of enhanced audio quality for non-PSTN calls and the Virtual Background feature. This optimization is particularly suited for specific use cases where these features are not required, allowing for a more streamlined and efficient application.
NOTE: All frameworks are stripped from v3.7 onwards.
Webex iOS SDK comes with both iPhoneOS (arm64) and Simulator (x86_64) architectures to test it on both simulator and device while development but when the app is uploaded to the App Store only arm64 architecture is uploaded which is automatically taken care by cocoapods. If you wish to not use cocoapods to manage your dependencies please refer strip-architectures.sh script to remove the x86_64 architecture at the time of releasing your app.
- WebexSDK.framework (v3.6.0) size: 486MB
- WebexBroadcastExtensionKit.framework (v3.6.0) size: 2MB
To reduce the size of framework, follow the given steps:
- Navigate to frameworks folder inside Pods
cd /Pods/WebexSDK/Frameworks
- Use following command to remove the debug symbols
strip -N WebexSDK.framework/WebexSDK
After removing dSym you should see the size of frameworks reduced by more than half.
- WebexSDK.framework (v3.6.0) size: 205MB
- WebexBroadcastExtensionKit.framework (v3.6.0) size: 1MB
NOTE: For comparing size of Webex iOS SDK, please compare the TestFlight build so it only contains 1 architecture (arm64). Universal binary supports 2 architectures (arm64 and x86_64) currently.