Build Cordova iOS apps on Windows
Add the iOS platform, then build the project in platforms/ios on Windows.
Package a Cordova project for iOS on Windows and debug it on your iPhone. The platforms/ios project that cordova platform add ios creates builds like any Xcode project, and cordova commands and plugins work as usual.
Steps
Create a Cordova project and add the iOS platform
For an existing project, add the iOS platform in the project folder. Then open platforms/ios in VS Code with File > Open Folder…, or drag the whole Cordova project into VS Code. Otherwise, create one. Install Cordova with npm, create the project, then add the iOS platform from inside the project folder. The Xcode project is generated under platforms/ios.
> npm install -g cordova> cordova create MyApp com.example.myapp MyApp> cd MyApp> cordova platform add iosRun doctor
Doctor checks your build environment and prepares the iOS project.
Use either of these
-
VS Code extension
In the title bar of the KXBuild view, open the ··· menu and run Doctor (fix environment).
-
Command line
> kxbuild doctor .\platforms\ios\App.xcworkspace
By default the project manages dependencies with Swift packages and doesn't need CocoaPods. If a plugin you add has CocoaPods dependencies, a Podfile appears in platforms/ios. Cordova doesn't install those pods on Windows, so run pod install once in platforms/ios, and again whenever you add or remove such a plugin. See CocoaPods.
platforms\ios> pod installWrite code
Keep writing your web code under www/, and run cordova prepare ios after changes to sync it to the iOS project. Native plugin code gets completion and go to definition in VS Code.
Debug
Connect your iPhone over USB, select it in the KXBuild view and press F5. Debug native code with breakpoints in VS Code and the web content with your browser's remote debugging tools. The two work independently.
Release
Build with the Release configuration to get an .ipa under platforms/ios. To upload it to App Store Connect, see Release and App Store submission.
Use either of these
-
VS Code extension
Switch the configuration to Release in the Build configuration node of the KXBuild view, then run KXBuild: Build from the Command Palette.
-
Command line
> kxbuild build .\platforms\ios\App.xcworkspace -c Release
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 Transporter or Appuploader, 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.