Skip to content

Instantly share code, notes, and snippets.

@kaz-tk
Created May 7, 2012 07:35
Show Gist options
  • Save kaz-tk/2626506 to your computer and use it in GitHub Desktop.
Save kaz-tk/2626506 to your computer and use it in GitHub Desktop.
MonkeyRunnerからDeviceの取得
# これからWaitForConnectionすればいい感じ
from java.io import File
from java.net import URL
from java.net import URLClassLoader
import jarray
urlClassLoader=URLClassLoader(jarray.array([File("ddmlib.jar").toURL()], URL))
AndroidDebugBridge=urlClassLoader.loadClass("com.android.ddmlib.AndroidDebugBridge")
bridge = AndroidDebugBridge.getBridge()
devices = bridge.getDevices()
for device in devices:
print device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment