Install for iOS
This page builds the ztk program of the Mac and the iOS runtime: the ztk program of each iOS target, which ztk bundle copies into each app. You need a Mac with Zig 0.17.0 and Xcode.
Build the runtime
When xcode-select gives the command line tools and not Xcode, set DEVELOPER_DIR:
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
git clone https://github.com/beetlebugorg/ztk
cd ztk
zig build
zig build makes zig-out/bin/ztk for the Mac. Then build the runtime of each target that you need:
| Target | Command |
|---|---|
| The Simulator on Apple silicon | zig build runtimes -Druntime-targets=aarch64-ios-simulator |
| The Simulator on an Intel Mac | zig build runtimes -Druntime-targets=x86_64-ios-simulator |
| An iPhone or an iPad | zig build runtimes -Druntime-targets=aarch64-ios |
Each runtime goes in zig-out/lib/ztk/runtime/TARGET/, where zig-out/bin/ztk finds it.
Check the install
zig-out/bin/ztk --ios examples/platform-gallery.tcl
The command opens the Simulator, installs the gallery app, and starts it. The next page, Develop, has each step of this command.