Build Ionic Capacitor iOS Apps on Windows: ios/App to .ipa
After npx cap sync ios, build the project in ios/App on Windows.
Last updated
To build Ionic / Capacitor iOS apps on Windows, build your web app and run npx cap sync ios as usual. KXBuild builds the ios/App project Capacitor creates like any Xcode project, installs it on your iPhone over USB for debugging, and a Release build writes an .ipa under ios/App/build. npx cap commands and plugins work as usual. Capacitor 8 projects manage plugins with Swift packages, so CocoaPods is not needed.
How do I add the iOS platform to an Ionic / Capacitor project on Windows?
1. Build the web app and sync it to the iOS project
For an existing project, install dependencies, build the web app and sync it to the iOS project from the project folder. If there is no ios/ folder yet, run npx cap add ios once first.
> npm install> npm run build> npx cap sync iosOtherwise, create one with the Capacitor starter, install the iOS platform package, build the web app and add the iOS platform. The Xcode project is generated under ios/App.
> npx @capacitor/create-app MyApp --name MyApp --app-id com.example.myapp> cd MyApp> npm install @capacitor/ios> npm run build> npx cap add iosThen open ios/App in VS Code with File > Open Folder…, or drag the whole project into VS Code.
2. Run doctor
It checks the build environment and prepares the iOS project.
In the title bar of the KXBuild view, open the ··· menu and run Doctor (fix environment).
> kxbuild doctor .\ios\App\App.xcodeprojCapacitor 8 projects keep plugins in the ios/App/CapApp-SPM Swift package, so CocoaPods is not needed. Projects from earlier versions have a Podfile in ios/App. On Windows, npx cap sync does not install the pods, so run pod install once in ios/App and build App.xcworkspace. Run it again whenever you add or remove plugins. See CocoaPods.
ios\App> pod installHow do I debug the web and native code of an Ionic / Capacitor app on an iPhone?
3. Code
Write your web code in src/ as usual, then run npm run build and npx cap copy ios to copy it into the iOS project. After adding or removing Capacitor plugins, run npx cap sync ios instead. Native plugin code gets completion and go-to-definition in VS Code.
4. Debug
Select it in the KXBuild view and press F5. Set breakpoints in the Capacitor runtime and native plugin code in VS Code.
Build, install and launch the app on the phone:
> kxbuild run .\ios\App\App.xcodeprojDebug the JavaScript in your pages by running them in a desktop browser with npm start and using its developer tools.
Before you connect a phone for the first time, install and open Apple Devices from the Microsoft Store to get the USB driver on Windows. On iOS 16 and later, turn on Developer Mode in Settings > Privacy & Security and let the phone restart. See connect an iPhone to Windows for the full steps.
How do I build an Ionic / Capacitor iOS .ipa on Windows for the App Store?
5. Release
Run npm run build and npx cap sync ios first so the package contains your latest web code, then do a Release build. The .ipa is written under ios/App/build. To upload it to App Store Connect, see publish to the App Store from Windows.
Run KXBuild: Build for App Store (.ipa) from the Command Palette or the project's context menu.
> kxbuild build .\ios\App\App.xcodeproj -c Release --export app-storeAn App Store .ipa must be signed with an Apple Distribution certificate. Put your own .p12 certificate and .mobileprovision profile in a keychain/ folder and every build signs automatically; see sign iOS apps on Windows. Upload with kxstore (kxstore build upload, on Windows, Linux or macOS), then handle TestFlight and review on App Store Connect. That way you build Ionic / Capacitor iOS apps on Windows, debug them on a real iPhone and submit them from one computer.
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.
Release and App Store submission
Build Release with a Distribution certificate to get an .ipa, upload it to App Store Connect with kxstore (or Transporter on a Mac), then go through TestFlight and App Review. Ad Hoc and enterprise distribution work the same way.
Don't see your framework?
kxbuild is a general-purpose build toolchain, so if your framework produces an Xcode project, KXBuild can build it. The list above covers common cases only. Tell us about your setup.