Kiwix for Apple iOS & macOS
This is the home for Kiwix apps for Apple iOS and macOS.
Download
Kiwix apps are made available primarily via the Mac App Store.
Most recent versions of Kiwix support the three latest versions of the OSes (either iOS or macOS). Older versions of Kiwix being still downloadable for older versions of macOS and iOS on the Mac App Store.
iPads & iPhones
- Download the iOS mobile app on the App Store
macOS
- Download Kiwix Desktop on the Mac App Store
- Download Kiwix Desktop DMG file
Develop
Kiwix developers use to work with cutting-edge versions of both macOS and Xcode. Continuous integration secures that the whole project still compiles on the next to last version of macOS with latest version of Xcode distributed on it.
CPU Architectures
Kiwix compiles on both macOS with x86_64 or arm64 (M1, M2, ... family).
Kiwix for iOS and macOS can run, in both cases, on x86_64 or arm64.
Dependencies
To compile Kiwix you rely on the following compilation tools:
- An Apple Developer account (doesn't require membership)
- Latest Apple Developers Tools (Xcode)
- Its command-line utilities (
xcode-select --install
) CoreKiwix.xcframework
(libkiwix and libzim)
Steps
To compile Kiwix, follow these steps:
- Put CoreKiwix/xcframework at the root of the root of code folder
- Open project with Xcode
open Kiwix.xcodeproj/project.xcworkspace/
- Change the Bundle Identifier (in Signing & Capabilities)
- Select appropriate Signing Certificate/Profile.
Compile CoreKiwix.xcframework
yourself
CoreKiwix.xcframework
is made
available for
all supported OSes and CPU architectures. But you might want to
compile this piece (C++ code) by yourself. Here follow the
instructions to build libkiwix+libzim at on the kiwix-build
repo.
The xcframework is a bundle of all libkiwix dependencies for multiple architectures
and/or platforms. The CoreKiwix.xcframework
will contain libkiwix
library for macOS archs and for iOS. You don't have to follow steps
for other platform/arch if you don't need them.
Following steps are done from kiwix-build root and assume your apple
repository is at ../apple
.
Build libkiwix
Make sure to preinstall kiwix-build prerequisites (ninja and meson).
If you use homebrew, run the following
brew install ninja meson
Make sure Xcode command tools are installed. Make sure to download an iOS SDK if you want to build for iOS.
xcode-select --install
Then you can build libkiwix
git clone https://github.com/kiwix/kiwix-build.git
cd kiwix-build
# [iOS] build libkiwix
kiwix-build --target-platform iOS_arm64 libkiwix
kiwix-build --target-platform iOS_x86_64 libkiwix # iOS simulator in Xcode
# [macOS] build libkiwix
kiwix-build --target-platform macOS_x86_64 libkiwix
kiwix-build --target-platform macOS_arm64_static libkiwix
Create fat archive with all dependencies
This creates a single .a
archive named merged.a
(for each
platform) which contains libkiwix and all it's dependencies. Skip
those you don't want to support.
libtool -static -o BUILD_macOS_x86_64/INSTALL/lib/merged.a BUILD_macOS_x86_64/INSTALL/lib/*.a
libtool -static -o BUILD_macOS_arm64_static/INSTALL/lib/merged.a BUILD_macOS_arm64_static/INSTALL/lib/*.a
libtool -static -o BUILD_iOS_x86_64/INSTALL/lib/merged.a BUILD_iOS_x86_64/INSTALL/lib/*.a
libtool -static -o BUILD_iOS_arm64/INSTALL/lib/merged.a BUILD_iOS_arm64/INSTALL/lib/*.a
If you built macOS support for both archs (that's what you want unless you know what you're doing), you need to merge both files into a single one
mkdir -p macOS_fat
lipo -create -output macOS_fat/merged.a \
-arch x86_64 BUILD_macOS_x86_64/INSTALL/lib/merged.a \
-arch arm64 BUILD_macOS_arm64_static/INSTALL/lib/merged.a
Add fat archive to xcframework
xcodebuild -create-xcframework \
-library macOS_fat/merged.a -headers BUILD_macOS_x86_64/INSTALL/include \
-library BUILD_iOS_x86_64/INSTALL/lib/merged.a -headers BUILD_iOS_x86_64/INSTALL/include \
-library BUILD_iOS_arm64/INSTALL/lib/merged.a -headers BUILD_iOS_arm64/INSTALL/include \
-output ../apple/CoreKiwix.xcframework
You can now launch the build from Xcode and use the iOS simulator or your macOS target. At this point the xcframework is not signed.