2

I need to get the source code of the "arch" command located in /usr/bin/arch for macOS Catalina( see the output of sw_vers command below).

macOS Catalina

ProductName: Mac OS X ProductVersion: 10.15.3 BuildVersion: 19D76 

In case you need it, here are some architecture details:

MacBook-Pro 15-inch, 2019 Processor 2.3GHz * core Intel core i9 

I found that macOS Catalina is one of many releases of Apple OS Darwin as explained here Darwin OS.

The same link also states that :

Darwin is an open-source Unix-like operating system first released by Apple Inc. in 2000. It is composed of code developed by Apple, as well as code derived from NeXTSTEP, BSD, Mach, and other free software projects.

So I thought that maybe I could find it here Free BSD Source at GitHub, but I had no luck there either.

Could someone please help? Thanks!!

2
  • Try https://opensource.apple.com/release/macos-1015.html Commented Feb 17, 2020 at 20:27
  • It says at en.wikipedia.org/wiki/Darwin_(operating_system) that Catalina is the proprietary version. Darwin is the Free one. (It is a bit confusing) Commented Feb 17, 2020 at 22:13

1 Answer 1

3

The place to find the open source components of MacOS is https://opensource.apple.com/ , and the package where arch is included is called system_cmds.

Unfortunately, the links for Catalina (10.15.x) seem to be unavailable at the time of writing this (this is not uncommon, because Apple usually publishes the source with some delay).

The version you want is probably system_cmds-854.11.2 (the link is at https://opensource.apple.com/release/macos-1015.html but it is broken for the moment).

However, if you are fine with the version for Mojave (10.14.x), then you can get the source here: https://opensource.apple.com/source/system_cmds/system_cmds-805.250.2/arch.tproj/

Hope this helps!

Note: If you really need the Catalina version, you'll need to wait until Apple publishes it in the website above.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.