Incremental builds using xcodebuild are very slow, around 3x slower when compared to the same build using Xcode.
Recently, I discovered that CODE_SIGNING_ALLOWED=NO" fixed the issue, but of course, I can't then run iOS app.
It seems like automatic signing using xcodebuild is somehow broken. Therefore, I think I could set CODE_SIGNING_ALLOWED=NO" and sign it manually later. However, I'm not sure how to do that.
I checked what Xcode does and it's:
/usr/bin/codesign --force --sign - --entitlements /Users/wkulik/Library/Developer/Xcode/DerivedData/XYZ-hblnhsksxjrctzekqmlevcflnsji/Build/Intermediates.noindex/XYZ.build/Debug-iphonesimulator/XYZ.build/XYZ.app.xcent --timestamp\=none --generate-entitlement-der /Users/wkulik/Library/Developer/Xcode/DerivedData/XYZ-hblnhsksxjrctzekqmlevcflnsji/Build/Products/Debug-iphonesimulator/XYZ.app
However, if I run xcodebuild with disabled signing I don't have XYZ.app.xcent required by this command.
I also tried:
codesign --force --deep --sign "Apple Development: John Snow (XYZ)" /Users/wkulik/Library/Developer/Xcode/DerivedData/XYZ-hblnhsksxjrctzekqmlevcflnsji/Build/Products/Debug-iphonesimulator/XYZ.app
but the app immediately terminates (the same way like when unsigned).
Could anyone help with that?
Is this for iOS or macOS code signing? For iOS, we don't provide support for using command line tools, but for macOS we do.
Our engineering teams need to investigate the reasons why you're trying to resort to these measures. It's possible that investigation may result in changes to Apple's software.
Please open a feedback report (aka bug report), include a copy of your signing log and a copy of your .xcodeproj file in .zip format, and post the feedback number here once you do.
Here are some directions for finding the signing log: In Xcode‘s Navigator area, click on the Report navigator on the right side of the Navigator bar, and select the most recent signing log in the list displayed in the Navigator area. Once you have selected the signing log, use the Export button at the top of the Editor area to save the log as a file.
Also, I recommend including the following screenshots:
- the error message you are receiving or other problematic behavior
- the Xcode project > Target > General tab (include one for every target)
- the Xcode project > Target > Build Settings -> Code Signing (please select the combined view, include one for every target)
- Select your account with Xcode's Preferences menu > Accounts then click View Details… and take a screenshot.
- Open Keychain Access (in /Applications/Utilities) and click the Category titled Certificates and then type “Development” into the search bar at the top right corner of the window. Take a screenshot.
- Continuing in Keychain Access, type “Distribution” into the search bar at the top right corner of the window. Take a screenshot.
NOTE: To take a screenshot in macOS, press: Command+Shift+3. Please do not crop or resize the screenshots.
Bug Reporting: How and Why? has tips on creating your bug report.