Skip to content

Instantly share code, notes, and snippets.

@j796160836
Last active August 29, 2015 14:19
Show Gist options
  • Save j796160836/e0af21b6b47471b66b3d to your computer and use it in GitHub Desktop.
Save j796160836/e0af21b6b47471b66b3d to your computer and use it in GitHub Desktop.
關閉 Android File Transfer 自動啟動
#!/bin/bash
# Ref: https://trjlive.com/2013/11/how-to-prevent-android-file-transfer-from-opening-each-time-a-device-is-connected/
AFT_PID=`ps aux | grep "Android\ File\ Transfer" | awk '{print $2}'`
for pid in $AFT_PID
do
kill -9 $pid
echo "Kill PID (${pid}) succeeded"
done
rm -rf ~/Library/Application\ Support/Google/Android\ File\ Transfer/Android\ File\ Transfer\ Agent.app
cd /Applications/Android\ File\ Transfer.app/Contents/Resources
if [ -f Android\ File\ Transfer\ Agent.app ]
then
mv Android\ File\ Transfer\ Agent.app Android\ File\ Transfer\ Agent.app.DISABLED
echo "Patch complete."
else
echo "Already patched."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment