ZOYKU火线榜

joshuaswarren/omarchy-apple-dev技术文档

Build and deploy iOS SwiftUI apps from Omarchy Linux on any PC (x86_64 or Apple Silicon), no Xcode required

多语言回退提示:当前仓库原作者暂未发布本地化文档,已为您无缝切换至官方英文原版(English),排版及代码实例完整保真。
极速安装
pip install omarchy-apple-dev

Build and deploy iOS apps on Omarchy Linux (Apple Silicon and x86_64)

The projects

Part of the Omarchy on Apple Silicon ecosystem:

  • omarchy-mlx — MLX on the Apple GPU under Linux, and Core ML models on the Neural Engine.
  • omarchy-ane — Linux driver for the Apple Neural Engine: DRM kernel modules and libane.
  • mil-hwx-compiler — compiles Core ML MIL into ANE programs on Linux (M1/M2 targets).
  • metal2vk — translates Metal compute kernels to Vulkan SPIR-V with open tools.
  • mesa-1 — Mesa fork carrying the Honeykrisp Vulkan driver work for Apple silicon.
  • omarchy-cluster — one local model split across Macs on macOS and Omarchy Linux.
  • omarchy-egpu — eGPU setup, diagnostics and measured local-inference results on Omarchy Linux.
  • ane-linux-experiments — Neural Engine on Linux: verified primitives, receipt-backed macOS parity.
  • coreglass — profiler that shows where local inference loses speed on Apple Silicon Linux.
  • omarchy-inference-fleet — reproducible, pinned single-node MLX inference baselines.
  • remnic — local-first memory and context for AI agents.
  • Platform upstream: omarchy-mac — Omarchy on Apple Silicon Macs.

SwiftUI and Flutter apps built on Omarchy Linux and installed on a physical iPhone: over USB, or over your tailnet on iOS 27. No Xcode and no macOS in the loop. A free Apple ID covers device installs; a paid developer account adds TestFlight and the App Store.

What was verified, and when

Date What ran Evidence
2026-10-03 Fresh-user install on x86_64 Arch: Swift 6.4.0, xtool 1.20.1, Xcode 27.0 SDK FINDINGS.md item 22, receipt
2026-10-23 xtool 1.23.0 with made-up credentials: password auth changed from -80045 to Apple's invalid-credential -20970. No real-Apple-ID sign-in, SDK build, device install or LLDB loop on this version receipt
2026-10-25 Fresh x86_64 Arch install through the SDK-download step, plus interrupted-xtool-install repair with Swift 6.4.1. No SDK build, device install or LLDB loop CHANGELOG.md, xtool installs again on a fresh machine
2026-09-09 Device install and the LLDB loop on an M1, with Swift 6.3.3, xtool 1.19.0 and the iOS 26.5 SDK. Not re-run on the 6.4 set FINDINGS.md, Working sequence
2026-09-15 x86_64 flow confirmed by a community report (Jon Kinney); the same flow runs a real client project on a Framework Desktop with an iPhone 16 none
Tool Version Source
Swift 6.4.1 in the latest fresh-install check AUR swift-bin
xtool main (a2875dd, with xtool-org/xtool#375, #430, #422 and #432) + the 11 fork commits (pin 7cc56c3, fork tag omarchy-main-pin) built from source by the installer
pymobiledevice3 latest from PyPI at install time venv
cryptography 42 or later; a dependency of pymobiledevice3, in the same venv. tools/asc.py identity and test-identity stop with a message naming the version if it is older venv
LLDB bundled with the installed Swift toolchain swift-bin
iOS SDK iPhoneOS 27.0 Xcode 27.0 (full mode); in no-Xcode mode, link stubs cut from a connected iPhone or Apple's public iOS update

Two install modes

./install-toolchain.sh asks which mode to use when it runs in a terminal. Pass --mode full or --mode no-xcode to skip the question; the choice is remembered in ~/.config/omarchy-apple-dev/mode. Without a terminal and without a choice it uses full.

full (Xcode download) no Xcode download (experimental)
Languages Swift, SwiftUI, Objective-C, C, C++ Objective-C, C and Swift (standard library, async/await, Foundation), plus a small SwiftUI subset (App, WindowGroup, Text, VStack, Button, @State)
Flutter release builds, any plugin whose source builds release builds with Objective-C plugins and the Swift plugins shared_preferences and url_launcher
System frameworks everything in the Xcode SDK Foundation, UIKit, CoreGraphics, QuartzCore, CoreFoundation, UserNotifications, libc; a short list, growing
Extensions, widgets, macOS apps yes not yet
TestFlight and App Store yes, with a paid account TestFlight upload of Flutter apps, with a paid account (sdk-free/ship.sh --upload); App Store review not tried
Needs the Xcode archive from Apple (about 3 GB of it is used) an iPhone only to run the apps; setup reads a connected iPhone or Apple's public iOS update download and uses about 7 GB of temporary disk

What has run on an iPhone and what only builds (no-Xcode mode): docs/TEST-MATRIX.md. Mode internals: sdk-free/README.md.

Requirements

  • Omarchy or another Arch-based Linux on Apple Silicon or x86_64. Other distributions: Ubuntu 24.04 and Fedora 44 have verified runs, NixOS a reported one. See docs/DISTROS.md.
  • An iPhone and a USB data cable.
  • A free Apple ID for one download from Apple: the Xcode.xip from developer.apple.com (full mode). The download works from any OS; no Mac, no macOS and no Xcode install anywhere. The iOS SDK artifacts exist only inside Apple's Xcode distribution, so this one download cannot be automated away.
  • For TestFlight and App Store: a paid developer account.

Version matching matters. The SDK must come from an Xcode whose Swift matches the installed swift-bin: Xcode 27 for swift-bin 6.4, Xcode 26 for 6.3 (FINDINGS.md items 16 and 22). The installer prints the matching Xcode when it stops at the SDK step.

Install

New here? GETTING-STARTED.md walks from the Omarchy Install menu to a TestFlight upload. On Omarchy, Install > Development > iOS runs these steps for you.

git clone https://github.com/joshuaswarren/omarchy-apple-dev
cd omarchy-apple-dev
./install-toolchain.sh

The script installs Swift and builds xtool, then stops at the SDK step and names the Xcode to download. Download that .xip from https://developer.apple.com/download/all/?q=Xcode and re-run:

XCODE_XIP=/path/to/Xcode.xip ./install-toolchain.sh

swift sdk list should print darwin when the SDK is registered. Re-run the installer after toolchain changes: it checks the SDK stamp, not just that name.

  • No sudo? ./install-toolchain.sh --user-only with a swift.org toolchain on PATH.
  • Already have a Mac with a matching Xcode? Route B in install-toolchain.sh step 5 copies just the ~3 GB of SDK pieces instead of the whole .xip. Optional; the .xip route needs no Mac.
  • After a Swift toolchain swap (mise/asdf/manual), run ./install-toolchain.sh --repair. See GETTING-STARTED.md, Toolchain swaps.

Optional Tomacco frontend

Tomacco is a separate application. This repository does not download, bundle, install, or start it. The optional registration accepts the evaluated Tomacco 1.0.0 x86_64 binaries from source commit 84f877eb34fb202384010afb5f54c0da7fea892f; other builds fail the hash check. Keep its dependencies, license notices, and corresponding source available under its own installation procedure.

After installing that version separately, run these commands from this checkout:

python3 tools/tomacco-frontend.py enable "$HOME/.local/lib/tomacco"
python3 tools/tomacco-frontend.py status

This adds iOS development (Tomacco) to the application menu. It does not change Install > Development > iOS or either toolchain install mode. The menu command checks both binary hashes again before launch. It preserves your HOME and XDG directories, and uses the PATH from registration. Keep this checkout in place; register again if you move it.

Registration writes each file through an exclusive temporary file in the same directory. It sets permissions before publication and uses atomic replacement. If publication stops between config and menu updates, rerun enable or use disable. Recovery accepts the original menu file only while its identity, timestamps, size and hash remain unchanged. Restoring old bytes after replacement does not restore ownership. Unrelated or edited entries stop the operation.

Use Tomacco's ordinary xtool project workflow with the existing toolchain and sign-in. Existing explicit Tomacco executable settings still take precedence. Do not use ios.toolkit_install: that separate upstream adapter creates a private toolkit and HOME. Its Flutter, Xcode-import and store adapters are not connected to this registration. No device, SDK build, sign-in, or desktop rendering has been qualified by the registration tests.

To remove only this registration:

python3 tools/tomacco-frontend.py disable

Removal preserves Tomacco, its data, the toolchain, SDKs, and credentials. It refuses to overwrite or remove a desktop entry you changed. This option supplies no Apple SDK, firmware, emulator, or Apple-terms acceptance. Optional registration does not establish permission to use or distribute Apple materials. No emulator-engine distribution is approved here.

First app

xtool new HelloOmarchy
cd HelloOmarchy
xtool dev run

xtool dev build alone produces xtool/HelloOmarchy.app (arm64 Mach-O). An existing Xcode project: tools/xcodeproj2xtool.py App.xcodeproj writes an xtool adapter next to it, with SourceKit-LSP support. It takes the settings of the Release configuration; --configuration Debug takes another one's (bundle ID, Info.plist values, compilation conditions). A dependency whose manifest tests the build machine (RxSwift drops RxCocoa when it is not a Mac) gets answered as on a Mac by tools/host-manifests.py omarchy-xtool. See GETTING-STARTED.md, step 2.

Run on your iPhone

Plug the iPhone in, tap Trust when prompted, then, from the project directory:

./device-run.sh

device-run.sh pairs, installs and launches the app. --lldb attaches LLDB without root. With --rsd or --over-tailnet, --console [SECONDS] streams the app's own output and --symbolicate pulls and resolves crash reports (docs/CRASH-SYMBOLICATION.md).

Use USB for initial pairing. The Linux wireless RemotePairing path is blocked on iOS 26 (FINDINGS.md item 17). On iOS 27, pair once over USB and copy the pairing record to the host on your tailnet. With Wi-Fi and Tailscale connected on the phone, that host can install, launch, screenshot and read logs without a cable (docs/OVER-TAILNET.md, measured 2026-10-10).

Pairing records are device credentials. Keep them private and copy them only to hosts you trust.

Running Omarchy in the tryomarchy.com Windows VM? Do the Windows VM iPhone USB setup first. Bare-metal installs do not need it.

Kotlin Multiplatform apps

Gradle skips the iOS framework of a Kotlin Multiplatform project on Linux; kmp/build-framework.sh links it from the klibs Gradle builds, and the Swift app around it builds as an xtool package with the framework as a binary target. Verified on x86_64 with a Compose Multiplatform app. Details: kmp/README.md.

Flutter apps

Verified on x86_64 with Flutter 3.47.6 (receipt). Release mode, arm64 device builds only: no debug, hot reload or simulator. Plugins must ship a Package.swift. aarch64 hosts are untested. Details: flutter/README.md.

./install-toolchain.sh                    # once, as for any app in this repo
sudo pacman -S --needed llvm rsync        # the two tools the Flutter build calls
flutter/setup.sh                          # once per Flutter version: ~7 GB, 5-12 min

flutter create --platforms ios counter    # or use your own Flutter app
flutter/build.sh counter                  # -> build/ios-linux/Runner.ipa (unsigned), 29 s for the template

flutter/build.sh --install counter        # free Apple ID route: xtool signs and installs

For a signed development .ipa for a specific device: tools/provision-dev.py --bundle-id <id> then tools/sign-dev.sh <App>.app out.ipa. For the App Store and TestFlight: flutter/ship.sh --upload counter (same key variables as ship.sh --upload below).

Flutter support is the work of dl-alexandre (@agrxculture). Thank you for the build pipeline (#7), the Linux ibtool for Flutter's storyboards (#8) and plugin package support (#9).

Ship to TestFlight and the App Store

Once: create an App Store Connect API team key (role App Manager with access to Certificates, Identifiers & Profiles) and keep the .p8 private; create the app record in App Store Connect (Apps > + > New App; the API cannot create apps). Then, from an xtool project directory:

ASC_KEY_PATH=/path/to/AuthKey_XXXXXXXXXX.p8 ASC_ISSUER_ID=<issuer-uuid> ASC_KEY_ID=XXXXXXXXXX \
  ~/omarchy-apple-dev/ship.sh --upload

ship.sh builds a release .app, compiles the app icon, registers the bundle id, creates an Apple Distribution certificate (the private key stays in ~/.config/omarchy-apple-dev/distribution/) and an App Store profile, signs with rcodesign, validates the .ipa offline (any FAIL stops it), uploads and prints Apple's processing result. It never submits a build for review.

Without a key it signs with a local TEST identity. That proves the pipeline only; Apple rejects the signature.

Proven: builds made entirely on Linux are VALID in App Store Connect, for the demo app (FINDINGS.md item 38) and for NetNewsWire with its extensions and 15 frameworks (item 40). Signing details, covering entitlements (Associated Domains, push, Sign in with Apple), ROOT_RESOURCES and Xcode ExportOptions.plist, are in docs/SHIPPING.md.

Real projects

The installer puts Linux stand-ins for Apple's actool, xcstringstool and momc into the SDK, so packages declaring .xcassets, .xcstrings or Core Data resources build. The Linux ibtool compiles NetNewsWire's storyboards and Flutter's two template storyboards byte-identical to Xcode 27.0. compat/icecubes/, compat/nnw/ and compat/mastodon/ build IceCubesApp, NetNewsWire and Mastodon for iOS with their app extensions, all VALID in App Store Connect. Large projects need ulimit -n 65536 before xtool dev build.

Scripts

  • install-toolchain.sh: toolchain and SDK install. --repair, --user-only, --curses-compat.
  • device-run.sh: pair, install, launch, LLDB, console, crash pull; --rsd and --over-tailnet for tunnel installs.
  • ship.sh: App Store .ipa, offline validation, --upload. Helpers: tools/asc.py, tools/darwin-tools, tools/xcstringstool.
  • ship-mac.sh: macOS .app from a SwiftPM package, Developer ID signing, --notarize.
  • tools/xcodeproj2xtool.py: xtool adapter for an Xcode project.
  • tools/ips-symbolicate.py: resolve a pulled .ips crash report on Linux.

Documentation

Notes

  • The clang on PATH must be the Swift toolchain's own, not the system clang; a version mismatch breaks SwiftUI with __builtin_bit_cast errors. Both scripts in this repo put it first on PATH themselves. In your own shell: PATH="$(dirname "$(readlink -f "$(command -v swift)")"):$PATH".

Support

omarchy-apple-dev is free. If it helps you, sponsor the project or send Lightning to [email protected].

License

MIT

Contributors

Everyone credited so far: CONTRIBUTORS.md.

文档镜像归档自 GitHub 官方源路径 · 访问原项目 GitHub
最后同步快照:2026-11-09