나는 emualator에서 작동하는이 코드를 작성했습니다. 실제 장치에서 어떻게 작동합니까? 그냥 장치를 연결하고 APK의 위치 (장치 위치)를 변경하는 것입니까?실제 장치 monkeyrunner 스크립트에서 실행하는 방법은 무엇입니까?
# 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')
죄송합니다 !!!!!! 게시하는 것을 잊어 버렸습니다 .. 기기를 연결하면 자동으로 작동합니다 .. 감사합니다. – ChanGan