# encoding: utf-8
The from uiautomator import Device
The import OS
The import time
D=Device (' 66 b0140)
Loop=0
The class SwitchMode (object) :
Def __init__ (self, mode1, mode2, times) :
The self. The mode1=mode1
Self. Mode2=mode2
The self. The Times=int (times)
Def test (self) :
For loop in range (self. Times) :
D (text=self. Mode1). Click the wait ()
D (text=self. Mode2). Click ()
Time. Sleep (3)
Loop +=1
Print "the switch times for % s to % s" % (self. Mode2, loop)
If __name__=="__main__ ':
SwitchMode (' AUTO ', 'PORTRAIT, 10)