rust-ios-build

Builds and packages Rust static libraries as XCFrameworks for iOS apps.

2|1|Updated Aug 19, 2026
One-click install
npx skills add https://github.com/po4yka/rust-skills --skill rust-ios-build-po4yka
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rust-ios-build
Source: https://github.com/po4yka/rust-skills/tree/main/skills/rust-ios-build
Command: npx skills add https://github.com/po4yka/rust-skills --skill rust-ios-build-po4yka

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Shipping Rust code inside an iOS app requires correctly building device and simulator slices, setting a consistent deployment target, assembling an XCFramework, and proving a Swift consumer can link and call it. This Skill provides the exact commands, verification checks, and failure triage tables for that entire pipeline. ## Core Features & Use Cases - Slice building and verification: Builds aarch64-apple-ios and aarch64-apple-ios-sim staticlibs with one IPHONEOS_DEPLOYMENT_TARGET, then validates platform and minimum OS per object with otool -l and nm -gU. - XCFramework and SwiftPM packaging: Assembles the XCFramework with xcodebuild -create-xcframework, stages headers and modulemaps, and integrates via local or remote SwiftPM binaryTarget with checksum handling. - Release evidence and triage: Covers dSYM UUID matching, simulator and physical-device smoke tests, code signing boundaries, privacy manifest routing, and a symptom-to-fix table for common linker and packaging failures. - Use Case: You maintain a UniFFI-based Rust core for an iOS app. Use this Skill to build both slices, package the XCFramework, wire it into SwiftPM, and run a simulator smoke test that calls your exported ABI version function before every release. ## Quick Start Use the rust-ios-build skill to build my Rust FFI crate for iOS device and simulator, package it as an XCFramework, and verify the slices.

Frequently Asked Questions about rust-ios-build

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Rust static library for iOS?▼

Build a Rust staticlib for iOS with cargo rustc --target aarch64-apple-ios --crate-type staticlib, and use aarch64-apple-ios-sim for the Apple silicon simulator. Export one IPHONEOS_DEPLOYMENT_TARGET for every cargo invocation so all objects share the same minimum OS.

How to package a Rust library as an XCFramework for SwiftPM?▼

Package the device and simulator archives with xcodebuild -create-xcframework, passing each library with its headers directory containing the C header and modulemap. Reference it in SwiftPM as a binaryTarget named after the module, using a local path or a remote ZIP with a swift package compute-checksum value.

Why does ld warn that an object file was built for a newer iOS version?▼

This warning means IPHONEOS_DEPLOYMENT_TARGET was unset or stale for one object, often a cc-built C object defaulting to the SDK version. Export the variable, rebuild in a fresh CARGO_TARGET_DIR, and re-run the otool -l slice check; treat the warning as a failure.

Can I link two Rust static libraries into one iOS app?▼

No, each Rust staticlib carries its own copy of std and the Rust Reference says multiple Rust staticlibs are likely to conflict, producing duplicate symbol errors. Put every Rust crate the app needs behind one FFI crate and build a single staticlib.

Does a Rust staticlib carry its framework dependencies for iOS?▼

No, a staticlib does not carry the system libraries and frameworks its dependencies link. Run cargo rustc with --print=native-static-libs and add each listed -framework and -l flag to the Swift consumer's linker settings.

How do I verify a dSYM matches the shipped iOS app?▼

Compare UUIDs with dwarfdump --uuid on both the app executable inside the .xcarchive and the app dSYM, and require the UUID sets to match. Reject a dSYM from a rebuild even when the Git revision and version are identical.