App size optimization

Updated

Reduce the size of apps that integrate Agora SDK

Reducing the app size is of great significance in improving user experience. A smaller package size means that users consume less bandwidth and time to download the app. Consider the following use-cases where app size optimization is critical:

  • There are strict requirements on the size of the app. For example, running the app on smart wearable devices with limited storage space.

  • The target user group of the app is located in underdeveloped areas. The poor network connectivity causes the app download time to be too long.

This page shows you how to optimize the size of apps with integrated Video SDK.

Use the Lite SDK

Since version 4.4.0, Agora offers a Lite SDK that provides basic audio and video call functions in a smaller package size. If you only need to implement basic audio and video call functions, integrate the Lite SDK. For details see SDKs.

The Lite SDK includes only the following extensions:

  • Video encoding extension
  • Video decoding extension

Other extensions and related functions in the Extension list are not supported.

Use the Voice SDK

Video SDK supports both audio and video functions, and the package size is large. If you only need to use audio features, best practice is to integrate the Voice SDK. For details, see Voice SDK Quickstart.

Remove unnecessary extensions

Video SDK provides optional extension dynamic libraries. The name of the extension is suffixed with extension. See the extension list for details on the function and size of the extensions. Refer to the following ways to exclude these extensions to reduce the size of the app.

Delete extensions when integrating using CocoaPods

When integrating the iOS or macOS SDK through CocoaPods, use the subspecs field in the Podfile to specify the dynamic libraries you need to integrate. This excludes extensions you do not need. For details about the corresponding relationship between dynamic libraries and subspecs field, see subspecs field.

Refer to the following samples to use all, none, or some extensions:

Use all extensions

# platform :ios, '9.0'
target 'Your App' do
  pod 'AgoraRtcEngine_iOS', '4.3.1'
end

Don

# platform :ios, '9.0'
target 'Your App' do
  pod 'AgoraRtcEngine_iOS', '4.3.1', :subspecs => ['RtcBasic']
end

Use some extensions

# platform :ios, '9.0'
target 'Your App' do
  pod 'AgoraRtcEngine_iOS', '4.3.1', :subspecs => ['RtcBasic', 'AINS', 'AudioBeauty']
end

When using the above pod command, make sure that the SDK version you specify includes the extension you have selected, and that the subspecs field is correct, otherwise a pod installation error is reported. For example, if you use pod 'AgoraRtcEngine_iOS', '4.0.0', :subspecs => ['RtcBasic', 'AgoraRtcAINS'], an error is reported.

Reference

This section contains content that completes the information in this page, or points you to documentation that explains other aspects to this product.

Extension list

Refer to the following information for an introduction to each Video SDK extension and the increase in the size of your app after integration.

The information in this section is based on version 4.4.0 of the Video SDK.

Integrating extensions into your project

When integrating the iOS/macOS SDK through CocoaPods, you can use the subspecs field in the Podfile to specify the dynamic libraries you need to integrate to exclude the extensions you don't need to use. The correspondence between dynamic libraries and subspecs fields is detailed in the following table:

iOS Video SDK

Dynamic LibraryCategorysubspecs field
  • AgoraRtcKit.xcframework
  • Agorafdkaac.xcframework
  • AgoraSoundTouch.xcframework
  • Agoraffmpeg.xcframework
  • video_dec.xcframework (added since v4.6.2)
  • AgoraCore.xcframework (renamed to aosl.xcframework since v4.3.0; dependency since v4.5.0, see AgoraInfra_iOS)
RequiredRtcBasic
AgoraAiNoiseSuppressionExtension.xcframeworkOptionalAINS
AgoraAiNoiseSuppressionLLExtension.xcframeworkOptionalAINSLL (≥ v4.4.0)
AgoraAudioBeautyExtension.xcframeworkOptionalAudioBeauty
AgoraClearVisionExtension.xcframeworkOptionalClearVision
AgoraContentInspectExtension.xcframeworkOptionalContentInspect
AgoraPvcExtension.xcframeworkOptionalPVC (< v4.1.0)
AgoraSpatialAudioExtension.xcframeworkOptionalSpatialAudio
AgoraVideoSegmentationExtension.xcframeworkOptionalVirtualBackground
AgoraAiEchoCancellationExtension.xcframeworkOptionalAIAEC (≥ v4.1.0)
AgoraAiEchoCancellationLLExtension.xcframeworkOptionalAIAECLL (≥ v4.4.0)
AgoraDrmLoaderExtension.xcframeworkOptionalDRM (≥ v4.1.0)
AgoraFaceDetectionExtension.xcframeworkOptionalFaceDetection (≥ v4.1.1)
AgoraFaceCaptureExtension.xcframeworkOptionalFaceCapture (≥ v4.3.0)
AgoraVideoQualityAnalyzerExtension.xcframeworkOptionalVQA (≥ v4.1.0)
AgoraReplayKitExtension.xcframeworkOptionalReplayKit
AgoraSuperResolutionExtension.xcframeworkOptionalSuperResolution (< v4.1.1)
  • AgoraVideoEncoderExtension.xcframework
  • video_enc.xcframework
OptionalVideoCodecEnc (≥ v4.2.0)
  • AgoraVideoDecoderExtension.xcframework
  • video_dec.xcframework
OptionalVideoCodecDec (v4.2.0 to v4.6.1)
AgoraVideoAv1EncoderExtension.xcframeworkOptionalVideoAv1CodecEnc (≥ v4.3.0)
AgoraVideoAv1DecoderExtension.xcframeworkOptionalVideoAv1CodecDec (v4.3.0 to v4.6.1)
AgoraLipSyncExtension.xcframeworkOptionalLipSync (≥ v4.3.1)

iOS Voice SDK

Dynamic LibraryCategorysubspecs field
  • AgoraRtcKit.xcframework
  • Agorafdkaac.xcframework
  • AgoraSoundTouch.xcframework
  • AgoraCore.xcframework (renamed to aosl.xcframework since v4.3.0; dependency since v4.5.0, see AgoraInfra_iOS)
RequiredRtcBasic
AgoraAiNoiseSuppressionExtension.xcframeworkOptionalAINS
AgoraAiNoiseSuppressionLLExtension.xcframeworkOptionalAINSLL (≥ v4.4.0)
AgoraAudioBeautyExtension.xcframeworkOptionalAudioBeauty
AgoraSpatialAudioExtension.xcframeworkOptionalSpatialAudio
AgoraAiEchoCancellationExtension.xcframeworkOptionalAIAEC (≥ v4.1.0)
AgoraAiEchoCancellationLLExtension.xcframeworkOptionalAIAECLL (≥ v4.4.0)
AgoraDrmLoaderExtension.xcframeworkOptionalDRM (≥ v4.1.0)

Frequently asked questions