iOS設(shè)備連接Mac頻繁連接斷開解決腳本:腳本如下
#!/bin/bash
#設(shè)置密碼的值
sudo killall -STOP -c usbd
#判斷是否包含Password字符串
expect "Password"
#send \n相當(dāng)于回車
#XXXXXX替換成你電腦的密碼
send "XXXXXX\n"
osascript -e 'tell application "Terminal" to quit' &
exit
使用方法:
- 在桌面創(chuàng)建.sh腳本文件
- 把上面內(nèi)容粘貼進(jìn)去,把其中的XXXXXX替換成你電腦的密碼
- 點(diǎn)開桌面上的文件執(zhí)行腳本,輸入你mac電腦密碼
- 再遇到頻繁斷開連接的情況直接手動(dòng)點(diǎn)擊腳本運(yùn)行,輸入密碼就可以了
步驟一:在桌面創(chuàng)建.sh腳本文件
# cd desktop
# touch myshell.sh
步驟二:把上面內(nèi)容粘貼進(jìn)去,把其中的XXXXXX替換成你電腦的密碼,保存后,點(diǎn)開桌面上的文件執(zhí)行腳本,輸入你mac電腦密碼回車
-- END --