(This post was updated on 9 June 2014 to correct a couple typos and clarify one of the steps.)
For most Android users, having the Android File Transfer application automatically open up when you connect your Android device to your Mac with its USB cable is a nice convenience. But for some users, such as developers, who may be frequently rebooting their device to test things, having the Android File Transfer application continuously pop up and steal focus from their development studio application is frustrating.
I fall into this latter group of users. I find myself frequently issuing the command adb reboot from my console to quickly reboot my device and see how my code works. Each time my device starts to boot, Android File Transfer pops up over my coding app. And for those times when I’m debugging a glitch, or capturing a log, while my device goes through several boot loop cycles, fighting the Android File Transfer app popup will drive me crazy.
You might be asking, why not just remove Android File Transfer from the Mac’s startup items? Good question, and I’ve already done that. For some reason, the developers of Android File Transfer decided they really don’t want you being able to disable their application, so even if you remove the startup agent, that just keeps it from auto-starting when you boot up your Mac. The next time you manually launch the app, it puts itself right back into background standby, waiting to pop up as soon as you connect your Android device again.
Fortunately, I found a very quick and easy way to disable this background agent. This disables the Android File Transfer listener agent from running in the background and waiting for a connected device. You can still launch Android File Transfer from your Dock, Applications folder, Spotlight search, Apple-menu Recent Item, etc. When you purposefully open the program, it will run and let your work with the files on your device. Then, when you quit the app window, it will disappear just like we’re used to with every other application on our computers. You can disconnect and reconnect your device, reboot it as many times as you want without Android File Transfer popping up on its own again.
First thing, close Android File Transfer if it is currently open. Don’t just minimize it to the Dock, make sure you actually exit the app.
Then, open the Activity Monitor application from your Utilities folder on your Mac’s hard drive. Sort the list of running apps by name by clicking on the “Name” column header. Look for the Android File Transfer Agent service in the list. Click on it, and then click on the Quit button at the top – the big red stop sign button. This kills the service for the time being.
Next, open a Terminal window, and paste the following command into it and press Enter. This removes the File Transfer Agent service from the Application Support folder on your hard drive.
rm -r ~/Library/Application\ Support/Google/Android\ File\ Transfer/Android\ File\ Transfer\ Agent.app
Now, while this should be the only command necessary, for some reason, the developers of the File Transfer app decided they would replace the service app if it ever goes missing, with each launch of the app. So even after running the previous command, the next time you open Android File Transfer, it will simply replace the missing service app with a new copy. We can remove the “backup” copy of this transfer agent service that is contained within the main application bundle.
In the Terminal window, paste the following commands and press Enter after each one. This changes into the directory of the File Transfer app bundle, and then renames the exiting service agent with a .DISABLED extension.
cd /Applications/Android\ File\ Transfer.app/Contents/Resources mv Android\ File\ Transfer\ Agent.app Android\ File\ Transfer\ Agent.app.DISABLED
The next time the main Android File Transfer application is started, it will attempt to start the service, but will be unable to because as far as it’s concerned, it’s not there anymore.
This action is completely reversible as well, if you wish to re-enable the background service. Just paste this command back into the Terminal window to rename the service back to its original name.
mv Android\ File\ Transfer\ Agent.app.DISABLED Android\ File\ Transfer\ Agent.app