Building mpv-ios
Requirements
- macOS — Xcode's toolchain (codesigning, SDKs) only runs on macOS.
GitHub Actions'
macos-14runner satisfies this if you don't own a Mac yourself — see Testing without a Mac. - Xcode + Command Line Tools:
xcode-select --install - Homebrew packages:
brew install meson ninja pkg-config gnu-sed nasm autoconf automake libtool coreutils
git,curl(both ship with macOS)
Step 1 — Build libmpv for iOS
cd buildscripts
./download.sh
./buildall.sh --all-platforms
cd ..
./buildscripts/scripts/mpv-ios.sh build
This produces Libmpv.xcframework at the repo root. See the
Engineering Notes for the full history of
version-drift and cross-compilation issues this pipeline has been
debugged against — most future build failures will resemble one of
those.
Step 2 — Wire it into MPVKit
mkdir -p MPVKit/Frameworks
cp -R Libmpv.xcframework MPVKit/Frameworks/
Verify the package builds. Use xcodebuild, not swift build — a
Swift Package Manager limitation prevents swift build from resolving
a .binaryTarget (XCFramework) dependency for iOS at all (see Research
Log entry 16 for the full story):
cd MPVKit
xcodebuild build -scheme MPVKit -destination "generic/platform=iOS Simulator"
Step 3 — Create the Xcode app project
- In Xcode: File → New → Project → iOS → App. Interface: SwiftUI.
- Delete the generated
ContentView.swiftand defaultApp.swift. - Drag in all files from
mpv-ios-player/(check "Add to target"). - Replace the generated
Info.plistwithmpv-ios-player/Info.plist, or merge its keys into your project's existing one. - File → Add Package Dependencies → Add Local... → select the
MPVKitfolder. - Set deployment target to iOS 15.0+ (matches
project.yml). - Build & run on a physical device or simulator.
Alternatively, generate the project directly with
XcodeGen using the checked-in
project.yml:
brew install xcodegen
xcodegen generate --spec project.yml
Architecture notes
A few design decisions are worth understanding before touching the render or audio pipeline — see Architecture for the full write-up (no Metal render backend, no fontconfig, static linking throughout, and the mpv source patches applied before building).
License note
mpv and its dependency stack are GPL/LGPL-licensed (exact terms depend on which options are enabled at build time). Distributing this app means complying with those licenses — this is a licensing/legal consideration for you to review, not something this codebase resolves on your behalf.