运行 2 个自定义 shell 脚本中的 1 个在 Xcode 中卡住了 2 分钟
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40531545/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Running 1 of 2 custom shell script stuck for 2 minutes in Xcode
提问by Gent Berani
Running 1 of 2 custom shell scriptsit stuck for 2 minutes while trying to build the app.
运行 2 个自定义 shell 脚本中的 1 个,它在尝试构建应用程序时卡住了 2 分钟。
I tried to fix with the solution :Xcode custom shell scripts are slowing down the compiling time, but still it slows the build process :(.
我尝试使用解决方案进行修复:Xcode 自定义 shell 脚本减慢了编译时间,但它仍然减慢了构建过程:(。
- Build Stuck for 2m here
- 在这里建造卡住 2m
Further informations:
更多信息:
Xcode 8.1
Swift 3.0
Xcode 8.1
斯威夫特 3.0
Podfile:
播客文件:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'MyProject' do
# Network
pod 'Alamofire'
pod 'SwiftyJSON'
# UI side
pod 'Material', git: 'https://github.com/CosmicMind/Material.git', branch: 'development'
pod 'SDWebImage'
pod 'UIScrollView-InfiniteScroll'
pod 'TPKeyboardAvoiding'
pod 'SwiftKeychainWrapper', git: 'https://github.com/jrendel/SwiftKeychainWrapper.git', branch: 'develop'
pod 'DropDown'
# Facebook
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'
# Autolayout
pod 'SnapKit'
pod 'KeepLayout'
# Metrics
pod 'Google/Analytics'
# Fabric.io
pod 'Fabric'
pod 'Crashlytics'
end
target 'MyProjectTests' do
end
target 'MyProjectUITests' do
end
回答by Gent Berani
Finally, I found a solution for this. At least the total build time now is 57sec.
最后,我找到了解决方案。至少现在的总构建时间是57 秒。
I found that 'Embed Pods Framework'
(Once 'Embed Pods Framework'
and 'CP Embed Pods Framework'
) builds twice. Anyway, I don't have an idea why I have both of them on build phases.
我发现'Embed Pods Framework'
(Once'Embed Pods Framework'
和'CP Embed Pods Framework'
) 构建了两次。无论如何,我不知道为什么我将它们都放在构建阶段。
I found for this on Report Navigator.
Solution:
解决方案:
1) I let only active ? Run script only when installing
only for'[CP]Embed Pods Framework'
2) Optimization Level on Build Settings for debug was
-None
. I set to Fast..
.
1) 我只让激活? Run script only when installing
仅用于'[CP]Embed Pods Framework'
2) 调试的构建设置的优化级别是
-None
. 我设置为Fast..
。
3) Tip: use Simulatorinstead of Devicefor minimal build time.
3) 提示:使用模拟器而不是设备来最小化构建时间。
回答by aashish tamsya
Added this at the end of you Podfile
在你的最后添加了这个 Podfile
post_install do |installer|
puts("Update debug pod settings to speed up build time")
Dir.glob(File.join("Pods", "**", "Pods*{debug,Private}.xcconfig")).each do |file|
File.open(file, 'a') { |f| f.puts "\nDEBUG_INFORMATION_FORMAT = dwarf" }
end
end