The instructions is successfully tested on this build environment:
- Apple M4 Pro
- macOS 15.1.1 (24B2091)
- Xcode 16.1
(Build time 26m 3.86s)
-
Clone the repository
git clone --no-checkout [email protected]:opencv/opencv.git
-
Checkout the specific commit
cd opencv git checkout 96dab6ba7181d2de71e014e750354b7111d10dac
-
Create build directory
cd .. mkdir build-opencv
-
Build
python3 ../opencv/platforms/apple/build_xcframework.py \ --out . \ --without=video \ --iphoneos_archs=arm64 \ --iphonesimulator_archs=arm64,x86_64 \ --iphoneos_deployment_target=17 \ --disable-bitcode \ --build_only_specified_archs
-
Zip and Split
zip -r opencv2.xcframework.zip opencv2.xcframework split -b 50000000 -d opencv2.xcframework.zip opencv2.xcframework.zip.