How to stop programs stealing focus when initializing a build in XCode?
You can add this to the Info.plist of Xcode to make it launch in the background:

&lt;key&gt;LSBackgroundOnly&lt;/key&gt;
&lt;string&gt;True&lt;/string&gt;


(You might need to get write privileges on the Info.plist if you downloaded Xcode from the Mac App Store)

Source and details about what it can break: http://reviews.cnet.com/8301-13727_7-20085680-263/keep-applications-from-stealing-focus-when-opening-in-os-x/