Capacitor "Could not find the ios platform" in CI
On a macOS runner, Capacitor expects a native iOS project at ./ios. When that folder is gitignored or npx cap add ios was never run, sync fails before CocoaPods or Xcode are invoked.
What this error means
npx cap sync ios stops with "[error] Could not find the ios platform in: /path/ios". The native Xcode workspace does not exist on the runner.
Capacitor
[error] Could not find the ios platform in: /Users/runner/work/app/app/ios.
Try running: npx cap add iosCommon causes
The ios folder is not in the checkout
Generated native folders are frequently gitignored. A clean CI clone has no ./ios, so Capacitor reports the platform as missing.
cap add ios was skipped in the pipeline
The iOS project comes from npx cap add ios. Pipelines that only run sync skip the step that creates it.
How to fix it
Add and sync the iOS platform on macOS
- Use a macOS runner so Xcode and CocoaPods are available.
- Run
npx cap add ios, thennpx cap sync ios. - Run pod install and build the workspace.
.github/workflows/ios.yml
runs-on: macos-14
steps:
- run: npm ci && npm run build
- run: npx cap add ios
- run: npx cap sync iosOr commit the ios project
If you maintain native iOS changes, commit ./ios and stop ignoring it so the runner restores it on checkout.
How to prevent it
- Run cap add ios only on macOS runners.
- Be consistent about committing or regenerating native folders.
- Pin the Capacitor CLI to keep generated project layout stable.
Related guides
Capacitor "Could not find the android platform" in CIFix Capacitor "Could not find the android platform in: ./android" in CI - the native android directory was ne…
Capacitor "pod install" failed on iOS in CIFix Capacitor iOS "pod install" failures during cap sync in CI - CocoaPods cannot resolve the Capacitor pods…
Capacitor "Could not find the web assets directory" in CIFix Capacitor "Could not find the web assets directory: ./www" in CI - cap copy or sync runs before the web b…