Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Disable auto start for Android File Transfer
  • Close Android File Transfer
  • Open Activity Monitor and kill “Android File Transfer Agent”
  • Go to where you installed “Android File Transfer.app” (I have it under /Applications)
  • Ctrl+click –> “Show package contents”
  • Go to Contents/Resources
  • Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
  • Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.
@swinggraphics
Copy link

swinggraphics commented Nov 9, 2018

The current version (1.0.11 as of November 2018) is quite different:

  1. Do quit AFT and the agent, and remove the agent from startup items.

  2. You have to rename the AFT Agent inside the app's Contents/Helpers.

  3. You have to rename or delete the AFT Agent inside ~/Application Helpers/Google/Android File Transfer.

I guess one copy of the agent wasn't enough, and Google wanted it to stick around even if you delete the transfer app? Jerks.

@hesamaseh
Copy link

hesamaseh commented Dec 26, 2018

If you dont want to fully uninstall it you can kill the agent from the Activity monitor before you connect your device.

  1. Just open the activity monitor and search for the agent
  2. force kill the agent
  3. connect your gopro

@sergiomeza
Copy link

sergiomeza commented Dec 29, 2018

@rb-shahid THANKS!

@pratyushtewari
Copy link

pratyushtewari commented Jan 22, 2019

@swinggraphics Thanks.

Thanks! Although for point 3

  1. You have to rename or delete the AFT Agent inside ~/Application Helpers/Google/Android File Transfer.

for me the location was
~/Library/Application\ Support/Google/Android\ File\ Transfer/Android\ File\ Transfer\ Agent.app

@stealthybox
Copy link

stealthybox commented Jan 29, 2019

Creating an Automator app called Noop.app and running this script addresses the problem for me.

cat disable-android-file-transfer-agent.sh
#!/bin/bash
# disables auto-start of AFT when plugging in an Android device into USB
# -- prerequisite create an Automator application that launches an empty shell script and save it as /Applications/Noop.app

sudo killall 'Android File Transfer'
sudo killall 'Android File Transfer Agent'

# remove the runtime Library copy
sudo rm -rf "${HOME}/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent.app"
# remove the source app
sudo rm -rf "/Applications/Android File Transfer.app/Contents/Helpers/Android File Transfer Agent.app"
# copy the Noop app into the source location
sudo cp -r "/Applications/Noop.app" "/Applications/Android File Transfer.app/Contents/Helpers/"

inspired by: https://gist.github.com/zeroseis/ce66d4c6b776577442a6#gistcomment-2238139

@mikedoubintchik
Copy link

mikedoubintchik commented Feb 26, 2019

This is for the newest version of the program:

PID=$(ps -fe | grep "[A]ndroid File Transfer Agent" | awk '{print $2}'); if [[ -n $PID ]]; then kill $PID; fi; mv "/Applications/Android File Transfer.app/Contents/Helpers/Android File Transfer Agent.app" "/Applications/Android File Transfer.app/Contents/Helpers/Android File Transfer Agent DISABLED.app"; mv "${HOME}/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent.app" "${HOME}/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent DISABLED.app"; osascript -e 'tell application "System Events" to delete every login item whose name is "Android File Transfer Agent"'

@krischik
Copy link

krischik commented Apr 8, 2019

Over time a switched to Script that looks at all the places. This has the advantage of being easier to read them 5 commands on one terminal line and it can be quickly started after each update. And last not least one can easily add more location to search in case Google moves stuff again:

#!/bin/zsh

typeset PID=$(ps -fe | grep "[A]ndroid File Transfer Agent" | awk '{print $2}')

if [[ -n ${PID} ]]; then
    kill ${PID}
fi

for AFT in								\
    "/Applications/Android File Transfer.app"				\
    "/Applications/Sync/Android File Transfer.app"			\
    "${HOME}/Library/Application Support/Google/Android File Transfer"
do
    echo "### Look for agents in “${AFT}"

    if test -e "${AFT}"; then
	for AFTA in							\
	    "${AFT}/Contents/Resources/Android File Transfer Agent.app" \
	    "${AFT}/Contents/Helpers/Android File Transfer Agent.app" 
	do
	    echo "# Look for agent “${AFTA}"

	    if test -e "${AFTA}"; then
		mv -v "${AFTA}" "${AFTA}.DISABLE"
	    fi
	done; unset AFTA
    fi
done; unset AFT

osascript -e 'tell application "System Events" to delete every login item whose name is "Android File Transfer Agent"'

@rraallvv
Copy link

rraallvv commented May 9, 2019

Android File Transfer is the most annoying piece of software I've forced to use, seriously, why someone would thing it needs to run on every launch whether the user wants it or not.

@arminio
Copy link

arminio commented Jun 2, 2019

This is too radical. I'd suggest going to the System Preferences / Users & Groups / / Login Items and removing "Android File Transfer Agent" from the list. This way you will still be able to launch it when you need it.

@alg This does work. thank you! (I just needed to kill/stop the agent process manually after removing it from the list as you suggested)

@lkjh654
Copy link

lkjh654 commented Jul 2, 2019

@krischik

that's awesome, thx

@mihajloS
Copy link

mihajloS commented Jul 4, 2019

@alg Thank you. Worked for me.

@moreaki
Copy link

moreaki commented Jul 6, 2019

@krischik: thank you!

@dburr
Copy link

dburr commented Sep 11, 2019

Brilliant! Thanks to both the OP as well as @krischik for your handy dandy script.

@einsteinx2
Copy link

einsteinx2 commented Sep 12, 2019

The permissions trick worked great for me. All I did was:

  1. In Settings app > Users & Groups > Login Items, first unlock the settings panel then remove the Android File Transfer Agent entry
  2. Open a Terminal and sudo -s
  3. Change permissions on the agent app: chmod 000 /Applications/Android\ File\ Transfer.app/Contents/Helpers/Android\ File\ Transfer\ Agent.app
  4. Change ownership to root on the agent app: chown root:wheel /Applications/Android\ File\ Transfer.app/Contents/Helpers/Android\ File\ Transfer\ Agent.app
  5. Delete the Application Support directory: rm -r ~/Library/Application\ Support\Google\Android\ File\ Transfer
  6. Open Activity Monitor and force kill the Android File Transfer Agent process

That's it. I confirmed that re-opening the Android File Transfer app no longer adds the launch entry or makes the copy to Application Support directory and the app no longer auto-launches when a device is plugged in.

@Beyonit
Copy link

Beyonit commented Oct 17, 2019

@einsteinx2

The permissions trick worked great for me. All I did was:

  1. In Settings app > Users & Groups > Login Items, first unlock the settings panel then remove the Android File Transfer Agent entry
  2. Open a Terminal and sudo -s
  3. Change permissions on the agent app: chmod 000 /Applications/Android\ File\ Transfer.app/Contents/Helpers/Android\ File\ Transfer\ Agent.app
  4. Change ownership to root on the agent app: chown root:wheel /Applications/Android\ File\ Transfer.app/Contents/Helpers/Android\ File\ Transfer\ Agent.app
  5. Delete the Application Support directory: rm -r ~/Library/Application\ Support\Google\Android\ File\ Transfer
  6. Open Activity Monitor and force kill the Android File Transfer Agent process

That's it. I confirmed that re-opening the Android File Transfer app no longer adds the launch entry or makes the copy to Application Support directory and the app no longer auto-launches when a device is plugged in.

Thanks! It's a clean way indeed. This was really getting me nuts, every f**** time that damn app open, while I don't asked for it. Garbage.

@rraallvv
Copy link

rraallvv commented Oct 17, 2019

You can use HandShaker if you don't mind the company being based in China.

@dbarelop
Copy link

dbarelop commented Jan 8, 2020

Removing execution permissions for the agent in ~/Library and /Applications is enough

chmod -x ~/Library/Application\ Support/Google/Android\ File\ Transfer/Android\ File\ Transfer\ Agent.app/Contents/MacOS/Android\ File\ Transfer\ Agent /Applications/Android\ File\ Transfer.app/Contents/Helpers/Android\ File\ Transfer\ Agent.app/Contents/MacOS/Android\ File\ Transfer\ Agent

@nickfox
Copy link

nickfox commented Feb 16, 2020

I used the einsteinx2 solution but found an error in step 5.

  1. In Settings app > Users & Groups > Login Items, first unlock the settings panel then remove the Android File Transfer Agent entry
  2. Open a Terminal and sudo -s
  3. Change permissions on the agent app: chmod 000 /Applications/Android\ File\ Transfer.app/Contents/Helpers/Android\ File\ Transfer\ Agent.app
  4. Change ownership to root on the agent app: chown root:wheel /Applications/Android\ File\ Transfer.app/Contents/Helpers/Android\ File\ Transfer\ Agent.app

/* this line is incorrect, the slashes after Support and Google should be forward slashes */
5. Delete the Application Support directory: rm -r ~/Library/Application\ Support\Google\Android\ File\ Transfer

/* the corrected line 5 is as follows */
5. rm -r ~/Library/Application\ Support/Google/Android\ File\ Transfer

  1. Open Activity Monitor and force kill the Android File Transfer Agent process

@alvinkonda
Copy link

alvinkonda commented Feb 22, 2020

I tried all solutions but this one was the simplest and the best one of for me.

I dragged the Android File Transfer icon to Trash.

Lol

@cnyyk
Copy link

cnyyk commented Feb 27, 2020

Go to Contents/Resources
should be
Go to Contents/Helpers

macOS 10.15.3 with Android File Transfer 1.0.11

@minkiapps
Copy link

minkiapps commented Sep 27, 2020

Go to Contents/Resources
should be
Go to Contents/Helpers

macOS 10.15.3 with Android File Transfer 1.0.11

👍

@edosam
Copy link

edosam commented Sep 27, 2020

Just try delete the "Andoird File Transfer Agent" in System Preferences > Users & Groups > Login Items
Screenshot 2020-09-27 at 17 44 43

@hellowwwwp
Copy link

hellowwwwp commented Jan 6, 2021

nice, thanks~

@Androz2091
Copy link

Androz2091 commented Mar 24, 2021

@krischik thank you, still working perfectly on macos big sur m1 👌

@rraallvv
Copy link

rraallvv commented Apr 12, 2021

In case anyone wants to try out an open-source alternative that apparently is way better https://github.com/ganeshrvel/openmtp/releases

@thenamangoyal
Copy link

thenamangoyal commented May 7, 2021

@krischik Fixed the missing check for ${HOME}/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent.app.

The updated script

#!/bin/zsh

typeset PID=$(ps -fe | grep "[A]ndroid File Transfer Agent" | awk '{print $2}')

if [[ -n ${PID} ]]; then
    kill ${PID}
fi

for AFT in								\
    "/Applications/Android File Transfer.app"				\
    "/Applications/Sync/Android File Transfer.app"			\
    "${HOME}/Library/Application Support/Google/Android File Transfer"
do
    echo "### Look for agents in “${AFT}"

    if test -e "${AFT}"; then
	for AFTA in							\
	    "${AFT}/Contents/Resources/Android File Transfer Agent.app" \
	    "${AFT}/Contents/Helpers/Android File Transfer Agent.app" \
	    "${AFT}/Android File Transfer Agent.app"
	do
	    echo "# Look for agent “${AFTA}"

	    if test -e "${AFTA}"; then
		mv -v "${AFTA}" "${AFTA}.DISABLE"
	    fi
	done; unset AFTA
    fi
done; unset AFT

osascript -e 'tell application "System Events" to delete every login item whose name is "Android File Transfer Agent"'

@MarjaE2
Copy link

MarjaE2 commented Jul 2, 2021

Just try delete the "Andoird File Transfer Agent" in System Preferences > Users & Groups > Login Items

It adds itself back.

@256hz
Copy link

256hz commented Aug 3, 2021

Thank you @krischik & @thenamangoyal 🙏

@straiway
Copy link

straiway commented Sep 13, 2021

@krischik Fixed the missing check for ${HOME}/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent.app.

The updated script

#!/bin/zsh

typeset PID=$(ps -fe | grep "[A]ndroid File Transfer Agent" | awk '{print $2}')

if [[ -n ${PID} ]]; then
    kill ${PID}
fi

for AFT in								\
    "/Applications/Android File Transfer.app"				\
    "/Applications/Sync/Android File Transfer.app"			\
    "${HOME}/Library/Application Support/Google/Android File Transfer"
do
    echo "### Look for agents in “${AFT}"

    if test -e "${AFT}"; then
	for AFTA in							\
	    "${AFT}/Contents/Resources/Android File Transfer Agent.app" \
	    "${AFT}/Contents/Helpers/Android File Transfer Agent.app" \
	    "${AFT}/Android File Transfer Agent.app"
	do
	    echo "# Look for agent “${AFTA}"

	    if test -e "${AFTA}"; then
		mv -v "${AFTA}" "${AFTA}.DISABLE"
	    fi
	done; unset AFTA
    fi
done; unset AFT

osascript -e 'tell application "System Events" to delete every login item whose name is "Android File Transfer Agent"'

It wokers for me, thanks!

@Anna-art125
Copy link

Anna-art125 commented Jan 25, 2022

Great explanation, thanks. I think you will be interested in this article.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment