I am trying to run a monkeyrunner script on multiple devices to do some basic operations.I figured out that initialy I will start of writing a script to perform basic action in two connected devices.
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)
When i run this script, it never finish executing. The browser action happen on one of the connected device but not on other. Can you guys help me fix this or if you have a better code(ideas) to run an activity on multiple devices, Please do let me know~ I am newbie and completely new to the programming world!Thanks in advance
you can give like
device1 = MonkeyRunner.waitForConnection('', devices[0].split('\t')[0])
this will help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With