Guide · macOS

Shipping an Adobe AIR app to the Mac App Store and TestFlight: embedding the provisioning profile

The step nobody documents – and why your AIR Mac app is "missing a provisioning profile".


If you package a macOS app with Adobe AIR (adt -package -target bundle), sign it and upload it to App Store Connect, sooner or later you hit one of these:

  • App Store Connect warns that the build is missing a provisioning profile, and the build never becomes available in TestFlight.
  • Capabilities silently fail on the Mac: push notifications, Sign in with Apple, keychain access groups.
  • The upload is rejected because the signature or the entitlements don't match what Apple expects.

The reason is simple: ADT never embeds a provisioning profile into a macOS bundle. On iOS, adt -package -target ipa-app-store -provisioning-profile … does it for you. For macOS there is no such option, and neither the AIR documentation nor Apple's documentation covers the AIR case. Xcode does this automatically for native apps, so most guides never mention it.

This article shows the complete, working sequence we use for our own AIR apps in the Mac App Store, including TestFlight, push, Sign in with Apple and in-app purchases.

1. What you need in the Apple Developer portal

  1. A macOS App ID (explicit, e.g. com.example.myapp.desktop) with the capabilities you use: Push Notifications, Sign in with Apple, In-App Purchase, …
  2. A "Mac App Store Connect" provisioning profile (Distribution → Mac App Store) for exactly this App ID. Download it. On the Mac it is a .provisionprofile file (not .mobileprovision).
  3. Two certificates in your login keychain:
  4. Apple Distribution: <Your Company> (<TEAMID>) (or the older 3rd Party Mac Developer Application) – signs the app.
  5. 3rd Party Mac Developer Installer: <Your Company> (<TEAMID>) – signs the .pkg you upload.

Every capability you need must be in the profile. If you add Sign in with Apple later, regenerate and re-download the profile. An old profile without the capability is the most common reason for a rejected upload.

You can inspect what a profile contains:

Terminal
security cms -D -i MyApp_MacAppStore.provisionprofile | plutil -p - | grep -A30 Entitlements

2. Build the bundle with ADT

Terminal
adt -package -target bundle MyApp.app MyApp-app.xml MyApp.swf -extdir lib ...

AIR copies the Adobe AIR runtime and every macOS ANE framework into MyApp.app/Contents/Frameworks/. That is where you have to look for them when signing, not in META-INF/AIR/extensions.

3. Prepare the bundle before signing

Do all of this before you sign. Any change after signing breaks the signature.

a) Make the bundle writable. AIR produces many read-only files:

Terminal
chmod -R u+rwX MyApp.app

b) Remove leftover Flash/Adobe files from the AIR framework. They are unsigned or third-party signed and break signing and App Store validation:

Terminal
R="MyApp.app/Contents/Frameworks/Adobe AIR.framework/Versions/1.0/Resources"
rm -f  "$R/A2712Enabler" "$R/Adobe AIR.vch" "$R/adobecp.vch" \
       "$R/Adobe Root Certificate.cer" "$R/Thawte Root Certificate.cer" "$R/WebKit.dylib"
rm -rf "$R/AdobeCP15.plugin" "$R/adobecp.plugin" "$R/Flash Player.plugin"

c) Info.plist. Set CFBundleShortVersionString and CFBundleVersion (every upload needs a higher CFBundleVersion), LSMinimumSystemVersion, the camera and microphone usage descriptions if you need them, and ITSAppUsesNonExemptEncryption = false if you only use standard HTTPS. Then App Store Connect stops asking about encryption on every upload.

d) Raise the deployment target if Apple rejects it. Current Apple tooling rejects Mach-O files with a deployment target below macOS 12. The AIR runtime and many ANEs are built for macOS 11. vtool raises it while keeping the SDK version:

Terminal
SDK=$(vtool -show-build "$BIN" | awk '/sdk/{print $2; exit}')
vtool -set-build-version macos 12.0 "$SDK" -replace -output "$BIN.tmp" "$BIN" && mv "$BIN.tmp" "$BIN"

Do this for every Mach-O file in Contents/ (the app stub, Adobe AIR.framework, every ANE framework) and set LSMinimumSystemVersion to 12.0.

4. Embed the provisioning profile – the missing step

Terminal
cp MyApp_MacAppStore.provisionprofile MyApp.app/Contents/embedded.provisionprofile

That's it: one copy. Three things matter:

  1. The file name and location are fixed: Contents/embedded.provisionprofile.
  2. Copy it before signing. The signature seals the profile. If you copy it afterwards, codesign --verify fails and the upload is rejected.
  3. It must be the Mac App Store profile for exactly this bundle ID, containing every capability your entitlements request.

5. The entitlements file must match the profile

AIR doesn't generate entitlements for you either. Create a plist, e.g. entitlements.plist:

entitlements.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <!-- identity: must match the profile -->
  <key>com.apple.application-identifier</key><string>TEAMID.com.example.myapp.desktop</string>
  <key>com.apple.developer.team-identifier</key><string>TEAMID</string>

  <!-- Mac App Store apps must be sandboxed -->
  <key>com.apple.security.app-sandbox</key><true/>
  <key>com.apple.security.network.client</key><true/>

  <!-- the AIR runtime needs these -->
  <key>com.apple.security.cs.allow-jit</key><true/>
  <key>com.apple.security.cs.allow-unsigned-executable-memory</key><true/>
  <key>com.apple.security.cs.disable-library-validation</key><true/>

  <!-- only what you use, and only if it is in the profile -->
  <key>com.apple.security.device.camera</key><true/>
  <key>com.apple.security.device.microphone</key><true/>
  <key>com.apple.developer.aps-environment</key><string>production</string>
  <key>com.apple.developer.applesignin</key><array><string>Default</string></array>
  <key>keychain-access-groups</key><array><string>TEAMID.com.example.myapp.desktop</string></array>
</dict>
</plist>

Note the macOS key names. Push is com.apple.developer.aps-environment (on iOS it is aps-environment), and the identity key is com.apple.application-identifier. If an entitlement isn't covered by the embedded profile, the app is rejected on upload or simply loses that capability.

6. Sign inside-out – twice

Sign the nested code first, then the app. For an AIR app, run the whole sequence twice. After the first pass the outer seal does not settle over the freshly signed frameworks. With a single pass, App Store validation regularly fails.

Terminal
CERT="Apple Distribution: Your Company (TEAMID)"
AIR="MyApp.app/Contents/Frameworks/Adobe AIR.framework"

for PASS in 1 2; do
  codesign -f -s "$CERT" "$AIR/Versions/1.0/Adobe AIR_64"
  codesign -f -s "$CERT" "$AIR/Versions/1.0/Adobe AIR"
  codesign -f -s "$CERT" "$AIR"

  # every ANE framework AIR put into Contents/Frameworks
  for FW in MyApp.app/Contents/Frameworks/*.framework; do
    [ "$(basename "$FW")" = "Adobe AIR.framework" ] && continue
    codesign -f -s "$CERT" "$FW"
  done

  codesign -f -s "$CERT" --entitlements entitlements.plist \
           --strict --timestamp --deep MyApp.app
done

Don't sign Contents/Frameworks/ itself. It is a plain folder, not a bundle.

ANE authors: AIR loads macOS ANEs at runtime with dlopen(). The framework binary must be a dynamic library (clang -dynamiclib … -Wl,-undefined,dynamic_lookup), not a static archive, or it can't be signed and loaded properly.

7. Verify before you upload

Terminal
codesign --verify --deep --strict --verbose=2 MyApp.app          # must say "valid on disk"
codesign -d --entitlements :- MyApp.app                         # the entitlements you expect
security cms -D -i MyApp.app/Contents/embedded.provisionprofile | plutil -extract Name raw -

If all three look right, the build is TestFlight-eligible.

8. Package and upload

The Mac App Store takes a signed installer package:

Terminal
productbuild --component MyApp.app /Applications \
             --sign "3rd Party Mac Developer Installer: Your Company (TEAMID)" MyApp.pkg

Upload it with Transporter, or from the command line with an App Store Connect API key:

Terminal
xcrun altool --upload-app -f MyApp.pkg -t macos --apiKey KEYID --apiIssuer ISSUER-UUID

A few minutes later the build appears in TestFlight.

9. Pitfalls we ran into

  • The app no longer opens when you double-click it locally. That is expected: a bundle with an embedded App Store profile only runs when installed through TestFlight or the App Store. For local testing, build a second variant without the profile (and without restricted entitlements such as push, Sign in with Apple and keychain groups), or use a Development profile.
  • Xcode's "Distribute App" picks a different profile. If you upload through Xcode's Organizer, it uses the profiles in ~/Library/Developer/Xcode/UserData/Provisioning Profiles, not the one you embedded. An old copy there without a newer capability gets the build refused. Keep that folder in sync or upload with altool / Transporter.
  • "Account Not In This Store" during TestFlight in-app purchase tests on the Mac. TestFlight on macOS may use the US storefront even if your account belongs to another country. Products, prices and introductory offers still load, which proves the StoreKit integration works. App Review uses its own accounts.
  • Copying the profile after signing. Always embed it first, then sign.
  • A capability missing from the profile. Regenerate the profile after you add a capability to the App ID, then embed the new file.

Checklist

  1. App ID with all capabilities → Mac App Store profile downloaded
  2. adt -target bundle
  3. chmod -R u+rwX, remove the leftover Flash/Adobe files
  4. Info.plist: versions, minimum OS, usage descriptions, encryption flag
  5. Raise the deployment target to 12.0 if needed (vtool)
  6. cp profile Contents/embedded.provisionprofile
  7. Entitlements file matching the profile
  8. Sign inside-out, twice
  9. Verify: signature, entitlements, embedded profile
  10. productbuild with the installer certificate → upload → TestFlight

Once this sequence is a script, an AIR Mac App Store release is as routine as an iOS one, including TestFlight, push, Sign in with Apple and subscriptions.

Questions about native extensions for Adobe AIR on macOS? klughomesolutions.com

More articles