'ionic cap run' breaks after CLI version upgrade

’ionic capacitor run ios’ was working flawlessly until I upgraded Ionic CLI yesterday, then first (and subsequent) attempts fail with build error (below) However, no problems with ‘run’ when targeting ‘android’. And, I can still launch app onto ios device/simulator by using:

ionic build
ionic capacitor copy ios
ionic capacitor open ios (then Run from XCode onto any selected device/simulator)

Otherwise no changes to my project or XCode settings, profiles, team between the time ‘run’ worked and then stopped working

Do I need to update any dependencies or cocoa pods?

The following build commands failed:
[capacitor] CompileC /Users/myName/Documents/ProjectFolder/AppDev/ProjectName_v1/project/ios/DerivedData/9260CCC4-52CD-4026-A9CB-0F6EC7218A67/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/CapacitorCordova.build/Objects-normal/x86_64/CDVViewController.o /Users/myName/Documents/ProjectFolder/AppDev/ProjectName_v1/project/node_modules/@capacitor/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
[capacitor] (1 failure)

Here is my ionic info output:


Ionic CLI : 6.17.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 5.6.13


Capacitor CLI : 3.1.2
@capacitor/android : 3.1.2
@capacitor/core : 3.1.2
@capacitor/ios : 3.1.2


cordova-res : 0.15.3
native-run (update available: 1.4.1) : 1.4.0


NodeJS : v14.17.0 (/usr/local/bin/node)
npm : 7.13.0
OS : macOS Big Sur

In which version of the CLI were you before updating?
6.16.0 added Capacitor 3 support, which changed ionic run behaviour because of Capacitor 3 adding run command that builds the native project.

If you were in 6.16.x then updating shouldn’t have changed the behaviour of build command.

Anyway, if you are able to build from Xcode, it should also run from the CLI without problems.
Try removing derived data

Thanks. I was in 6.16 and was using ionic cap run ios successfully until the upgrade. For some reason, it has started working again for about a week, and now just hangs after the build stage. I can open XCOde and launch my app directly from there, but the shorthand ‘run’ is still finicky. Sometimes, it works…which is very helpful.

The ‘derived data’ you are referring to is my ‘ios’ folder created by the ‘add ios’ command?

I can try to delete/recreate this…

Thanks again for helping

No, it’s not part of your app, it’s part of Xcode. If you check the link there is an image that shows how to check the Derived Data folder location, should be something like /Users/yourUserName/Library/Developer/Xcode/DerivedData