Skip to content
Latchkey

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 ios

Common 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

  1. Use a macOS runner so Xcode and CocoaPods are available.
  2. Run npx cap add ios, then npx cap sync ios.
  3. 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 ios

Or 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →