The short answer
Short answer: front-end code, the web build and Android packages can all be done on Windows. Capacitor's official documentation states that building iOS apps requires macOS. Compiling, signing and exporting the ipa after cap sync has to happen on a Mac.
Which steps require macOS
What cannot leave macOS
- Capacitor's environment setup docs say it in so many words: building iOS apps requires macOS. The docs mention that cloud build services can be used when you have no Mac, but still recommend local tooling.
- The native iOS project is configured and managed through Xcode. Under the hood,
npx cap build ioscalls xcodebuild to archive and export.
What you can finish on Windows or Linux
- All front-end development and
npm run build. - Syncing, debugging and packaging for the Android platform.
- Platform-independent settings in
capacitor.config, such asappId,appNameandwebDir.
In other words, the Mac only handles the stretch of wrapping the already-built web bundle in the native shell and signing it. That is also the kind of use where renting a remote Mac by the month makes financial sense.
How to do it on a remote Mac
Set up the environment on the remote Mac
Install Xcode and open it once, then run
xcode-select --installto install the command line tools. Install Node.js. Capacitor has minimum versions for both Xcode and Node, and they change with each major release, so follow the environment setup docs.For dependency management, the docs say Capacitor 8 uses Swift Package Manager by default and CocoaPods has become optional. If your project was created earlier with CocoaPods, you still need to install it:
brew install cocoapods.Pull the code and build the web part
After cloning the repository, run
npm installand your framework's build command (for examplenpm run build). The directorywebDirpoints to must contain the finalindex.html, otherwise what gets synced in later is an empty shell.Add or sync the iOS platform
If the repository has no
ios/directory yet:npm install @capacitor/ios, thennpx cap add ios. If it already exists, do not add it again. Just run:npx cap syncPer the docs, sync does two things: it copies the built web bundle into the native project, and it updates the native dependencies Capacitor uses. Run it again every time you rebuild the web part or add or remove a plugin.
Confirm signing in Xcode
Run
npx cap open iosto open the project, and select your Team on the App target. Details are in Capacitor certificates and signing.Export the signed ipa
npx cap build iosPer the CLI docs, this command builds the native project and outputs a signed IPA. Common options:
--scheme: the scheme to build. The default isApp.--xcode-export-method: the export method. The default isapp-store-connect. Other values includerelease-testing,enterpriseanddebugging.--xcode-team-idand--xcode-signing-style(automaticormanual).
The docs do not state the output directory, so go by the path printed when the command finishes. You can also skip this command and archive in Xcode instead.
Upload
Capacitor's publishing docs come down to one sentence: its apps are submitted to the store exactly the same way as any other native app. So uploading follows Apple's flow, using Transporter or Xcode's Organizer. The order is in steps to sign and upload.
FAQ
I changed the front-end code but the installed build is still the old one
The most common cause is rebuilding only the web part without running npx cap sync again, so the native project still holds the files copied in last time. Make "build web, sync, then build the package" a fixed three-step routine.
The release build opens to a white screen or cannot load the page
Check whether a debugging server.url is still in capacitor.config. The docs say it is for live reload and not meant for production. If you ship with it, the app tries to load a development server address users cannot reach. The docs also warn against committing that piece of configuration to version control.
My older project uses CocoaPods. Do I need to migrate to SPM?
It is not required. If you want to migrate, the official npx cap spm-migration-assistant removes the Podfile and workspace and generates the Swift package configuration, after which two more steps have to be done by hand in Xcode. Plugins without an SPM version will not work properly after migration, so check your plugin list before starting. For details, follow the SPM docs.
Can I use a cloud build instead of renting a Mac?
Yes. Capacitor's own docs mention the cloud build route. It saves you setting up an environment, at the cost of only having logs to look at when something fails, with no desktop to work on. For the trade-offs, see remote Mac vs cloud build.
Related
- How do I set up iOS certificates and signing for Capacitor without a Mac?
- How do I debug a Capacitor app on the iOS simulator or a real device without a Mac?
- How do I sign an iOS app and upload it to the App Store from a remote Mac?
- Remote Mac vs GitHub Actions macOS runner or Codemagic: which should I use?
- iOS without a Mac: a remote Mac mini can build, sign and upload, but not debug on a real device
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support