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
117,667
questions
3469
votes
40
answers
1.5m
views
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 ...
3002
votes
40
answers
4.2m
views
Find (and kill) process locking port 3000 on Mac [closed]
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
...
2110
votes
19
answers
1.8m
views
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?
1755
votes
32
answers
1.1m
views
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?
1672
votes
21
answers
2.9m
views
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?
1406
votes
39
answers
512k
views
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 ...
1353
votes
37
answers
1.6m
views
How to set or change the default Java (JDK) version on macOS?
How can you change the default version of Java on a mac?
1322
votes
82
answers
1.0m
views
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', ...
1300
votes
31
answers
810k
views
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 ...
1285
votes
34
answers
1.4m
views
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 ...
1263
votes
37
answers
1.3m
views
"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: ...
1178
votes
38
answers
1.3m
views
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....
1026
votes
32
answers
1.1m
views
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 ...
1006
votes
30
answers
638k
views
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, ...
981
votes
35
answers
1.5m
views
How do I update the password for Git?
I'm using BitBucket with Xcode and Git for version control, and recently I changed all of my passwords (thanks Adobe!).
Unsurprisingly, I'm no longer able to push my local commits to my repository on ...
961
votes
21
answers
340k
views
Git ignore file for Xcode projects
Which files should I include in .gitignore when using Git in conjunction with Xcode?
939
votes
33
answers
883k
views
Setting environment variables on OS X
What is the proper way to modify environment variables like PATH in OS X?
I've looked on Google a little bit and found three different files to edit:
/etc/paths
~/.profile
~/.tcshrc
I don't ...
922
votes
20
answers
457k
views
How to move the cursor word by word in the OS X Terminal
I know the combination Ctrl+A to jump to the beginning of the current command, and Ctrl+E to jump to the end.
But is there any way to jump word by word, like Alt+←/→ in Cocoa applications ...
893
votes
12
answers
493k
views
.gitignore all the .DS_Store files in every folder and subfolder
I've added .DS_Store to the .gitignore file, but it seems that it is only ignoring .DS_Store in the root directory, not in every folder and subfolder.
How do I fix this?
876
votes
21
answers
1.1m
views
Where is Java Installed on Mac OS X?
I downloaded Java 7u17 on Mac OS 10.7.5 from here and successfully installed it. To do some JNI programming, I need to know where Java is installed on my Mac.
I thought that inside the /Library/Java/...
864
votes
33
answers
791k
views
Set up adb on Mac OS X
I spent quite sometime figuring how to set up adb on Mac, so I figure writing how to set it up might be useful to some people. adb is the command line tool to install and run android apps on your ...
847
votes
9
answers
994k
views
Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch
I am using Git. I did a pull from a remote repo and got an error message:
Please enter a commit message to explain why this merge is necessary,
especially if it merges an updated upstream into a ...
842
votes
32
answers
288k
views
nvm keeps "forgetting" node in new terminal session
Upon using a new terminal session in OS X, nvm forgets the node version and defaults to nothing:
$ nvm ls:
.nvm
v0.11.12
v0.11.13
I have to keep hitting nvm use v.0.11.13 in ...
804
votes
29
answers
596k
views
Run / Open VSCode from Mac Terminal
I'd like to run / open Visual Studio Code from the Mac OSX Terminal by running this command code .. I found instructions here:
https://code.visualstudio.com/Docs/setup
Apparently I need to include ...
798
votes
31
answers
692k
views
How to fix homebrew permissions?
I have uninstalled and installed Homebrew 3 times now because it seems to never allow me to install anything as it denies me permissions at the end of most installations.
As an example I will post ...
734
votes
36
answers
778k
views
psql: FATAL: role "postgres" does not exist
I'm a postgres novice.
I installed the postgres.app for mac. I was playing around with the psql commands and I accidentally dropped the postgres database. I don't know what was in it.
I'm ...
697
votes
16
answers
362k
views
How can I clear previous output in Terminal in Mac OS X?
I know the clear command that 'clears' the current screen, but it does this just by printing lots of newlines - the cleared contents just get scrolled up.
Is there a way to completely wipe all ...
682
votes
14
answers
662k
views
Open terminal here in Mac OS finder [closed]
Is there something similar to the "Open Command Window Here" Windows Powertoy for Mac OS? I've found a couple plugins through a google search but wanted to see what works best for developers out there....
674
votes
45
answers
445k
views
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac
I installed node using homebrew (Mojave), afterwards php stoped working and if I try to run php -v I get this error:
php -v
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib
...
674
votes
7
answers
436k
views
How to completely uninstall Android Studio on Mac?
I recently downloaded Android Studio on my Macbook Pro and I messed up with it every time I open it. It gives me plugin errors and several other errors. I need to uninstall it completely from my mac. ...
645
votes
39
answers
2.1m
views
bash: pip: command not found
I downloaded pip and ran python setup.py install and everything worked just fine. The very next step in the tutorial is to run pip install <lib you want> but before it even tries to find ...
644
votes
66
answers
604k
views
Postgres could not connect to server
After I did brew update and brew upgrade, my postgres got some problem. I tried to uninstall postgres and install it again, but it didn't work as well.
This is the error message. (I also got this ...
642
votes
10
answers
738k
views
OS X: equivalent of Linux's wget
How can I do an HTTP GET from a Un*x shell script on a stock OS X system? (installing third-party software is not an option, for this has to run on a lot of different systems which I don't have ...
641
votes
26
answers
1.0m
views
Maven Install on Mac OS X
I'm trying to install maven through the terminal by following these instructions.
So far I got this:
export M2_HOME=/user/apple/apache-maven-3.0.3
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export ...
641
votes
5
answers
1.1m
views
Installing ADB on macOS [duplicate]
I had issues finding a good solid tutorial on how to setup ADB for Mac.
How can I add ADB to macOS in such a way that it can be used in the terminal?
UPDATE
For those reading this post. Yes, as ...
641
votes
32
answers
600k
views
How to install a gem or update RubyGems if it fails with a permissions error
I'm trying to install a gem using gem install mygem or update RubyGems using gem update --system, and it fails with this error:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't ...
630
votes
19
answers
111k
views
Do Swift-based applications work on OS X 10.9/iOS 7 and lower?
Will Swift-based applications work on OS X 10.9 (Mavericks)/iOS 7 and lower?
For example, I have a machine running OS X 10.8 (Mountain Lion), and I am wondering if an application I write in Swift will ...
609
votes
6
answers
1.2m
views
How to run a shell script on a Unix console or Mac terminal?
I know it, forget it and relearn it again. Time to write it down.
590
votes
27
answers
564k
views
Where is JAVA_HOME on macOS Mojave (10.14) to Lion (10.7)?
Java is an optional package on the latest versions of macOS.
Yet once installed it appears like the JAVA_HOME environment variable is not set properly.
579
votes
14
answers
207k
views
How to set keyboard shortcuts to jump to beginning/end of line? [closed]
I can see that Ctrl+left/right jumps to the beginning/end of line. How to change this to Cmd+left/right arrow?
573
votes
16
answers
268k
views
Command Line Tools not working - OS X El Capitan, Sierra, High Sierra, Mojave
I just upgraded from Yosemite to El Capitan (and replicated the problem upgrading from El Capitan to Sierra), and when I try to type for example git status inside a terminal, I get the following error:...
571
votes
33
answers
438k
views
Open Sublime Text from Terminal in macOS
In Terminal when I use .subl
It returns -bash: .subl: command not found
Anyone know how to open Sublime Text 3 from the command line in macOS?
563
votes
33
answers
540k
views
How to open Visual Studio Code from the command line on OSX?
The docs mention an executable called code, but I'm not sure where I can find that so I can put it on my path. The zip I downloaded from the VSCode site did not include any such executable. (I am able ...
554
votes
16
answers
779k
views
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 ...
549
votes
12
answers
575k
views
Uninstall / remove a Homebrew package including all its dependencies
I have a Homebrew formula that I wish to uninstall/remove along with all its dependencies, skipping packages whom other packages depend upon (a.k.a. Cascading package removal in Package manager ...
548
votes
28
answers
488k
views
Mongod complains that there is no /data/db folder
I am using my new mac for the first time today. I am following the get started guide on the mongodb.org up until the step where one creates the /data/db directory. btw, I used the homebrew route.
So ...
544
votes
16
answers
901k
views
Set environment variables on Mac OS X Lion
When someone says "edit your .plist file" or "your .profile" or ".bash_profile" etc, this just confuses me. I have no idea where these files are, how to create them if I have to do that, etc, and also ...
543
votes
38
answers
631k
views
Cannot connect to the Docker daemon on macOS
I normally prefer to manage my apps on my OSX with brew
I am able to install docker, docker-compose and docker-machine
docker --version
Docker version 17.05.0-ce, build 89658be
docker-compose --...
540
votes
7
answers
503k
views
OS X Terminal Colors [closed]
I just got a Mac after working with Ubuntu Linux for some time. Among the many things I'm trying to figure out is the absence of colors in my terminal window- like the ones that are shown (on Linux) ...
522
votes
7
answers
207k
views
Is it okay to delete the macOS Xcode CoreSimulator devices folder?
My ~/Library/Developer/CoreSimulator/Devices folder is 26 GB.
Is it safe to just delete all the content? Will those files be automatically regenerated?