Slow app compilation with new Sierra update

谁说我不能喝 提交于 2019-12-12 07:08:06

问题


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)

  1. Install the latest beta version

gem install cocoapods --pre

  1. Go to your Xcode target build settings and click the + icon at the top

  1. Set COCOAPODS_PARALLEL_CODE_SIGN to true

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!