I am trying to deploy an Ionic 5 project to an iPhone 12 running iOS 14.6 with XCode 11.4. The app runs fine on the emulator but after following the official instructions here I get Command PhaseScriptExecution failed
error and in the logs directly before that is this error:
Code Signing /Users/simonhill/Library/Developer/Xcode/DerivedData/App-buuhfmnvjxqcivakwsfsgrdpsrjw/Build/Products/Debug-iphoneos/App.app/Frameworks/Capacitor.framework with Identity Apple Development: xxx@gmail.com (7FSK2UE87Y)
/usr/bin/codesign --force --sign 7B0B8B04EB8EB60F0EB9540253FEC8FB09E379AC --preserve-metadata=identifier,entitlements '/Users/simonhill/Library/Developer/Xcode/DerivedData/App-buuhfmnvjxqcivakwsfsgrdpsrjw/Build/Products/Debug-iphoneos/App.app/Frameworks/Capacitor.framework'
Warning: unable to build chain to self-signed root for signer "Apple Development: simonhill303@gmail.com (7FSK2UE87Y)"
/Users/simonhill/Library/Developer/Xcode/DerivedData/App-buuhfmnvjxqcivakwsfsgrdpsrjw/Build/Products/Debug-iphoneos/App.app/Frameworks/Capacitor.framework: errSecInternalComponent
I followed the instructions to create my Apple cert and don't understand how to fix this error. I tried this answer Error Xcode 10 . PhaseScriptExecution failed with a nonzero exit code: errSecInternalComponent but could not get it to work.
UPDATE It may be this problem https://developer.apple.com/support/expiration/:
Known Issues Xcode 11.4.0 and earlier may not be able to sign software using signing certificates issued by the new Apple Worldwide Developer Relations Certification Intermediate Certificate. If you’re unable to upgrade to a supporting version of macOS or Xcode on your build machine, you can build and archive your app using an earlier Xcode client and sign it for distribution using the latest release. Alternatively, you can utilize the codesign tool to sign your software using the command line.
Definitely seems like this problem: https://developer.apple.com/forums/thread/660087
Updating XCode fixed the problem (12.4).