我已撰写了该守则,该守则正在起草过程中。 我怎么能以真正的手段开展工作? 是否仅仅将装置连接起来,并改变地点(玻璃点)?
# Imports the monkeyrunner modules used by this program
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
# Connect to the current device
device = MonkeyRunner.waitForConnection()
# Install package
device.installPackage( C:/android-sdk-windows/tools/lib/purchase.apk )
# Run activity
device.startActivity(component= com.mobilenetwork.purchase/.StartPage )
# Importing time
import time
# Waiting for 10 secs to be launched on the emulator:
time.sleep(10)
device.press( KEYCODE_BUTTON_SELECT , DOWN , )
# Screenshot
time.sleep(10)
result = device.takeSnapshot()
# Writes the screenshot to a file
result.writeToFile( G:\Screenshot\screen_shot.png , png )