How to prevent Xcode from rebuilding project every time
Asked Answered
S

1

23

I have a Mac OS X app that consists of a main target and a dependent framework. Since enabling code-signing on my Mac OS X app, I noticed Xcode rebuilds the main target every time I run it, even if I haven't touched a line of code.

This is a problem because the dependent framework needs to know the CRC of the main target file. Every time Xcode rebuilds the main target, the CRC changes.

Before code-signing, I would build the main target once, generate the CRC, enter the CRC into my framework code, and build the main target again. Xcode would notice only the framework changed so it wouldn't rebuild the main target.

Any suggestions?

Sylvan answered 18/4, 2012 at 6:29 Comment(2)
When you run something without building, you could't see changes you made in code. Xcode simply runs the executable on your disk.Biron
I couldn't figure out a great way around this so I simply removed the CRC checking code.Sylvan
L
36

There is actually an option in Xcode to run without building the code first. Select the "Run Without Building" option under Product > Perform Action. The hotkey for this is ctrl + cmd + R.

Lisandralisbeth answered 30/8, 2012 at 15:40 Comment(3)
What does this achieve though? What is the purpose of running without building? Can you run without building every time?Toadfish
Nice one @robhasacamera. To add: You can control-click on the Play button which appears in the gutter next to a test class or test method declaration to see a list of options as follows: Run Without Testing, Run Repeatedly, Run Repeatedly Without Building.Euthenics
Not sure how I made it this far in life without this feature. I feel like this was the default in older versions of XCode but I'm not 100% sure about that. Anyway, XCode 14 was building every single time and driving me insane. Thank you.Hatley

© 2022 - 2024 — McMap. All rights reserved.