# ITMS-90046 & Late TestFlight Rejections

## Symptom & Root Cause

App Store Connect rejects uploaded builds with `ITMS-90046` (invalid entitlements such as `get-task-allow=true`), `ITMS-90035` (broken nested code signatures), `ITMS-90059` (invalid or missing `CFBundleShortVersionString` or `CFBundleVersion`), `ITMS-90208` (invalid `MinimumOSVersion` / `LSMinimumSystemVersion` or Mach-O `LC_BUILD_VERSION` `minos` mismatch), `ITMS-91053` (missing `PrivacyInfo.xcprivacy` required-reason API declaration), `ITMS-91056` (malformed `PrivacyInfo.xcprivacy` or invalid `NSPrivacyAccessedAPITypeReasons` code), or Guideline 2.5.2 violations only after the full archive, export, upload, and server processing pipeline finishes. Because a measured 5-build TestFlight baseline (`8.8–11.1 min` end-to-end) spends `4.0–7.1 min` locally (`128–284s` archive, `40–49s` `-exportArchive`, `67–118s` `altool` upload used by the baseline pipeline) plus `3–5 min` in Apple server processing, discovering a packaging flaw after upload wastes an entire release cycle.

## Exact Diagnostic & Fix Commands

Inspect an unpacked `.ipa` manually for entitlements, nested signatures, `Info.plist` fields, Mach-O `LC_BUILD_VERSION`, and `PrivacyInfo.xcprivacy` manifests:

```sh
# Extract the .ipa into a temporary directory
rm -rf /tmp/ipa-check && unzip -q ./Release.ipa -d /tmp/ipa-check
APP_PATH=$(find /tmp/ipa-check/Payload -maxdepth 1 -name "*.app" | head -n 1)

# 1. Check ITMS-90046: inspect embedded entitlements (get-task-allow must be absent or false in Release)
codesign -d --entitlements - --xml "$APP_PATH" 2>/dev/null

# 2. Check ITMS-90035: verify deep nested bundle signatures
/usr/bin/codesign --verify --deep --strict --verbose=2 "$APP_PATH"

# 3. Check ITMS-90059: inspect CFBundleShortVersionString and CFBundleVersion
/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" -c "Print :CFBundleVersion" "$APP_PATH/Info.plist"

# 4. Check ITMS-90208: inspect MinimumOSVersion / LSMinimumSystemVersion and Mach-O LC_BUILD_VERSION (minos)
/usr/libexec/PlistBuddy -c "Print :MinimumOSVersion" "$APP_PATH/Info.plist"
EXEC_NAME=$(/usr/libexec/PlistBuddy -c "Print :CFBundleExecutable" "$APP_PATH/Info.plist")
otool -l "$APP_PATH/$EXEC_NAME" | grep -A3 "LC_BUILD_VERSION"

# 5. Check ITMS-91053 / ITMS-91056: locate and lint PrivacyInfo.xcprivacy manifests in app and nested bundles
find "$APP_PATH" -name "PrivacyInfo.xcprivacy" -exec plutil -lint {} +
```

Run XCLoom's offline preflight gate before uploading anything to App Store Connect:

```sh
# Run 31 offline checks (22 ITMS-* rules incl. provisioning ITMS-90174 & Privacy Manifest ITMS-91053/ITMS-91056 + 9 XCLOOM-252-* hot-reload marker checks)
xcloom preflight ./Release.ipa --method app-store --json

# Upload via chunked ASC API after preflight passes (reads ~/.appstoreconnect or ASC_KEY_ID, ASC_ISSUER_ID, and ASC_PRIVATE_KEY_PATH / AuthKey_<ID>.p8)
xcloom upload-asc ./Release.ipa --bundle-id com.example.app --short-version 1.0 --build-number 1 --json
```

## How XCLoom Prevents Recurrence

`xcloom preflight` inspects the entire `.ipa` archive offline before upload, running `31` offline checks (`22` App Store `ITMS-*` rules covering `ITMS-90174` embedded provisioning, `ITMS-90046` entitlements, `ITMS-90035` nested Mach-O and bundle signatures, `ITMS-90059` `CFBundleShortVersionString` and `CFBundleVersion`, `ITMS-90208` `MinimumOSVersion` / `LSMinimumSystemVersion` and Mach-O `LC_BUILD_VERSION` `minos` consistency, plus `ITMS-91053`, `ITMS-91056`, and `XCLOOM-PRIVACY-SDK-ONLY` `PrivacyInfo.xcprivacy` required-reason API audits across the root `.app` and nested bundles, plus `9` `XCLOOM-252-*` Guideline 2.5.2 checks that scan for leaked XCLoom dev-time hot-reload markers: `XCLoomHotAgent`, `XCLoomDeviceAppHotAgent`, `__swift5_replace`, and `get-task-allow`). Measured offline preflight runtimes are `0.39s` single trial on an `85 MB` `.ipa`, `1.87s` on the `77.7 MB` production App Store `.ipa`, `0.66s` (`--method development`) to `3.11s` (`--method app-store`) 9-run median on a `149 MB` `.ipa`, and `2294.4 ms` on the `Swiftfin` simulator build capture (`19` passed, `11` errors, `1` warning), exiting non-zero (`1`) if any blocking issue is present. Once preflight passes, `xcloom upload-asc` reads local `~/.appstoreconnect` API credentials (`ASC_KEY_ID`, `ASC_ISSUER_ID`, and `ASC_PRIVATE_KEY_PATH` / `AuthKey_<ID>.p8`) and uploads the `77.7 MB` `.ipa` in `15 chunks over a 16-stream HTTP/2 pool` in `25.1s` instead of `67–118s` with `altool`.

## Frequently Asked Questions

### What causes `ITMS-90046` most frequently in automated pipelines?

Re-signing a Debug or Development artifact with a Distribution certificate while leaving `get-task-allow=true`, or carrying an entitlement in the binary that is missing from the embedded `.mobileprovision` profile.

### What does the `XCLOOM-252-*` Guideline 2.5.2 gate check and what does it not check?

It scans every Thin, FAT, and FAT64 Mach-O slice for leaked XCLoom dev-time hot-reload markers (`XCLoomHotAgent`, `XCLoomDeviceAppHotAgent`, `__swift5_replace`, and `get-task-allow`). It does not statically audit arbitrary third-party `dlopen`, JIT, or interpreter frameworks.

### Can `xcloom preflight` run on an `.ipa` built by standard `xcodebuild`?

Yes. `xcloom preflight ./AnyApp.ipa --method app-store --json` operates directly on any `.ipa` archive regardless of whether `xcodebuild`, `fastlane`, or `xcloom archive` produced it.

## Related Links

- [macOS Keychain Prompts Hanging codesign](/errors/codesign-keychain-popup-ci/)
- [Why Claude Code Spent 70% of My iOS Sessions Waiting on Xcode](/blog/70-percent-xcode-wait-claude-code-ios/)
- [XCLoom Benchmarks](/benchmarks/)
- [All iOS Build & Simulator Errors](/errors/)
