Documentation
On this page

Configuration

Build targets and outputs

lunch products, the mka targets in order, their outputs, and the pins.

. build/envsetup.sh defines lunch and mka. lunch with no argument lists the products; lunch mapple_<device>[_single|_split]-<variant> picks one and sets TARGET_PRODUCT, TARGET_DEVICE, TARGET_BUILD_VARIANT, TARGET_INSTALL (dev, single or split) and OUT (out/target/product/<device>). The variant is userdebug (the default; a DEVELOPMENT kernel) or user (a RELEASE kernel whose loader and shim also get -DMAPPLE_RELEASE=1). See the build guide.

Targets

mka with no target runs them all in this order; a named target runs alone. $P is $OUT for the development layout and $OUT/single or $OUT/split for the others.

TargetWhat it doesOutput
ipswdownloads the pinned IPSW if it is not there and checks its size and SHA-256 once per file; running mka is your consent to the downloadout/ipsw/ (or IPSW=)
headersextracts the iPhone X’s device tree from the IPSW; makes the loader’s font header$OUT/obj/headers/d22ap.adt, font8x16.h
kernelbuilds XNU (DEVELOPMENT or RELEASE) from the common tree with the SoC layer laid over it, by darwin-xnu-build at a pinned commit; skipped when the sources are unchanged$OUT/kernel
shimbuilds the shim from a copy of mapple/loader/shim, checking its objects for absolute addresses$OUT/shim.Image
loaderbuilds mtkloader with device.conf’s loader and the layout’s flags$P/mtkloader.bin
adtruns mkadt.py with device.conf’s adt (and --resize)$OUT/<device>.adt
payloadmkpayload.py with the merged command line, checked against payload_max; then mkxnup.py packs the shim, the touch firmware item and the payload$P/sweetxnu.bin, $P/xnup.bin, $P/cmdline, $P/ilifw.bin
installerbuilds mapple-install with zig: static for the phone’s recovery ($OUT/mapple-install), and for the Mac (under $OUT/obj/installer); with the dual-boot verbs when mapple/splitboot is in the tree$OUT/mapple-install, $OUT/obj/installer/mapple-install
bootimagechains the loader and xnup.bin in front of your Android kernel; skipped without ANDROID_BOOT=$P/boot.img
userlanduserdebug only: mappled and its tools staged for the root$OUT/root/usr/libexec/mappled, private/var/root/mapple-dev/
managerthe Mapple app and its tweak loader staged for the root; skipped when mapple/manager is not in the tree$OUT/root/Applications/Mapple.app, usr/lib/mapple/
audiowith audio 1: the audio plug-in$OUT/root/System/Library/Audio/Plug-Ins/HAL/MappleAudio.driver
gpuMesa from its pinned tarball with mapple_gpu_mali’s patches, for the Mac and for iOS, then the Metal driver$OUT/root/System/Library/Extensions/MappleMTLDriver.bundle
rootimageprints the sudo command that makes the root image from the IPSW and the staged files, and stops; it passes when the image is newer than everything staged$OUT/system.img
rootsparsethe root’s allocated blocks as an Android sparse image, and their ranges for the zip’s check$OUT/root.img, $OUT/root.ranges
zipthe recovery zip (single and split products only; a split product also gets an uninstall zip)$P/mapple-<version>-<product>-PERSONAL.zip, ...-uninstall.zip

At the end mka writes $P/SHA256SUMS over the kernel, the shim, the device tree, the ranges, the loader, the payload files and the boot image.

Options

NAME=value on the mka line: IPSW=path, ANDROID_BOOT=path, KERNEL=path (a kernel already built), TOUCH_FW=path (the phone’s FW_NF_ILI7807S_*.bin into the payload), XCODE15_DEVELOPER_DIR=path, and KDKROOT in the environment.

What it needs

macOS with Xcode 15.4 (found by Spotlight, or XCODE15_DEVELOPER_DIR) beside your usual Xcode, the Kernel Debug Kit 13.5 (build 22G74) at /Library/Developer/KDKs/KDK_13.5_22G74.kdk, python3, zig, GNU rsync, zip, and sudo once for the root image.

Pins

Fetched when you build and checked against the sizes and SHA-256 in config/common.conf; a file that does not match stops the build.

WhatVersionSize (bytes)SHA-256
iOS for the iPhone X (IPSW)16.7.16 (20H392)6171035648ece1194f7e233e9109c5790a8d23a4564a10a254e15ec5b09978a343265568fb
Mesa26.2.668703420b9436b3e1a8be76fbd4823dc884f90596ab7c6ac5e1867a305e66ffccfb31a92
zlib1.3.115127919a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23

The kernel build uses darwin-xnu-build at commit 663906528d1cd5ea8fde7de6f16de73db9511549, with macOS 13.5 as the target version. The IPSW’s address is in config/common.conf.

Source: envsetup.sh, core/mka.sh of mapple_build at f7431bb; config/common.conf of mapple_vendor at 7d10027.

Applies to realme 8i (spaced), release 1 · Updated 15 November 2026