Command Line Tools Not Found MacOS Monterey XCode13 - macos

I´m currently trying to resign a wrapped app from mobileiron with terminal.
When I try it says:
"sign_wrapped_app.sh Version 4.7.0.0
Usage: sign_wrapped_app.sh -i [-b -e -p -s -d -o ]
This script MUST be run on a computer with Xcode command-line tools installed.
jonasromankiewicz#MacBook-Pro-von-Jonas wrapping %"
I have MacOS Monterey on my MacBook Pro M1 2020
Xcode 13 Beta & I downloaded and installed CLT from the apple developer homepage.
I have the latest Version of Node, Homebrew, Ionic, Cordova installed.
I have tried to switch path. I have tried to reinstall CLT.
Also tried the Rosetta way...
Nothing worked. PLS Help :D
Thanks

Try to select your Command Line Tools in Xcode Preferences (⌘+, -> Locations)

Reinstalling both Xcode and CommandLineTools fixed the issue for me.
What I did:
Delete Xcode.app.
Delete CLT (sudo rm -rf /Library/Developer/CommandLineTools).
Download Xcode and CLT from Apple developer downloads. I installed the exact same version.
Install Xcode and then the CLT.
Reinstalling just CLT did not resolve the issue.
Related issues that helped me find the solution.

Related

_ctermid.h not found on macOS Mojave 10.14.6

On macOS Mojave 10.14.6 (18G7016), gcc can't find the file _ctermid.h anymore
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/wchar.h:90,
from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/cwchar:44,
from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/bits/postypes.h:40,
from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/bits/char_traits.h:40,
from /usr/local/Cellar/gcc/10.2.0_2/include/c++/10.2.0/string:40,
from /Users/Projects/test.h:10,
from /Users/Projects/test.cpp:1:
/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin18/10.2.0/include-fixed/stdio.h:219:10: fatal error: _ctermid.h: No such file or directory
219 | #include <_ctermid.h>
This was either caused by a macOS software update or brew upgrade.
This is might be related to an older question Can't compile C program on a Mac after upgrade to Mojave.
I tried the suggested solutions:
deleting the whole CommandLineTools folder with (sudo) rm -rf /Library/Developer/CommandLineTools and reinstalled it xcode-select --install
installed the macOS_SDK_headers_for_macOS_10.14 with open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
reinstalled brew and gcc (also gcc#9 and gcc#8)
None of them worked.
For some reason, xcode-select --install does not install the most recent Command Line Tools for macOS 10.14 (Mojave).
It always installs the version for Xcode 10.
To fix the issue, download and install Command Line Tools for Xcode 11.3.1. That’s the most recent version of the CLT that still work for Mojave.
In case the direct link above doesn’t work, go to “More Downloads for Apple Developers”, log in with an Apple Developer account, and search for “Command Line Tools for Xcode 11.3.1”. Note that this is not the most recent version of the CLT, but more recent versions can’t be installed on Mojave.

Brew install on Mojave

I did these steps:
Updated to Mojave
Installed Xcode 10 beta3
Ran this command: sudo xcode-select -switch /Applications/Xcode-beta.app/
Now I'm trying to install node8:
brew install node#8
And it gives me this error:
Error: The Command Line Tools header package must be installed on Mojave.
The installer is located at: /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Still, doing
install -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
does nothing, since there's no such file in my system. Where could I get it?
Go to /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg location and install package manually. And brew will start working.
I want to try and answer this question and also for those that come later that installed Mojave and had an older Xcode version installed. The process is the same minus that if you have Xcode 10, you don't need to install it again from my understanding.
The folder is hidden and was not accessible even with a sudo find command, however, I figured out that copying the absolute path and then pasting it in your browser address bar will give you the download and access to the folder that you need to fix brew install.
I posted a video here- https://youtu.be/GfnhSirTCGM that walks you thru part of my steps above. After you do the SDK headers download, its likely that unless you already are running Xcode 9.4, you will need to visit, https://developer.apple.com/download/more/ and look for Xcode 9.4 to install. Also grab the 10.14 command line tools as well. The lesson that should be learned here is that Apple calls it "Beta" for a reason and if you are a developer that knows the pains of setup, it is a bad idea. I hope that I was helpful! The last thing is, INSTALL XCODE THEN COMMAND LINE TOOLS-IN THAT ORDER OR IT ERRORS OUT! and then we do this all over again. Cheers!
It appears as though Apple has released a patch for the bug and it is available through the system preferences. 14 July 2018
Broken command line tools:
Xcode Location on the Apple developers website:
Location of command line tools:
Do not install Xcode from the Mac App Store because a different version is required!
Command line tools 10.14 update:
As of October 2018, the solution for making brew and brew install succeed is to:
install latest Xcode fom AppStore
run Xcode and install command line tools
add the line before to your profile or somethign similar
export CFLAGS="-I/usr/local/include -L/usr/local/lib -I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include"
No need to download Xcode manually, but you may want to remove the beta version if you installed it.
The magic part is at the end, where xcrun obtains the correct location of the SDK.
In terminal, you should first input the commands below
cd /Library/Developer/CommandLineTools/Packages
open .
you will open the directory on desktop,
then double click the pkg file to install it.

Command Line Tools bash (git) not working - macOS Sierra final release candidate

I have just upgraded from OS X 10.11 "El Capitan" to 10.12: "Sierra", and when I try to access git commands inside a terminal, I get the following error:
xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun
Please help me if anyone have solution.
Re-install Xcode developer tools
xcode-select --install
I fixed this issue by downloading and installing the 'Command Line Tools (macOS sierra) for Xcode 8' package from Apple Developer Downloads.
Be sure to select Command Line Tools (macOS 10.12) for Xcode 8 and not the one for 8.1 beta unless you have Xcode 8.1 beta installed.
I just recently upgraded to macOS High Sierra Version 10.13.3 and has existing xcode. My git command lines have the same issue. "$xcode-select --install" works perfectly for me.
Had same problem and with putting the git's path into profile directly it will not ask the xcode anymore (if you dont need to use xcode).
download the git, https://git-scm.com/download/mac and install it.
in your profile add to path, i.e. export PATH=$PATH:/usr/bin (mine git is in /usr/bin).
open new terminal.
Alone - xcode-select --install did not work for me.
Had to do all 3 steps:
Download X-code from app store (if not present in Applications folder)
$xcode-select --install
a. May need to update after install using softwareupdate in command line. $sudo softwareupdate -i "Command Line Tools (macOS High Sierra version 10.13) for Xcode-9.1"
$sudo xcodebuild -license

How can I find out if I have Xcode commandline tools installed?

I need to use gdb.
ps-MacBook-Air:AcoustoExport pi$ gdb
-bash: gdb: command not found
ps-MacBook-Air:AcoustoExport pi$ sudo find / -iname "*gdb*"
Password:
/usr/local/share/gdb
/usr/local/Cellar/isl/0.12.1/share/gdb
:
and:
ps-MacBook-Air:AcoustoExport pi$ ls -la /usr/local/share/gdb
lrwxr-xr-x 1 pi admin 30 14 Jan 22:01 gdb -> ../Cellar/isl/0.12.1/share/gdb
Not quite sure what to make this, clearly it is something installed by homebrew. I don't know why it's there, I don't know whether I could use it instead. It isn't in the search path.
So I figure I need Xcode commandline tools.
Xcode is not currently available from the Software Update server
^ my current problem exactly. Comment on that question says "you can get this error if you have them already"
But how do I check whether I have them already?
/usr/bin/xcodebuild -version
will give you the xcode version, run it via Terminal command
This command allows you to retrieve Xcode version when having only the CommandLineTools version installed:
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version
As per this answer to "Determine xcode command line tools version" on Ask Different
Notes:
Confirmed working on maxOS Sierra and Big Sur.
When only CommandLineTools is install without Xcode, using xcodebuild returns the following error:
# /usr/bin/xcodebuild -version
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
First of all, be sure that you have downloaded it or not. Open up your terminal application, and enter $ gcc if you have not installed it you will get an alert. You can verify that you have installed it by
$ xcode-select -p
/Library/Developer/CommandLineTools
And to be sure then enter $ gcc --version
You can read more about the process here: Xcode command line tools for Mavericks
if you want to know the install version of Xcode as well as Swift
language current version:
Use below simple command by using Terminal:
1. To get install Xcode Version
xcodebuild -version
2. To get install Swift language Version
swift --version
Thanks to the folks on Freenode's #macdev, here is some information:
In the old days before Xcode was on the app-store, it included commandline tools.
Now you get it from the store, and with this new mechanism it can't install extra things outside of the Xcode.app, so you have to manually do it yourself, by:
xcode-select --install
On Xcode 4.x you can check to see if they are installed from within the Xcode
UI:
On Xcode 5.x it is now here:
My problem of finding gcc/gdb is that they have been superseded by clang/lldb: GDB missing in OS X v10.9 (Mavericks)
Also note that Xcode contains compiler and debugger, so one of the things installing commandline tools will do is symlink or modify $PATH. It also downloads certain things like git.
If for some reason xcode is not installed under
/usr/bin/xcodebuild
execute the following command
which xcodebuild
and if it is installed, you'll be prompted with it's location.
I had XCode Commandline Tools installed for sure, but not XCode itself.
None of the available answers to get the version worked. pkgutil didn't give me the package of the XCode Commandline Tools, with none of the suggested package names.
Not having XCode installed (and having no need for it), I could not look in settings dialogs of that either.
xcode-select --version only gave me the version of xcode-select itself, with no clue as to the commandline tools version.
softwareupdate --list told me everything was up to date.
However I knew that my version must be out of date as the installer for one of homebrew packages told me so!
How I finally found out what version of the XCode Commandline Tools is installed I stumbled upon the command:
softwareupdate --history
Which listed 12.3 as the last version it updated...
Display Name Version Date
------------ ------- ----
Safari 14.0 04/11/2020, 12:26:12
Command Line Tools for Xcode 12.1 04/11/2020, 22:38:33
Safari 14.0.2 15/12/2020, 16:38:27
Safari 14.0.1 15/12/2020, 16:38:27
Command Line Tools for Xcode 12.3 15/12/2020, 16:38:27
macOS Big Sur 11.2.1 14/02/2021, 20:57:56
macOS Big Sur 11.2.2 11.2.2 08/03/2021, 09:02:20
So when you know for sure the commandline tools are installed (because, for instance, xcode-select --install tells you so) but none of the other methods works, check softwareupdate --history!
You can open the Xcode app and go to preferences, the last line shows you if you have tools installed, which tools and lets you change them from the drop-down:
If you have installed Xcode but haven't set the Xcode version. then you will be getting this error. To resolve
Xcode-> preferences -> Locations -> command line Tools -> Select the Xcode version
TL;DR
One can have multiple installations of Xcode and multiple installations of Command Line Tools. This is where the system thinks your CLT are
xcode-select --print-path
Options to select Command Line Tools is in Xcode > Preferences > Locations, including the path for each. I found that brew complains about Xcode or Command Line Tools, and so following details how to install specific version of either.
brew doctor issues after upgrade MacOS
I have always used App store to install and update Xcode on my (2014) Macbook Pro but today after all updates brew doctor was still complaining about Xcode
Warning: Your Xcode (12.4) is outdated.
Please update to Xcode 13.2.1 (or delete it).
and complaining about Command Line Tools
Warning: A newer Command Line Tools release is available.
Get the specific version of Xcode
Download a specific version of Xcode as a xip from Developer.apple.com (I downloaded Xcode_13.2.1.xip)
Move Xcode_13.2.1.xip to /Applications
cd Applications
xip --expand /Applications/Xcode_13.2.1.xip
It takes a while to download, then a while longer to validate the application.
Open /Applications/Xcode.app
Check the CLT in XCode
Xcode> Preferences> Locations shows available CLT and the location (path) of each.
Select the appropriate Command Line Tools
Copy the path.
Go to Terminal and use the path in xcode-select
sudo xcode-select -s /Users/<username>/Applications/Xcode.app
Close Terminal and reopen.
The following was not specific enough:
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version
But this is good to identify the version
$ /usr/bin/xcodebuild -version
Xcode 13.2.1
Build version 13C100
IF still showing an older version of CLT
Try
sudo xcode-select --switch /Library/Developer/CommandLineTools/
THEN try
Update to a specific version of CLT
First, remove the existing CLT with
sudo rm -rf /Library/Developer/CommandLineTools
Check which CLT updates available
softwareupdate --list
Software Update Tool
Finding available software
Software Update found the following new or updated software:
Label: Command Line Tools for Xcode-12.4
Title: Command Line Tools for Xcode, Version: 12.4, Size: 440392K,> Recommended: YES,
Label: Command Line Tools for Xcode-13.2
Title: Command Line Tools for Xcode, Version: 13.2, Size: 577329K,> Recommended: YES,
Label: Command Line Tools for Xcode-12.5
Title: Command Line Tools for Xcode, Version: 12.5, Size: 470966K,> Recommended: YES,
Label: Command Line Tools for Xcode-12.5
Title: Command Line Tools for Xcode, Version: 12.5, Size: 470820K,> Recommended: YES,
softwareupdate --install "Command Line Tools for Xcode-13.2"
Closed Terminal and reopen
/usr/bin/xcodebuild -version
Xcode 13.2.1
Build version 13C100
Output from:
$ xcode-select -p
/Users/<username>/Applications/Xcode.app/Contents/Developer
And brew doctor shows
Your system is ready to brew.
For macOS catalina try this : open Xcode. if not existing. download from App store (about 11GB) then open Xcode>open developer tool>more developer tool and used my apple id to download a compatible command line tool. Then, after downloading, I opened Xcode>Preferences>Locations>Command Line Tool and selected the newly downloaded command line tool from downloads.

Uninstalling Xcode 3.2.6 from Lion 10.7.2

I've installed xCode 3.2.6 on my Lion 10.7.2.
After install I can't find the xCode icon to launch it. I've got to know 3.2.6 doesn't support Lion.
However, the worst thing happen when I tried to uninstall it with
sudo /Developer/Library/uninstall-devtools --mode=all
Unfortunately uninstall-devtools wasn't there. I'm stuck middle of nowhere.
Does anybody have any idea how to uninstall it and install xCode 4.2?
Following command fire on terminal and remove the all files and folder of xcode
sudo /Developer/Library/uninstall-devtools --mode=all
also more information and show log of the uninstal so go refrence link here
If /Developer/Library/uninstall-devtools does not exist skip that step.
Delete the /Develop folder if it exists.
Install xCode 4.2. Th eXcode icon will be in /Developer/Applications
The Xcode latest beta is even easier to install, get it if you have access.
If you install Xcode 3 from the GUI on Lion, you'll end up with a bunch of random tools but not the actual Xcode Toolset. In that case, you can use the uninstall-dev-tools located in /Library/Developer/Shared (rather than /Developer/Library).
You can fully install XCode 3 on Lion via the Terminal with the following commands:
export COMMAND_LINE_INSTALL=1
open "/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg"
careful: if you work in ruby, you better stay with xCode 4.1

Resources