Questions tagged [macos]

macOS (formerly known as OS X or Mac OS X) is the desktop operating system from Apple, found on Macintosh computers. Use this tag only if your question relates to using macOS APIs or macOS-specific behavior, not because you happen to run your code on macOS. Questions relating to using or troubleshooting macOS are off-topic and belong in the Ask Different community instead.

macOS (formerly known as OS X until 2016 and Mac OS X until 2012) is the desktop operating system from Apple Inc., found on Macintosh computers.

Use this tag for questions about writing and debugging programs on macOS. Questions relating to using or troubleshooting macOS are off-topic (use apple.stackexchange.com instead).

macOS() consists of a Mach/BSD-based kernel, operating system interfaces primarily based on FreeBSD (), and additional frameworks (written in C (), C++ (), Objective-C () and Swift () providing user interface and application-level services.

It was the successor to Mac OS 9. macOS is based upon the NeXTSTEP and OpenStep operating systems developed in the 1980s and 1990s by NeXT Inc., which Apple purchased in 1996.

Versions

  • Current macOS Big Sur
  • macOS Catalina 10.15.1
  • macOS Mojave 10.14.1
  • macOS High Sierra (10.13)
  • macOS Sierra (10.12)
  • OS X El Capitan (10.11)
  • OS X Yosemite (10.10)
  • OS X Mavericks (10.9)
  • OS X Mountain Lion (10.8)
  • OS X Lion (10.7)
  • OS X Snow Leopard (10.6)
  • OS X Leopard (10.5)
  • OS X Tiger (10.4)
  • OS X Panther (10.3)
  • OS X Jaguar (10.2)
  • OS X Cheetah (10.1)
  • OS X Puma (10.0)

More information:

116456 questions
3414
votes
38 answers

Git is not working after macOS update ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools")

I updated to the latest OS, and/or restarted my computer (this happens on every major update, but this time all I did was restart my computer on 2022-09-13). This morning I navigated to my work's codebase in the command line on my MacBook Pro, typed…
dustbuster
  • 79,958
  • 7
  • 21
  • 41
2910
votes
40 answers

Find (and kill) process locking port 3000 on Mac

How do I find (and kill) processes that listen to/use my TCP ports? I'm on macOS. Sometimes, after a crash or some bug, my Rails app is locking port 3000. I can't find it using ps -ef... When running rails server I get Address already in use -…
oma
  • 38,642
  • 11
  • 71
  • 99
2034
votes
19 answers

Who is listening on a given TCP port on Mac OS X?

On Linux, I can use netstat -pntl | grep $PORT or fuser -n tcp $PORT to find out which process (PID) is listening on the specified TCP port. How do I get the same information on Mac OS X?
pts
  • 80,836
  • 20
  • 110
  • 183
1706
votes
32 answers

How can I Remove .DS_Store files from a Git repository?

How can I remove those annoying Mac OS X .DS_Store files from a Git repository?
John Topley
  • 113,588
  • 46
  • 195
  • 237
1672
votes
21 answers

How do I install pip on macOS or OS X?

I spent most of the day yesterday searching for a clear answer for installing pip (package manager for Python). I can't find a good solution. How do I install it?
The System
  • 16,761
  • 3
  • 13
  • 3
1403
votes
39 answers

How can I check for an active Internet connection on iOS or macOS?

I would like to check to see if I have an Internet connection on iOS using the Cocoa Touch libraries or on macOS using the Cocoa libraries. I came up with a way to do this using an NSURL. The way I did it seems a bit unreliable (because even Google…
Brock Woolf
  • 46,656
  • 50
  • 121
  • 144
1312
votes
81 answers

Xcode - How to fix 'NSUnknownKeyException', Reason: "… this class is not key value coding-compliant for the key X" error?

I'm trying to link a UILabel with an IBOutlet created in my class. My application is crashing with the following error" *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x6e36ae0>…
Guillaume Dubois
  • 2,003
  • 3
  • 13
  • 4
1312
votes
36 answers

How to set or change the default Java (JDK) version on macOS?

How can you change the default version of Java on a mac?
Venkat
  • 13,247
  • 3
  • 14
  • 6
1278
votes
32 answers

Pipe to/from the clipboard in a Bash script

Is it possible to pipe to/from the clipboard in Bash? Whether it is piping to/from a device handle or using an auxiliary application, I can't find anything. For example, if /dev/clip was a device linking to the clipboard we could do: cat /dev/clip …
moinudin
  • 134,091
  • 45
  • 190
  • 216
1271
votes
34 answers

How to install Java 8 on Mac

Editors note: This question was asked in 2014, and the answers may be outdated. I want to do some programming with the latest JavaFX, which requires Java 8. I'm using IntelliJ 13 CE and Mac OS X 9 Mavericks. I ran Oracle's Java 8 installer, and…
user3763100
  • 13,037
  • 3
  • 13
  • 9
1165
votes
38 answers

How can I start PostgreSQL server on Mac OS X?

Final update: I had forgotten to run the initdb command. By running this command ps auxwww | grep postgres I see that postgres is not running > ps auxwww | grep postgres remcat 1789 0.0 0.0 2434892 480 s000 R+ 11:28PM 0:00.00…
Ramy
  • 20,541
  • 41
  • 103
  • 153
1164
votes
34 answers

"code ." is not working in on the command line for Visual Studio Code on OS X/Mac

The command code . doesn't work in this manual. All the other steps before that worked. How can I call the Visual Studio Code in an OS X terminal? pwd /Users/mona/nodejs/myExpressApp code . -bash: code: command not found I ended up opening it…
Mona Jalal
  • 34,860
  • 64
  • 239
  • 408
995
votes
32 answers

Upgrade Node.js to the latest version on Mac OS

Currently I am using Node.js v0.6.16 on Mac OS X 10.7.4. Now I want to upgrade it to the latest Node.js v0.8.1. But after downloading and installing the latest package file from nodejs.org, I found that system is still using v0.6.16 instead of…
afterglowlee
  • 11,670
  • 5
  • 22
  • 23
975
votes
30 answers

xcode-select active developer directory error

Saw the following error when running an npm install which required node-gyp... but could be triggered by anything which requires xcode-select. xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory…
tjmehta
  • 28,667
  • 4
  • 21
  • 18
957
votes
21 answers

Git ignore file for Xcode projects

Which files should I include in .gitignore when using Git in conjunction with Xcode?
Hagelin
  • 16,440
  • 5
  • 29
  • 37
1
2 3
99 100