Skip to main content

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

1

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 ios
2

Run doctor

Doctor checks your build environment and prepares the iOS project.

Use either of these

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 install
3

Write 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.

4

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.

5

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

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.