I have created a python script to complete the initial setup of a device and I am able to run it in single device. I want to run the same script in multiple devices. I have provided the code below, please tell me how this code can be modified to run them in two or more devices.
import re
import sys
import time
import os
from PIL import Image
from com.dtmilano.android.viewclient import ViewClient
device, serialno = ViewClient.connectToDeviceOrExit()
vc = ViewClient(device=device, serialno=serialno)
vc.dump()
vc.findViewWithTextOrRaise(u'Continue').touch()##this line will click on Continue button.
print 'Continue button found and clicked'
vc.dump()
vc.findViewWithTextOrRaise(u'ABCCC').touch()##this line will click WiFi Ilaw SSID.
print 'SSID found and clicked'
vc.dump()
device.shell('input text *********')
vc.dump()
vc.findViewWithTextOrRaise(u'Connect').touch()##connect to wifi
time.sleep(20)
vc.dump()
device.shell('input text *********')##enter username
device.shell('input keyevent 61')
device.shell('input text *****')##enter password
vc.dump()
vc.findViewWithTextOrRaise(u'Continue').touch()##register the device
time.sleep(40)
vc.dump()
vc.findViewWithTextOrRaise(u'Do not restore').touch()##Do not restore
vc.dump()
vc.findViewWithTextOrRaise(u'Continue').touch()##Continue
vc.dump()
vc.findViewWithTextOrRaise(u'Continue').touch()##Account selection - click continue
vc.dump()
device.shell('input text *****') ##set screen pin
device.shell('input keyevent 61')
device.shell('input text *****') ##confirm pin
vc.dump()
vc.findViewWithTextOrRaise(u'Continue').touch()##Click Continue after entering pin
vc.dump()