Xcode 8 Command Line Tools Missing (Git, Clang, etc) - ios

Two days ago, I upgraded to OSX Sierra. My development tools seemed to be working fine after that.
However, today I upgraded Xcode 7.3.1 -> 8.1 to make certain features work for React-Native development. To be precise, I deleted the 7.3.1 and installed 8.1 anew. That is where the woes had started.
In particular, it seems that most of the Command Line Tools are gone. I get errors when trying to use git as well as other commands. I was able to get Git back after installing from .dmg file.
I have also tried installing Command Line Tools using xcode-select --install to no avail. Installation proceeds, but none of the tools become available afterwards.
As an example of what is happening, the following are the errors I receive when running: curl -sSL https://get.rvm.io | bash -s stable --ruby
xcodebuild: error: SDK "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk" cannot be located.
gcc: error: unable to find utility "gcc", not a developer tool or in PATH
configure: error: clang version 3.0 or later is required
Does someone know what the issue might be and how one goes about getting the development environment set up on Sierra + Xcode 8.1?

This error occurred after installing the new version of Xcode.
Just restarting helped for me. Sometimes, even quitting and restarting Terminal might also help.

The problem is that you need to repoint the command line tools to the new copy of Xcode. You can use xcode-select to do that, but the easiest way is, in Xcode, go to Preferences > Locations and choose the correct Xcode for the Command Line Tools pop-up menu at the bottom.
Also pls note that in order to use xcode-select you need to use sudo.

Related

Flutter Doctor : Xcode installation is incomplete

I have an app created with Flutter want to build it in IOS.
When i want to run simulator or build the I get error ,When I run Flutter doctor I get this error L
Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
I was facing the same issue. I did not installed Xcode from Apple Store. If your scenario is same, you can try below steps,
Open Xcode
Go to Preferences -> Location tab
You will find "Command Line Tools" option. If it is blank, select the Xcode version from list (see image below). It will ask for password or Touchid to update it.
Run flutter doctor again. It should resolve the issue
You probably miss the xcode command line tools, you may want to reinstall XCode, or select the xcode command line tools with the command xcode-select
Here's a full fix that should solve your problem: https://github.com/flutter/flutter/issues/6308#issuecomment-257812324
So, I was facing this same issue, and tried to and copy paste the command already given. Namely
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
But why did it not work? Silly mistake of mine: I have two Xcode versions in my Applications folder. One is called Xcode_12_3_0 and the other Xcode_12_5_1. Make sure that, when you run the command, you also make sure you enter your app's real name. For instance:
sudo xcode-select -s /Applications/Xcode_12_5_1.app/Contents/Developer
An answer for us, absent-minded people.
If you already have Xcode and this happens. Just run this command
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
And
sudo xcodebuild -runFirstLaunch
It will automatically show

Xcode command line tools (two versions side by side)

Recently we've moved to Xcode 8 in order to compile the app with new Xcode version, but I still need to use Old Xcode (7.3.1) in order to use it's instruments with older ver of appium ...
I was wondering if there is a way to open each Xcode ver and to use it's relevant command line tools? currently , the command line tools I set in specific version is being used among two Xcode versions ...
Thanks!
I am using X-code 7.3.3. to run appium test and Xcode-8 to build app under test. I have moved xocde8 into folder name "xcode8".
And to switch between different Xcode version you can use -
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
sudo xcode-select -s /Applications/xcode8/Xcode-8.app/Contents/Developer/
If you have a particular version of Xcode (say Xcode 8) installed in your system, go to /Applications and rename it to something else like Xcode8 or Xcode7.3.1. Install the other version normally. Now you have both versions running in different names.
I hope this is what you were looking for..

I get "xcrun: error: SDK "iphonesimulator" cannot be located" when running the toolchain

I am trying to compile a Kivy program onto iOS, but when I run the command to build the Kivy distro I keep getting this error:
xcrun: error: SDK "iphonesimulator" cannot be located
I have xcode on my computer. What is going on?
A bit late, but I had the same error experimenting with kivy and this helped me:
Open in XCode Preferences, tab into Locations and take a look at your Command Line Tools selection. Mine was empty. When I changed it to the current used version suddenly the error was gone. I found this solution here (bottom): https://groups.google.com/forum/#!topic/rubymotion/Xw8gPcr2Fl8
If there is still something missing you can try to download an older IOS version to be sure there is something installed. Next to your appname you can select the device, click on it and select Download Simulations... and select the IOS you wish. I have done this step before the above, so I don't know if it's necessary.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
reason: if you download the xcode more than one version . the path is not only one....
It fixed for me once I downloaded the previous version of the simulator in my local.

Fabric release Xcode 6.3 codesign xcode-select

I'm trying to upload a release to Fabric & I'm getting errors as follows. I'm using the Xcode 6.3 (recently updated).
Xcode: 6.3
Fabric: 1.1.3
OSX: 10.10.3
What should I do to resolve above error & continue uploading the release via fabric desktop tool?
Is there any other way to upload binary to fabric?
Mike from Fabric here.
1) To clear that error from Fabric.app: Quit Fabric.app, then run this command to clear the local cache:
rm -rf ~/Library/Caches/com.crashlytics.mac
You may also need to clear:
rm -rf ~/Library/Caches/com.crashlytics
rm -rf ~/Library/Caches/com.crashlytics.data
rm -rf ~/Library/Caches/com.crashlytics.run
Then restart Fabric.app and you'll be all set!
2) To distribute outside of Fabric.app, use either method mentioned here.
If you have multiple versions of Xcode installed on your system you may need to ensure the command line tools are set for the version of Xcode you're attempting to build from.
Navigate to "Locations" in Xcode preferences (select Xcode from the menu bar, then "Preferences..." then "Locations"). In the drop down next to "Command Line Tools:" select the version of Xcode you're using and then attempt a build.
I had this problem because I have 4 versions of Xcode on my mac, and none of them are named simply 'Xcode'. So, I changed the desired version name from Xcode8.1 back to Xcode.
This part might not apply to most people: If you're using the xcode-select tool (you should if you have multiple versions of xcode on your computer) then you need to make sure xcode-select is pointing to the correct version with the correct name.
The solution for using Xcode beta version
I assume this is due to archive in Xcode beta and the path location does not match. Of course, I experienced this and it worked. Just do this step:
sudo xcode-select --switch /Applications/Xcode-beta.app/
And do upload to Fabric again.

Xcode stops working after set "xcode-select -switch"

OMG, what I've done?
Couple of days ago, I tried using macport to install something, because I'm using Xcode 4.3 and the command-line tool hadn't been installed by the time, macport wouldn't work. So I followed some guide to get command-line tool installed, then I used following command:
sudo xcode-select -switch /Applications/Xcode.app/
which I think screwed everything except macport: now, in Xcode, even a simple single-view iOS project won't be compiled, it says "UIKit/UIKit.h not found".
Does anyone know how to correct this? I don't want to re-install the gigantic Xcode again, gotta do some iOS project tonight, help!
You should be pointing it towards the Developer directory, not the Xcode application bundle. Run this:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
With recent versions of Xcode, you can go to Xcode ➙ Preferences… ➙ Locations and pick one of the options for Command Line Tools to set the location.

Resources