Skip to main content

Build Unity iOS Games on Windows: Xcode Project to .ipa

Export from Unity as usual, then build it on Windows like any other iOS project.

Last updated

Export a Unity game as an Xcode project from Build Profiles, run it on a real iPhone from VS Code on Windows, change a C# script and export again from the command line, and build a Release .ipa.
Show steps for

To build Unity iOS games on Windows, export the Xcode project from Unity as usual: with the iOS Build Support module installed, build to a folder, and KXBuild builds it like any iOS project, installs it on your iPhone over USB for native debugging, and a Release build produces the .ipa. You don't need a Unity plugin or any change to your Unity project settings, and the target is always Unity-iPhone.

How do I export an iOS Xcode project from Unity on Windows?

1. Develop in Unity and export an Xcode project

Develop your project in Unity as usual. With the iOS Build Support module installed, switch the platform to iOS in Build Settings and build to a folder.

Then open that folder in VS Code with File > Open Folder….

2. Run doctor

Doctor checks your build environment and fixes anything missing. If you use plugins with iOS dependencies, such as Firebase or Google Mobile Ads, the export folder contains a Podfile. In that case, run pod install in the export folder afterwards. See CocoaPods.

In the title bar of the KXBuild view, open the ··· menu and run Doctor (fix environment).

> kxbuild doctor .\Unity-iPhone.xcodeproj

How do I debug a Unity game on an iPhone?

3. Write code

Keep writing C# scripts in Unity and export again after changes. The Objective-C plugin code in the export folder 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 C# scripts with Unity's own debugger. The two work independently.

Run the command below in the export folder to build the game and install it on your iPhone. After pod install, build Unity-iPhone.xcworkspace instead.

> kxbuild build .\Unity-iPhone.xcodeproj -t Unity-iPhone --install

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 a Unity iOS .ipa on Windows for the App Store?

5. Release

Build with the Release configuration to get an .ipa in the export folder. 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.

The target is always Unity-iPhone. After pod install, build Unity-iPhone.xcworkspace instead, for example:

> kxbuild build .\Unity-iPhone.xcodeproj -c Release --export app-store -t Unity-iPhone

An 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 Unity iOS games on Windows, debug them on a real iPhone and submit them from one computer.

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.