Generate and publish CocoaPods-compatible Google ML Kit binaries that can link on Apple Silicon iOS simulators.
This repository exists for projects that still depend on older Google ML Kit
binary pods whose official frameworks do not contain a usable
arm64-apple-ios-simulator slice. The generator downloads the official
CocoaPods podspecs and source archives, keeps the official file layout, and
converts selected static frameworks into xcframeworks with an additional
arm64-simulator slice.
The current configs patch these pods:
MLImageMLKitCommonMLKitVision
The barcode scanner pod itself is kept as the official framework:
MLKitBarcodeScanning
GoogleMLKit is included because its subspecs and headers are still required by
consumers such as GoogleMLKit/BarcodeScanning.
maincontains the generator scripts and version configs.- Version commits contain generated CocoaPods payloads at the repository root.
- Consumers should pin a generated commit, not a branch name.
The generated output directories on main are ignored:
v8/v9/
These directories are local build output only. They are used to create version commits.
Pin the generated commit in your Podfile.
Do not use :branch => 'v9' for application dependencies. Version branches may
be regenerated; a commit is reproducible.
Current v9 generated commit:
mlkit_patch = {
:git => 'https://github.com/devcxm/MLKit-Arm64Sim-Patches.git',
:commit => 'dbcd2f765b068298e6322a53d3a494ba2e47a41d'
}
pod 'GoogleMLKit/BarcodeScanning', **mlkit_patch
pod 'MLKitBarcodeScanning', **mlkit_patch
pod 'MLKitCommon', **mlkit_patch
pod 'MLKitVision', **mlkit_patch
pod 'MLImage', **mlkit_patchThen run:
pod installFor local testing before publishing a generated commit, point CocoaPods at the generated output directory:
local_mlkit_path = '/path/to/MLKit-Arm64Sim-Patches/v9'
pod 'GoogleMLKit/BarcodeScanning', :path => local_mlkit_path
pod 'MLKitBarcodeScanning', :path => local_mlkit_path
pod 'MLKitCommon', :path => local_mlkit_path
pod 'MLKitVision', :path => local_mlkit_path
pod 'MLImage', :path => local_mlkit_pathThis is useful when changing the patch scripts or testing a new ML Kit version. Do not commit local absolute paths to application projects.
Generated pods can inject a compile-time guard:
python3 generate_official_patched_pods.py mlkit_v9_config.json --release-guard yesWhen enabled, the generated podspecs add:
-include "${PODS_ROOT}/Headers/Public/GoogleMLKit/MLKitReleaseBuildGuard.h"
The guard header fails compilation when DEBUG is not defined. This makes the
patched binaries difficult to ship accidentally in non-Debug builds.
If you intentionally want generated pods without this guard:
python3 generate_official_patched_pods.py mlkit_v9_config.json --release-guard noFrom the repository root:
python3 generate_official_patched_pods.py mlkit_v9_config.json --release-guard yesThe script will:
- Download official podspec JSON files from the CocoaPods Specs repository.
- Read each podspec's
source.http. - Download the official Google binary archives.
- Remove simulator
EXCLUDED_ARCHSsettings from generated podspecs. - Convert selected frameworks into xcframeworks.
- Write generated pods into the configured output directory.
The v9 config currently contains:
GoogleMLKit 9.0.0
MLImage 1.0.0-beta8
MLKitCommon 14.0.0
MLKitVision 10.0.0
MLKitBarcodeScanning 8.0.0
The v8 config currently contains:
GoogleMLKit 8.0.0
MLImage 1.0.0-beta7
MLKitCommon 13.0.0
MLKitVision 9.0.0
MLKitBarcodeScanning 7.0.0
The old version-branch workflow is still useful as a publishing mechanism:
mainstores scripts and configs.v8orv9stores generated pod payloads at the repository root.- Application projects should reference the generated commit hash.
In other words, branches are for maintainers; commits are for consumers.
This project does not modify ML Kit source code. It repackages official binary pods into a simulator-linkable layout for local development on Apple Silicon.
Only use this if you understand the risk of repackaging third-party binaries. Prefer official Google releases whenever they support your target simulator architecture.