Command line tools for Monterey without XCode

Spread the love


Advertisement

I'm extremely surprised this question wasn't asked, or at least I wasn't able to find it.

Advertisements

Is there a way to install command line tools for MacOS without installing the full XCode suite? I'm low on storage and I find it hard to swallow that I have to free up 20+ GB just to be able to do:

$ python -m http.server

Especially since python is already installed…

EDIT #2: This was just an example, my question is about xcode cli tools.

I want to be able to use make, gcc, install brew packages etc…

EDIT: Replying to the commant and why I think “python is installed”

Simple: Everything was working, until I uninstalled XCode to free up 11GB that I needed (and I don't use XCode at all). Also:

$ which python3
/usr/bin/python3
$ ls -lh /usr/bin/python3
-rwxr-xr-x  76 root  wheel   163K May  9  2022 /usr/bin/python3
$ file /usr/bin/python3
/usr/bin/python3: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64
- Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e
- Mach-O 64-bit executable arm64e]
/usr/bin/python3 (for architecture x86_64):     Mach-O 64-bit executable x86_64
/usr/bin/python3 (for architecture arm64e):     Mach-O 64-bit executable arm64e
$ hexdump -C /usr/bin/python3 | head
00000000  ca fe ba be 00 00 00 02  01 00 00 07 00 00 00 03  |............|
00000010  00 00 40 00 00 01 0c f0  00 00 00 0e 01 00 00 0c  |[email protected]|
00000020  80 00 00 02 00 01 80 00  00 01 0c d0 00 00 00 0e  |...............|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00004000  cf fa ed fe 07 00 00 01  03 00 00 00 02 00 00 00  |............|
00004010  12 00 00 00 40 06 00 00  85 00 20 00 00 00 00 00  |[email protected] .....|
00004020  19 00 00 00 48 00 00 00  5f 5f 50 41 47 45 5a 45  |....H...__PAGEZE|
00004030  52 4f 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |RO..............|
00004040  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  |................|
$ md5sum /usr/bin/python3
fac4668657765c8dfe89d8995acfb5a2  /usr/bin/python3
$ python3 -m http.server
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

PS: I know this answer exists but it assumes I get to choose anything after running xcode-select --install which hasn't been the case since Big Sur as far as I know

Author: Subham

Leave a Reply

Your email address will not be published. Required fields are marked *