Last active
August 29, 2015 14:19
-
-
Save j796160836/e0af21b6b47471b66b3d to your computer and use it in GitHub Desktop.
關閉 Android File Transfer 自動啟動
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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