如何在Xcode9.3.1中配置Linphone SDK?
Hey there! Let me walk you through configuring the Linphone SDK in Xcode 9.3.1— I’ve helped tons of developers troubleshoot this exact setup, so I’ll break it down into actionable steps to avoid the usual headaches.
First, make sure you have these in place:
- Xcode 9.3.1 installed and its Command Line Tools set to the same version (verify via
xcode-select -pthat it points to your Xcode 9.3.1 installation path) - Homebrew installed (it’s the easiest way to grab the build dependencies we need)
- At least 10GB of free disk space— the build process pulls and compiles a lot of heavy libraries.
Open Terminal and clone the official Linphone iOS repository via git. Do not skip the --recursive flag— trust me, this is one of the top mistakes developers make here. It pulls all the dependent submodules Linphone needs, and skipping it will lead to missing files and build failures down the line:
git clone --recursive [official Linphone iOS repository]
Navigate into the cloned linphone-iphone directory in Terminal, then use Homebrew to install the tools required for compiling the SDK:
brew install cmake pkg-config yasm nasm libtool automake
If you run into permission errors here, avoid using sudo unless absolutely necessary— instead, fix your Homebrew directory permissions (standard fixes for this are widely available in dev communities).
Now it’s time to build the actual SDK. Run the prepare script with flags tailored for Xcode 9.3.1 (which targets iOS 11.3 by default):
./prepare.py -c --enable-ios --ios-sdk=11.3
Let this run— it can take 30-60 minutes depending on your machine. Once it’s done, you’ll find the compiled SDK in the linphone-sdk/ios folder inside the repository.
Open your Xcode 9.3.1 project and follow these steps:
- Drag the
linphone-sdk/ios/lib/liblinphone.afile into your project’s "Frameworks, Libraries, and Embedded Content" section (make sure "Copy items if needed" is checked) - Add the header search path: Go to your project’s Build Settings → Search Paths → Header Search Paths, then add
$(PROJECT_DIR)/linphone-sdk/ios/include(adjust the path if you placed the repo elsewhere) and set it to Recursive - Add the library search path: In Build Settings → Search Paths → Library Search Paths, add
$(PROJECT_DIR)/linphone-sdk/ios/lib - Link required system frameworks: Under Build Phases → Link Binary With Libraries, add these frameworks (Linphone relies on them for audio, video, and telephony features):
- AudioToolbox.framework
- AVFoundation.framework
- CoreTelephony.framework
- CoreAudio.framework
- VideoToolbox.framework
- CoreMedia.framework
- Security.framework
Here are the issues I see most often with this setup:
- Missing submodules: If you forgot the
--recursiveflag earlier, rungit submodule update --init --recursivefrom the repo directory to pull in all required submodules - Undefined symbol errors: Double-check that you linked all the system frameworks listed above, and that your library/header search paths are correctly pointing to the SDK
- Xcode version compatibility: Linphone’s newer versions might not support Xcode 9.3.1. If you hit build errors, try checking out an older tag of the repo (like
3.12.0, which was built to support iOS 11 and older Xcode versions) usinggit checkout 3.12.0then re-running the prepare script - Permission issues: If the build script fails due to file access errors, make sure you’re running it as your regular user (not root) and that the repo folder has proper read/write permissions
内容的提问来源于stack exchange,提问作者Arjun Patel

