Regenerate UniFFI Swift bindings from Rust crate
Regenerate the UniFFI Swift bindings after changes to the pgp-mobile Rust crate public API.
Build the HOST (macOS) dylib — this is NOT an iOS artifact, it's used only for bindgen:
cargo build --release --manifest-path pgp-mobile/Cargo.toml
Generate Swift bindings from the dylib:
cargo run --bin uniffi-bindgen generate --library target/release/libpgp_mobile.dylib \
--language swift --out-dir bindings/
Cross-compile for all three targets to verify the static lib builds:
cargo build --release --target aarch64-apple-ios --manifest-path pgp-mobile/Cargo.toml
cargo build --release --target aarch64-apple-ios-sim --manifest-path pgp-mobile/Cargo.toml
cargo build --release --target aarch64-apple-darwin --manifest-path pgp-mobile/Cargo.toml
Recreate the XCFramework (all three platform slices):
xcodebuild -create-xcframework \
-library target/aarch64-apple-ios/release/libpgp_mobile.a -headers bindings/ \
-library target/aarch64-apple-ios-sim/release/libpgp_mobile.a -headers bindings/ \
-library target/aarch64-apple-darwin/release/libpgp_mobile.a -headers bindings/ \
-output PgpMobile.xcframework
Recommended: Use ./build-xcframework.sh --release to automate Steps 1–4 in one command.
cargo test --manifest-path pgp-mobile/Cargo.toml
xcodebuild test -scheme CypherAir -testPlan CypherAir-UnitTests \
-destination 'platform=iOS Simulator,name=iPhone 17'
pgp_mobile.swift directly — it will be overwritten on regeneration.