Skip to content

Instantly share code, notes, and snippets.

@zeroseis
Created September 14, 2015 17:28
Show Gist options
  • Save zeroseis/ce66d4c6b776577442a6 to your computer and use it in GitHub Desktop.
Save zeroseis/ce66d4c6b776577442a6 to your computer and use it in GitHub Desktop.
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.
@thenamangoyal
Copy link

@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

@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

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

@ballo
Copy link

ballo commented Dec 21, 2022

Dear Google: 🖕

@jagamypriera
Copy link

@ballo Sincerely, everyone.

@hadri3n
Copy link

hadri3n commented Aug 17, 2023

openmtp

Thanks for sharing ! This soft is great !

@pzagawa
Copy link

pzagawa commented Mar 26, 2024

Dear Google: 🖕

Exactly my thought. I don't believe these mfs. They want to spy on you everywhere.

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