Why does Xcode keep recompiling my untouched project?

荒凉一梦 提交于 2019-12-03 12:25:49

问题


I have an Xcode 4 workspace with several projects. Everything builds perfectly and works as expected, only Xcode recompiles files too often. If I hit the Build button, wait for the compilation to succeed and then hit the button again, shouldn’t that be essentialy a no-op, since no files have changed? Because my Xcode recompiles a big part of the project again. Even when I build and then immediately hit the Play button, I have to stare at the building process again. Is that neccessary, is it expected behaviour?


回答1:


Shot in the dark, but do you have external xcode projects linked? XCode may be recompiling because it doesn't know the state of those projects.

Either way, you can always Run Without Building ^⌘R (control + command + r)




回答2:


Are you executing custom scripts that change files before compilation? This will result that xcode will recompile all touched files even though maybe nothing changed. You can turn this off by enabling a checkmark in the run script build phase. This will execute the script only on installation of the app.

The image below shows the actual checkmark.



来源:https://stackoverflow.com/questions/7412478/why-does-xcode-keep-recompiling-my-untouched-project

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