Apple - launchd listening on port 4444

I suggesting noting which files you change and exactly how you change them, as updates to the Server app will very likely undo all of the changes you made. You may even want to make a shell script that looks for these files and automatically changes them at boot time, every time. I have to do something similar so my brew-installed apache doesn't get disrupted by the system's apache.


Yes. Changing port is as simple as running it with a command line override:

selenium-server -port 4455

The above would try listening on port 4455 instead of 4444

Changing launchd is a little more work since you need to locate the exact file on the filesystem that it got the directions to listen on 4444.

Here is a nice write up of one such way to configure selenium to use port 4444

  • https://github.com/shvets/selenium

So, you’d need to edit the plist that controls the launch. I would recommend using homebrew to install this:

mac:dev me$ brew install selenium-server-standalone
==> Downloading https://selenium-release.storage.googleapis.com/3.11/selenium-server-standalone-3.11.0.jar
######################################################################## 100.0%
==> Caveats
To have launchd start selenium-server-standalone now and restart at login:
  brew services start selenium-server-standalone
Or, if you don't want/need a background service you can just run:
  selenium-server -port 4444
==> Summary
  /usr/local/Cellar/selenium-server-standalone/3.11.0: 5 files, 22.3MB, built in 7 seconds
mac:dev me$ selenium-server -port 4455

You can see that you can override the port from this selenium server from the command line or edit ~/Library/LaunchAgents/homebrew.mxcl.selenium-server-standalone.plist to change these two lines that control the default port:

<string>-port</string>
<string>4444</string>

once you save the change, cycle the service using:

brew services restart selenium-server-standalone