Android File Transfer (let’s call it AFT) is a handy tool to transfer files from and to an Android device when using a Mac. This software has an annoying habit though: It automatically starts when an Android device is plugged in. Since on most modern Android devices, the user has to give permission to access files after connecting it to a PC, it opens up just to confront the user with an error message.
This behavior is caused by an App called “Android File Transfer Agent.app”, which is automatically installed by AFT to launch on login and wait for connecting devices. Here is what seems to happen on every launch of AFT to install this agent:
- “~/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent.app” is replaced by “/Applications/Android File Transfer.app/Contents/Resources/Android File Transfer Agent.app”
- The Agent app is started
- An entry for this application is installed as a Login Item for the current user
People have come up with different hacks to sabotage this “feature”, e.g. renaming “Android File Transfer Agent.app” to something else in the /Applications folder or making the folder under ~/Library unaccessible for AFT. Unfortunately, these solutions have side effects, such as an increasing number of invalid entries in the user’s startup items. A more clean solution therefore is to replace “Android File Transfer Agent.app” by an application bundle that does nothing.
Creating a noop application
We can simply use the Automator to create an application bundle:
- Run Automator.app and create a new Application
- Since some action has to be performed, insert an empty shell script into the work flow
- Save the application as “Android File Transfer Agent.app” in your user’s directory
Replacing agent by noop application
- Stop any running “Android File Transfer Agent” using the Activity Monitor
- Remove app from ~/Library:
rm -rf ~/Library/Application\ Support/Google/Android\ File\ Transfer/Android\ File\ Transfer\ Agent.app
- Replace the agent app under /Applications:
sudo rm -rf /Applications/Android\ File\ Transfer.app/Contents/Resources/Android\ File\ Transfer\ Agent.app sudo cp -r ~/Android\ File\ Transfer\ Agent.app /Applications/Android\ File\ Transfer.app/Contents/Resources/
On the next launch of AFT, it will copy your noop app to your ~/Library folder and install it as a startup item. Since it is a valid app, this should not cause any issues. Of course, after an update of AFT you will have to replace the agent app under /Applications again, but the last update was in 2012, so I wouldn’t worry too much…
Ironically, four days after I released this post, Google actually released an update (1.0.11). Make sure to read Donald’s comment below since the location of “Android File Transfer Agent.app” within the application has changed.