Develop Objective-C iOS Apps on Windows: Build, Debug, Ship
Open your existing Xcode project and build. No changes needed.
Last updated
To develop Objective-C iOS apps on Windows, open your existing Xcode project in KXBuild. Your .xcodeproj and .xcworkspace work as is, and build settings, target dependencies and compiler flags are read by Xcode's rules. The app installs on your iPhone over USB, breakpoints work in mixed Objective-C and Swift code, and a Release build produces an .ipa ready for App Store Connect. For projects that use CocoaPods, see use CocoaPods on Windows.
How do I create or open an Objective-C project on Windows?
1. Create a project
If you don't have a project yet, create one. Every built-in template targets iOS 15.
Run KXBuild: New Project from the Command Palette and pick the "iOS App (Objective-C, UIKit)" template, or "iOS App (Objective-C + Swift)" for a mixed project.
To use an existing project, open its folder in VS Code with File > Open Folder…, or drag the folder into VS Code.
> kxbuild project create -t app_objc -n MyApp -o D:\projects2. Run doctor
Doctor checks your build environment and fixes anything missing. Run it the first time you open a project, and again whenever you hit an environment error.
In the title bar of the KXBuild view, open the ··· menu and run Doctor (fix environment).
> kxbuild doctor .\MyApp.xcodeprojHow do I write Objective-C code and debug it on an iPhone?
3. Write code
Open a .m or .h file and you get completion, go to definition and error checking, including for system framework APIs. If completion misbehaves, see Code completion and indexing.
4. Debug
Select it in the KXBuild view and press F5. KXBuild builds, installs and stops at your breakpoints, with no launch.json needed. Breakpoints work in both Objective-C and Swift code.
Run the command below to build the app, install it on your iPhone and launch it.
> kxbuild run .\MyApp.xcodeprojBefore 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, also turn on Developer Mode in Settings > Privacy & Security, then let the phone restart. When it asks you to trust this computer, unlock it and tap Trust. Register the phone's UDID in the provisioning profile you debug with. The full steps are in connect an iPhone to Windows.
How do I build an Objective-C app as an .ipa for the App Store?
5. Release
Build with the Release configuration to get build\MyApp.ipa in the project folder. To upload it, 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.
Build the .xcworkspace if there is one, otherwise the .xcodeproj, for example:
> kxbuild build .\MyApp.xcodeproj -c Release --export app-storeSign the .ipa with an Apple Distribution certificate. Use your own .p12 certificate and .mobileprovision profile, placed in a keychain/ folder in the project or the install directory, and every build signs automatically. See sign iOS apps on Windows. Upload with kxstore (kxstore build upload, on Windows, Linux or macOS) or with Transporter, then finish TestFlight and review on App Store Connect. That way you develop Objective-C iOS apps on Windows from first line to submission on 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.