open -a /Applications/Google\ Chrome.app --args --proxy-server=[host]:[port]And if you want the convenience of launching from your dock, create a wrapper script and icon using one of these methods (copied from here because it's a flaky link):
Option 1: Use Automator to create an application that in effect launches Chrome with command line arguments.
Start Automator and select to create an Application. Double-click Run Shell Script in the Library/Utilities folder and replace the text content —
cat— with the following:
open -a /Applications/Google\ Chrome.app --args --proxy-server=[host]:[port]Save anywhere you like.
To replace this application's icon, Get Info on your real Google Chrome, click on the icon on the top left, press
Cmd-C, Get Info on your Chrome Automator app, click the icon, and press
Since it's a different application, the Dock will display two Chrome applications when it's running: Chrome, and your Chrome launcher.
Option 2: Edit your application bundle to launch a script instead. This script will start the actual application, adding the command line argument.
Google Chrome.appand select Show Package Contents. Go to
Info.plistin Property List Editor/Xcode (Apple's developer tools), or a third party
Look for the entry
Executable File. Remember its value (e.g.
firefox-binfor Firefox). Replace it with
Open Terminal and enter the following:
touch /Applications/Firefox.app/Contents/MacOS/parameterized-app.sh open /Applications/Firefox.app/Contents/MacOS/parameterized-app.sh
An editor for the
.shfile will open. Set the contents of the file to:
#!/usr/bin/env bash /Applications/Firefox.app/Contents/MacOS/firefox-bin -ProfileManager
(using the actual executable's name you removed from
Info.plist, adding the desired command-line arguments)
Save and close. In Terminal, enter the following:
chmod +x /Applications/Firefox.app/Contents/MacOS/parameterized-app.sh
Now, close Terminal and move your application (which must not be running right now) to a different folder and back again. This will update Launch Services, otherwise your changes will be ignored and irritate you immensely.
Now, when you open your application, it will actually execute the
.shfile, which will in turn launch the actual executable file, sending the command line args along.
It will look and behave like you expect it to, but you will need to repeat this whenever you update your application, as this will generally replace the application bundle and all the changes you made.