问题
When I updated my mac to macOS Sierra 10.12.1 time of running application on real device significantly increased. "Run custom script 'Embed Pods Frameworks'" and "Copy Swift standard libraries" take more then 30 minutes to build.
Do someone face the same issue?
回答1:
Check your keychain. After updating to Sierra to 10.12.1, I had over 500 copies one of my certificates, and a few others were duplicated a few hundred times.
I removed all the duplicates and kept just one of each, and my code signing time went from 30 seconds per framework down to about 1 second per.
I don't know how or why the certificates were duplicated, but the timing of the issue suggests it was due to updating Sierra.
回答2:
2017-03-23 Update
You can skip installing the beta version of CocoaPods, because the COCOAPODS_PARALLEL_CODE_SIGN
flag is also evaluated in the current release build.
Original Answer
Found an alternative solution, not best, but at least it's speeding up. It works (for me)
Cocoapods released a new beta version few days ago.
Which allows parallel code signing when running the embed framework script (https://github.com/CocoaPods/CocoaPods/pull/6088#issuecomment-257441733)
- Install the latest beta version
gem install cocoapods --pre
- Go to your Xcode target build settings and click the
+
icon at the top
- Set
COCOAPODS_PARALLEL_CODE_SIGN
totrue
And enjoy the increased building speed!
回答3:
If keychain looks good, but problems exists – check the preferences and remove all duplicates in this file:
~/Library/Preferences/com.apple.security.plist
For typical setup this file must contain only one record with login keychain reference.
回答4:
All the above mentioned approaches didn't work for me. What helped a lot was resetting the System.keychain
, which had 25 MB size. This speeded up build times up to 40% on our CI system.
Analyze
du -h /Library/Keychains/System.keychain
good: 60K
bad: 25MB
Reset
sudo systemkeychain -vfcC [password]
Attention: If you have important keys/certs/passwords stored in your System.keychain, you may want to export them before performing the reset and then reimport them on demand. This wasn't necessary for me. My new System.keychain has no content and building projects works absolutely fine.
来源:https://stackoverflow.com/questions/40257968/slow-app-compilation-with-new-sierra-update