Why does Xcode keep recompiling my untouched proje

2019-03-15 21:59发布

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?

标签: xcode xcode4
2条回答
The star\"
2楼-- · 2019-03-15 22:38

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.

Run script image

查看更多
三岁会撩人
3楼-- · 2019-03-15 22:54

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)

查看更多
登录 后发表回答