Created
May 9, 2014 03:01
-
-
Save wynnzen/320190d3cf4c733a1226 to your computer and use it in GitHub Desktop.
adb 检查
This file contains 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
import os | |
import os.path | |
import time | |
def adbcheck(): | |
if "\tdevice\n" in os.popen("adb devices").read(): | |
print "connected" | |
else: | |
while True: | |
print "phone is not connected,please check phone adb interface!" | |
print "waitting 2s.." | |
time.sleep(2) | |
if "\tdevice\n" in os.popen("adb devices").read(): | |
print "adb is connected again" | |
break | |
else: | |
continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment