Terminal does not find the installed Xcode - xcode

i have download and installed the Xcode 12.4 from apple site (not apple store) because I am using macOS Catalina 10.15.7 and the latest Xcode version right now requires at-least BigSur 11.0. I have also installed the latest Xcode command line tools.
But when i try to open my react native project in Xcode simulator from terminal using npm run ios it says,
"Xcode needs to be installed (don't worry, you won't have to use it), would you like to continue to the App Store? › (Y/n)"
By the way, I am a new mac user so, i don't know much about it yet. So, any kind of help will be appreciated.

My bad, i have not selected the installed command line tools in Xcode. If anybody got this issue then make sure you also select the installed command line tools. Simply open Xcode, go to preference -> locations -> command line tools.

If you're having this issue, running this in the terminal may fix it for you.
sudo xcode-select -s /Applications/Xcode.app

Open Xcode
go to settings
go to locations tab
select an Xcode version in the select labeled "Command Line Tools"

Related

xcode 10.0 on Macports

I am new to using Macports to download software I have just upgraded to Mojave and have made sure I have the latest versions of both Macports and Xcode command line tools. I have been getting the message
Warning: xcodebuild exists but failed to execute
when trying to download gnuradio. I then used 'port diagnose' and received the following message:
Error: currently installed version of Xcode, none, is not supported by MacPorts. For your currently installed system, only the following versions of Xcode are supported: 10.0
This is despite the fact that I am using xcode 10.0 and have never run anything earlier than that. Am I missing something or could it be that Mojave hasn't been available for long enough for possible bugs to be solved with the programs. If anybody has an alternate way of running gnuradio-companion i'd be happy to hear. I have already tried via home-brew but ran into problems with that as well.
Thanks for your help,
Arthur
#Wallace Huang's answer worked for me (Mojave 10.14.6):
Open Xcode
Select Preferences -> Locations
Command Line Tools version gives a drop down menu and I was able to select the single option for which version of Command Line tools I have.
Screen shot of Xcode Preferences
In Xcode 10, go to Preferences, select Locations tab, and choose a version in Command Line Tools. On a fresh install, this field is blank (hence your version is "none").

Installing command line tools Xcode 5

I have tried and tried (looked at many headings for this) and I still don't have an answer to my problem. I am trying to install the Pebble SDK 1.12 and install command line tools of Xcode 5.
Everytime I try xcode-select --install in terminal I get "Can't install software because it is not currently available in the Software Update server"
I have tried to reinstall Xcode and that didn't work.
When I got to Xcode-preferences-downloads there isn't a section for the command line tools.
I have also tried installing them from the Developer site but to no avail. The download looks correct and then I go to Xcode to see the preferences and the command line tools aren't listed.
Anything you all can suggest?
Using xcode-select --install in Terminal and choose install tools
On OS X 10.9, the Command Line Tools component no longer appears in the Preferences pane for Xcode 5, unlike on OS X 10.8. Also, the not currently available message appears to be a bug in OS X 10.9 when the currently installed Command Line Tools are already up-to-date. If you have a populated /usr/include directory and /usr/bin/cc --version gives you something, you're probably fine.

How to install Xcode Command Line Tools

How do I get the command-line build tools installed with the current Xcode/Mac OS X v10.8 (Mountain Lion) or later?
Unlike Xcode there is no installer, it's just a bundle.
It looks like all the command line tools are in the bundle, under Contents/Developer, but none of the appropriate environment variables are set to use them.
Is there a script I can run that will set-up my environment to support building from the command line?
Xcode 5.1 and OSX 10.9. (also works with Xcode 5.1.1 + OSX 10.10)
xcode-select --install worked with version 2333, failed with version 2003. So, try xcode-select --install and if that does not work download as described below.
In early February 2014 xcode-select --install has been reporting that "Can't install the software because it is not currently available from the Software Update server". In late February 2014 the command started only displaying help. The solution is to download directly, see "Separate Download" below.
Xcode 5.0.1 and OSX 10.9
With Xcode 5.0.1 and Mavericks 10.9 the command line tool is no longer available through Xcode. Instead they must be downloaded from the Apple Developer Tools site: https://developer.apple.com/downloads/index.action. This requires signing in with a developer account.
Or via terminal (from the release docs): The Command Line Developer Tools package can be installed on demand using "xcode-select --install” and the installed tools will be automatically updated using Software Update. OS X 10.9 is required for this feature. For earlier versions, continue to use the in-app download in Xcode.
Running the command in terminal produces the following GUI:
Inside Xcode (5.0)
Xcode includes a new "Downloads" preference pane to install optional components such as command line tools, and previous iOS Simulators. To open this pane click the "Xcode" button in the top left of the screen near the Apple logo, then click "Preferences", then click "Downloads".
Xcode 5.0 screenshot:
Xcode 4.x screenshot:
Separate Download
If you do not have Xcode, they are available as a separate download from Apple:
Go to developer.apple.com/downloads/index.action, and sign in with your Apple ID (the download's free). In the pane on the left, search for "command line tools" and choose the package appropriate to your version of OS X. Requires Mac OS X 10.7.3 or later.
If you take a look into "Console" while trying to pull the Command Line Tools, you will find out that there is actually an "unofficial" link to the Mountain Lion Command Line Tools!
So just try:
http://adcdownload.apple.com/ios/ios_simulator__resigned/cltools_mountainliondp2_march12.dmg
Here is my Console log:
01/04/2012 15:41:54.258 Xcode: [MT] DVTDownloadable: Download failed. Downloadable: {
dependencies = (
);
fileSize = 141452226;
identifier = "Xcode.CLTools.10.8";
name = "Command Line Tools";
source = "http://adcdownload.apple.com/ios/ios_simulator__resigned/cltools_mountainliondp2_march12.dmg";
userInfo = {
ActivationPredicate = "$MAC_OS_X_VERSION >= '10.8.0' && $MAC_OS_X_VERSION < '10.9.0'";
InstallPrefix = "/";
InstalledIfAllSHA1SumsMatch = {
"/usr/bin/clang" = 600c35175775a6002452a88f17e00c570cd2e2d0;
};
Summary = "Before installing, note that from within Terminal you can use the XCRUN tool to launch compilers and other tools embedded within the Xcode application. Use the XCODE-SELECT tool to define which version of Xcode is active. Type \"man xcrun\" from within Terminal to find out more.\n\nDownloading this package will install copies of the core command line tools and system headers into system folders, including the LLVM compiler, linker, and build tools.";
"Xcode.SDKs" = (
);
};
version = "1.1.1";
}. Error: Error Domain=NSCocoaErrorDomain Code=3840 "The data couldn’t be read because it has been corrupted." (Encountered unknown ampersand-escape sequence at line 18) UserInfo=0x401bc8e60 {NSDebugDescription=Encountered unknown ampersand-escape sequence at line 18, kCFPropertyListOldStyleParsingError=The data couldn’t be read because it has been corrupted.}
Here are links for Command Line Tools, located at Apple Developer Server. You may need an apple developer (Paid/Premium) account to access them. You can download current (stable and beta) Xcode Tools. (It does not need device verification. Just ensure your macOS and XCode Tool/SDK version while choosing your command line tool)
Xcode 13 RC
Xcode 13 RC
- (Command Line Tool (Xcode 13 RC) - for macOS BigSur +)
Once you've latest command line tool installed in your system, set it from Xcode Menu.
(Xcode Menu Items) Xcode ▶ Preferences ▶ Location ▶ Command Line Tool ▶ Select appropriate command line tool
As of big sur..
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Thanks homebrew maintainers for putting this helpful messaging in brew doctor
The "unofficial" links are also available at
http://developer.apple.com/downloads/
and 403: Forbidden unless logged in with a qualifying developer account. Free accounts have access to everything except prerelease software and full OS installs. In particular, the command-line tools packages that coincide with the release of Xcode 4.4 (the "July 2012" packages) were posted on July 27, for both Lion and Mountain Lion.
Unlike log files, deep-linking Web pages, and the Xcode Preferences window, this page also links to lots of other useful downloads for free and paid developers alike, including everything else that has been unbundled from Xcode (audio tools, accessibility tools, etc.), OS X kernel debug builds, and release versions of Xcode back to 1.0.
Instead of installing the "official" build of the command line tools from Apple, you can also install Kenneth's build from here:
https://github.com/kennethreitz/osx-gcc-installer
It doesn't even require XCode if all you are after is the command line tools.
I recently had to install Xcode command line tools on Mountain Lion over SSH.
Notice: I imagine this process would work identically for any version of Xcode or OSX. Just make sure you get your paths correct.
Here's how I did it...
If you don't have a free Apple developer account, register for one
Login to https://developer.apple.com/downloads
Download the "Command Line Tools for Xcode" appropriate for your version of OSX
For me, that was "Command Line Tools (OS X Mountain Lion) for Xcode - April 2014"
Copy the dmg file to your remote
In the following command, I'm using scp to securely copy the file from my local computer to the remote named remote
$ scp ~/Downloads/command_line_tools_for_osx_mountain_lion_april_2014.dmg remote:Downloads/
ssh to your remote
$ ssh remote
mount the dmg file on the remote
Here, I'm using hdiutil to mount the image
$ hdiutil attach ~/Downloads/command_line_tools_for_osx_mountain_lion_april_2014.dmg
install the package contained in the dmg
Here, installer must be run with sudo because this package needs to be installed on the root file system
$ cd /Volumes/Command\ Line\ Tools\ \(Mountain\ Lion\)
$ sudo installer -pkg Command\ Line\ Tools\ \(Mountain\ Lion\).mpkg -target /
unmount the dmg file
$ hdiutil detach /Volumes/Command\ Line\ Tools\ \(Mountain\ Lion\)
delete the dmg file from the remote; optional
I see no purpose keeping it around, but you can if you want.
$ rm ~/Downloads/command_line_tools_for_osx_mountain_lion_april_2014.dmg
You can automate the installation of Command-Line Tools in bash. I needed to do this when I was automating the developer onboarding setup process.
xcode-select --install && sleep 1
osascript -e 'tell application "System Events"' -e 'tell process "Install Command Line Developer Tools"' -e 'keystroke return' -e 'click button "Agree" of window "License Agreement"' -e 'end tell' -e 'end tell'
Go to developer.apple.com/download/all/ (log in if you're not logged in)
Expand the "View Details" tool tip for "Command Line Tools" of the version you need
Download the .dmg file of those Command Line Tools
Once the .dmg file is downloaded, double click it and install it
If you want to use the version of tools provided in XCode itself you can use xcrun (e.g. xcrun git). From the help at the bottom of the download preference pane:
note that from within Terminal you can use the XCRUN tool to launch
compilers and other tools embedded within the Xcode application. Use
the XCODE-SELECT tool to define which version of Xcode is active.
Type "man xcrun" from within Terminal to find out more.
UPDATED: On Lion 10.7.4 the Command Line Tools are already available from withing XCode. You can get it freely from App Store.
The GCC for OSX won't compile some packages obtained from macports.
https://github.com/kennethreitz/osx-gcc-installer/downloads
By updating my Mac to the latest Mac OS (ie Big Sur), everything broke down to repetition request of installing Xcode-select.
It might seem weird, but I solved the problem by reinstalling & updating to the latest Xcode.
This is just my experience to solve the problem.
try going into Xcode > Preferences... > Downloads and clicking the button with a downward arrow in a circle next to command line tools.
xcode command line tools can be downloaded from here: https://developer.apple.com/downloads/index.action#
April 2014 version direct download link (for developers who just want to get started right away)
https://developer.apple.com/downloads/download.action?path=Developer_Tools/command_line_tools_os_x_mavericks_for_xcode__april_2014/command_line_tools_for_osx_mavericks_april_2014.dmg
How do I get the command line builds tools installed with Xcode 4.4 / Mac OS X v10.8 (Mountain Lion) or later?
For OS X 10.9, you simply install Xcode. The Command Line Tools are bundled with Xcode. From Technical Note TN2339, Building from the Command Line with Xcode FAQ:
Downloading command-line tools is not available in Xcode for OS X 10.9. How can I install them on my machine?
In OS X 10.9, the Downloads pane of Xcode Preferences does not support
downloading command-line tools. Use any of the following methods to
install command-line tools on your system:
If Xcode is installed on your machine, then there is no need to install
them. Xcode comes bundled with all your command-line tools. OS
X 10.9 includes shims or wrapper executables. These shims, installed
in /usr/bin, can map any tool included in /usr/bin to the
corresponding one inside Xcode. xcrun is one of such shims, which
allows you to find or run any tool inside Xcode from the command line.
Use it to invoke any tool within Xcode from the command line.
...
Xcode Command Line Tools can be installed as a side effect of running git --version in Terminal without Git installed. You will be prompted to install the tools as a requirement for running Git. Apple ships a binary of git with the Command Line tools. This is confirmed on the Git for Mac Download page. This seems like a valid option considering that Homebrew requires the Command Line tools to install Git as well according to another SO post. Otherwise, the previous answers are the most direct methods of install the tools.

How do i install additional packages for Xcode on OSX Lion to allow MacPorts to work

When I try and install MacPorts it complains
'Xcode is not installed, or was installed with UNIX Development (10.5+) or Command Line Support (10.4) deselected.'
I do have Xcode installed from the Appstore so I guess I just have to install these extra parts but how ?
Ive read a couple of questions on Stack Overflow about this but I think the answers must be outdated as they do notmake sense for me, I do not have an Xcode dmg I can reinstall from, and I can't see anything useful in /Developer either, or any preferences within Xcode itself.
I only want Xcode for the purposes of using Macports so I'm not familiar with it.
You probably got Xcode 4.1 from the Mac App Store. In that case, you haven't got Xcode 4.1 installed. However, you now have an Xcode installer in your Applications directory.
Spotlight should find it in any case.
The command line tools aren't included in the default install of Xcode anymore.
Goto the Xcode Preferences --> Downloads Pane --> click the Install button beside "Command Line Tools".
If you don't have Xcode installed you can get the command line tools separately as explained here..
http://osxdaily.com/2012/07/06/install-gcc-without-xcode-in-mac-os-x/
The App Store installs the XCode installer, not Xcode itself. The installer is in your applications folder. Run that.
Today, 16 Feb 2012, when I installed Xcode 4 from the App Store, there was no Setup. Just the app installed, because it was Xcode 4.3 !
Make sure that you install Xcode 4.2 with UNIX Devel. to MacPorts works!
To get the Xcode 4.2 go to https://developer.apple.com.

How to update Xcode to install "UNIX Development Support"?

I installed Xcode a long time ago.
Apparently I didn't check back then the "UNIX Development Support" checkbox.
Now I want to have them but when I click on the installation this is what appears:
The UNIX Development Support check box is disabled
Q: How can I install the UNIX Development Support? Is there a way to run some script that creates all the needed links from /Developer/ to /usr/bin ?
EDIT:
Note: This is for old Xcode 3. Screens and tool names differ for Xcode 4 ("Unix Command Line Tools")
With Xcode 4.3 (from Apple App Store) you can enable Unix Command Line Tools via the Xcode Menu: Preferences -> Download -> Components
In xcode > 4.5 select Preferences -> Download -> Components -> Command Line Tools
Finally.
I had to download from Apple's website the latest version of Xcode 3 (3.2) along with the iPhone SDK that I won't use in the near feature.
This time the "UNIX Development Support" was enabled:
So now I can compile from the command line!
In the Xcode .dmg file, there is a Packages folder. You can manually install DeveloperToolsCLI.pkg which creates the link in /usr/bin.
At least, it worked for me.
You can also right click the "Install Xcode X.X" icon and Show Package Contents then in Contents > Resources > Packages, you will find many packages from among which resides DeveloperToolsCLI.pkg. This package installs the files you want in /usr/bin.
You should uninstall and then re-install the developer tools.
To uninstall the tools, run the following command in Terminal:
sudo /Developer/Library/uninstall-devtools --mode=all

Resources