Skip to main content

Build Unity iOS projects on Windows

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

Build the iOS project that Unity exports on Windows, install it on your iPhone and debug the native layer. Export from Unity as usual and treat the export folder as a regular Xcode project. You don't need a Unity plugin or any change to your Unity project settings.

Steps

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.

Use either of these

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.

5

Release

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

    The target is always Unity-iPhone. Run the command for your export folder.

    No Podfile

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

    Podfile, after pod install

    > kxbuild build .\Unity-iPhone.xcworkspace -c Release -t Unity-iPhone

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.