Skip to content

Instantly share code, notes, and snippets.

@AaronMT
Created July 24, 2012 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AaronMT/3172633 to your computer and use it in GitHub Desktop.
Save AaronMT/3172633 to your computer and use it in GitHub Desktop.
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
import time
import sys
import time
devices = os.popen('adb devices').read().strip().split('\n')[1:]
device1 = MonkeyRunner.waitForConnection( devices[0].split('\t')[0])
package = 'com.android.browser'
activity = 'com.android.browser.BrowserActivity'
runComponent = package + '/' + activity
device1.startActivity(component=runComponent)
MonkeyRunner.sleep(1)
device2 = MonkeyRunner.waitForConnection( devices[1].split('\t')[0])
package = 'com.android.browser'
activity = 'com.android.browser.BrowserActivity'
runComponent = package + '/' + activity
device2.startActivity(component=runComponent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment