xcode 如何重建开发 pod 更改?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50552752/
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
How to rebuild development pod changes?
提问by Gikas
I have a development pod that I connect to the my app locally using :path => '~/Projects/Swift/pod'
. When I make changes inside the application code in that development pod, this changes are not included after build. It's like I'm build cached code, not my code changes.
我有一个开发 pod,我使用:path => '~/Projects/Swift/pod'
. 当我在该开发 pod 中的应用程序代码中进行更改时,构建后不包括这些更改。这就像我在构建缓存代码,而不是我的代码更改。
For include code changes into build I have to run the command "Clean Build Folder", but after that build takes a very long time, for 10 minutes, which is not very productive.
对于将代码更改包含到构建中,我必须运行命令“Clean Build Folder”,但是在构建之后需要很长时间,10 分钟,这不是很有效率。
Literally, I comment on a line of code and wait 10 minutes to see the changes.
从字面上看,我对一行代码发表评论并等待 10 分钟以查看更改。
What is the problem?
问题是什么?
I was trying to run "pod install/pod update" after any changes, but it has no effect.
我试图在任何更改后运行“pod install/pod update”,但没有效果。
采纳答案by Won
I'm using to below.
我习惯了下面。
Product -> Schemes -> EditScheme -> Build -> Add a development Pods ("+" sign)
回答by Ahti
I had the same issue with Xcode 10.0 (10A255). Changing back to the legacy build system (in File -> Project/Workspace Settings) worked for me to resolve the issue for now, until this is fixed by either Cocoapds or Xcode.
我在 Xcode 10.0 (10A255) 上遇到了同样的问题。改回旧版构建系统(在文件 -> 项目/工作区设置中)对我来说暂时解决了这个问题,直到 Cocoapds 或 Xcode 修复了这个问题。
回答by Alibaba
While Changing back to the legacy build system works, the build time might increase in some large projects. An alternate solution is to add this run script find "${SRCROOT}/Pods" -type f -name *frameworks.sh -exec bash -c "touch \"{}\"" \;
to touch all framework scripts under your project's Build Phases->Embed Pods Framework. This should pickup your new changes until this bug is fixed.
虽然改回传统构建系统有效,但在某些大型项目中构建时间可能会增加。另一种解决方案是添加此运行脚本find "${SRCROOT}/Pods" -type f -name *frameworks.sh -exec bash -c "touch \"{}\"" \;
以访问项目的 Build Phases->Embed Pods Framework 下的所有框架脚本。这应该会获取您的新更改,直到修复此错误为止。
回答by nickgzzjr
As a workaround I've been manually "cleaning" out my development pods.
作为一种解决方法,我一直在手动“清理”我的开发 pod。
- In the
Pods
project openProducts
select the development pod framework(s) - In the inspector on the right I select the arrow which opens Finder
- Delete the framework(s)
- Build/Run
- 在
Pods
项目 open 中Products
选择开发 pod framework(s) - 在右侧的检查器中,我选择打开 Finder 的箭头
- 删除框架
- 构建/运行
Hope that helps, and that Apple fixes this soon...
希望有所帮助,Apple 尽快修复此问题...
P.S. Will definitely be writing a simple script to do this.
PS 肯定会写一个简单的脚本来做到这一点。
Update 9/25/18
18 年 9 月 25 日更新
Also seems like sometimes I must delete the Intermediate build(s) as well.
似乎有时我也必须删除中间版本。
Update 9/23/19
19 年 9 月 23 日更新
Looks like it was fixed in CocoaPods 1.8.0 (Wow, it been a whole year...)
看起来它是在 CocoaPods 1.8.0 中修复的(哇,已经整整一年了......)
回答by Saren Inden
I have not yet a practical automatic solution for this. But manually you can do CMD + shift + k
or product -> clean build folder
.
我还没有一个实用的自动解决方案。但是您可以手动执行CMD + shift + k
或product -> clean build folder
。
But then the entire project needs to be build again. If you have a lot of pods/frameworks or source code this can take some time to recompile.
但是整个项目需要重新构建。如果你有很多 pods/frameworks 或源代码,这可能需要一些时间来重新编译。
Like other people mention it seems to be a bug related to the new build system. So you can switch back to the old system.
就像其他人提到的那样,这似乎是与新构建系统相关的错误。所以你可以切换回旧系统。
Both not really good solutions. But that is the price we pay for working with apple ;).
两者都不是很好的解决方案。但这就是我们为与苹果合作付出的代价;)。
回答by BB9z
I'm working with development pods for a while, it works fine at most of the time. Changes don't take effect like you only happens a few times.
我正在使用开发 pod 一段时间,它在大多数情况下都可以正常工作。更改不会生效,因为您只会发生几次。
Delete the Pods
folder and reinstall might fix the problem.
删除Pods
文件夹并重新安装可能会解决问题。
Update:
更新:
I have to declare that my answer is not for the situation after Xcode 10. For Xcode 10, CocoaPods may not support the new build system at this time.They had fixed it https://github.com/CocoaPods/CocoaPods/issues/8073
不得不声明,我的回答不是针对Xcode 10之后的情况。对于Xcode 10,CocoaPods此时可能不支持新的构建系统。他们已经修复了它https://github.com/CocoaPods/CocoaPods/issues/8073
In my case (before Xcode 10), most of the time it works well, except few.
就我而言(在 Xcode 10 之前),除了少数情况外,大多数情况下它都运行良好。