Я создал скрипт Python для завершения первоначальной настройки устройства, и я могу запустить его на одном устройстве. Я хочу запустить один и тот же скрипт на нескольких устройствах. Я предоставил код ниже, скажите, пожалуйста, как этот код можно изменить, чтобы запускать их на двух или более устройствах.
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()