Launching OSX Applications

Launching applications on OSX with support for the Desktop Agent may require some configuration or an alternative launch method. OSX ships with a default ssh-agent implementation that cannot be disabled easily. 

These are the strategies employed to ensure any OSX app that supports ssh-agent authentication can be launched and used with the Desktop Agent.

Launching from Terminal

As part of the installation of the Desktop Agent some entries are made to your ~/.bash_profile to point supporting clients to the socket used for communication with the agent. Launching OSX apps from Finder does not pick these up. If you open a terminal and use the open command it will pick up the correct settings. Change <name> and replace it with the name of the application.

open /Applications/<name>.app/

Changing the Launch PLIST

A more permanent solution for launching SequelPro through Finder is to edit the applications bundle’s Info.plist.  This is not always a successful strategy.

To do this you need to find the application in /Applications using Finder and right-click to get the context menu.

Select the Show Package Contents option. Then you want to find the Info.plist in the listing.

Add following entry to the plist file, changing the path of the socket to suit your environment. A link to the agent’s socket is created in the .mobile-agent folder under your home directory.

If you do not have XCode installed, double click on the Info.plist file and it will open up in TextEdit. If you do have XCode installed it will open in a PList editor, in that case, use the Open With option in Finder and select TextEdit.

You can put the entry right at the top, paste the following in after the first <dict> element but before the next <key> element. Make sure you change __path_to_home___ to the full path of your own home directory. Please note that using ~/.desktop-ssh-agent syntax is not valid.

<key>LSEnvironment</key>
<dict>
    <key>SSH_AUTH_SOCK</key>
    <string>__path_to_home___/.desktop-ssh-agent/agent.sock</string>
</dict>

Next, before you launch the app, open a terminal, and execute the following command. This is required for the launch subsystem to pick up the changes. 

Change <name> and replace it with the name of the application.

touch /Applications/<name>.app/