This beta has added (or at least rearranged) the SDKs to include
WatchOS. This results in SDK_IOS_VERSION finding the WatchOS version
number (2.0) instead of the iOS SDK version number.
Fix this by rewriting the lines that handle xcodebuild to use
different logic that is more robust.
Tested on Xcode 6.4 and Xcode 7.0 beta 5.
Use xcode-select --print-path to find the currently selected Xcode.
This avoids hardcoding /Applications/Xcode.app, so that it is
possible to use Xcode from non-standard locations (I have Xcode4
and Xcode5 installed in parallel).
Note that it is not possible to have Xcode installed in a path
with a space (I used "Xcode 5" originally). I tried to fix this
but it looks like sasl's configure and build would never manage it.