diff --git a/scripts/build-apple.sh b/scripts/build-apple.sh index 8640413..cd27481 100755 --- a/scripts/build-apple.sh +++ b/scripts/build-apple.sh @@ -16,8 +16,9 @@ export MACOSX_DEPLOYMENT_TARGET=14.0 # The helper's bundle id (embedded Info.plist, see crates/kv-nmh/build.rs): the app's own + ".nmh". BUNDLE_PREFIX=$(sed -n 's/^ *BUNDLE_PREFIX: *\([A-Za-z0-9.-]*\).*/\1/p' ../kestrove-apple/project.yml | head -1) export KV_NMH_BUNDLE_ID="${BUNDLE_PREFIX:-app.kestrove}.nmh" +# With debug info and unstripped, so a dSYM can be made (App Store Connect wants one per executable). for t in aarch64-apple-darwin x86_64-apple-darwin; do - cargo build -p kv-nmh --release --target "$t" + CARGO_PROFILE_RELEASE_DEBUG=true CARGO_PROFILE_RELEASE_STRIP=false cargo build -p kv-nmh --release --target "$t" done cargo build -p kv-ffi --features browser-bridge # host dylib for library-mode bindgen @@ -44,4 +45,9 @@ cp out/swift/kv_ffi.swift "$OUT/Sources/KestroveCore/Generated.swift" mkdir -p "$OUT/bin" lipo -create target/aarch64-apple-darwin/release/kestrove-nmh target/x86_64-apple-darwin/release/kestrove-nmh \ -output "$OUT/bin/kestrove-nmh" +# Symbols go to the dSYM (same UUIDs), then the shipped binary is stripped. Mac/embed-nmh.sh puts the dSYM +# into the archive. +rm -rf "$OUT/bin/kestrove-nmh.dSYM" +dsymutil "$OUT/bin/kestrove-nmh" -o "$OUT/bin/kestrove-nmh.dSYM" +strip -x "$OUT/bin/kestrove-nmh" echo "✅ XCFramework + bindings written to $OUT"