Release and App Store submission
Build Release with a Distribution certificate to get an .ipa, upload it to App Store Connect with Transporter or Appuploader, then go through TestFlight and App Review. Ad Hoc and enterprise distribution work the same way.
KXBuild produces the package. Build Release with a Distribution certificate and you get an .ipa. Upload it to App Store Connect with Transporter (Mac) or Appuploader (Windows), then finish TestFlight and App Review on the website.
Your keychain folder needs an Apple Distribution certificate and an App Store provisioning profile. See Certificates and signing.
Steps
Bump the version
App Store Connect requires each upload's build number, CFBundleVersion, to be higher than the last one. The version number, CFBundleShortVersionString, is what the store shows. Change them on the General page of the Project Settings Editor, or edit Info.plist directly.
Build Release
In VS Code, switch to Release in the Build configuration node of the KXBuild view and run KXBuild: Build. On the command line, run
> kxbuild build .\MyApp.xcodeproj -c ReleaseIf the project's Release configuration doesn't use an Apple Distribution certificate, add -D CODE_SIGN_IDENTITY="Apple Distribution" to override it. The build writes build\MyApp.ipa in the project folder, with the same layout as an Xcode export. The build\MyApp.AppStoreInfo.plist next to it is for the -assetDescription option of command-line Transporter. With the Transporter app or Appuploader, just select the .ipa.
Upload
On a Mac, drag the .ipa into Transporter. On Windows, open Appuploader, sign in with your developer account, select the .ipa on the upload page and wait for it to finish. Create the app record in App Store Connect first, with the same bundle ID as the package.
TestFlight and App Review
Apple takes anywhere from a few minutes to an hour or so to process the upload. The build then appears on the TestFlight tab in App Store Connect, where you can send it to internal testers first. When you're happy with it, select the build on the App Store tab, fill in the details and submit it for review.
Distribute outside the App Store
The steps are the same, with an Ad Hoc profile or an enterprise account's In-House profile instead. Ad Hoc profiles must include the device UDIDs. You can install the .ipa over a cable on any iPhone listed in the profile.
> kxdevice install MyApp.ipaBefore you upload
- The provisioning profile is an App Store profile. A package signed with a Development or Ad Hoc profile uploads fine, but won't install from TestFlight or gets rejected in review.
- The app icon is complete. Open the .xcassets in VS Code and run KXBuild: Compile-check Asset Catalog to list missing sizes.
- The build number is higher than last time, and the bundle ID matches the App Store Connect record.
Next steps
Build and configure
Debug versus Release, choosing a scheme, target and configuration, overriding build settings, where build products go, when you get an .ipa and when Swift package dependencies resolve.
Troubleshooting
Run kxbuild doctor first. Then look up your error message by category: install, project, signing, device, release or extension. Also covers where to find the logs.