Skip to content

Instantly share code, notes, and snippets.

@wynnzen
Created May 9, 2014 03:01
Show Gist options
  • Save wynnzen/320190d3cf4c733a1226 to your computer and use it in GitHub Desktop.
Save wynnzen/320190d3cf4c733a1226 to your computer and use it in GitHub Desktop.
adb 检查
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