私はMonkeyを使ってエミュレータでアプリを駆動しています。
私はmonkeyrunnerツールに送られるPythonスクリプトを持っています。これは主に、Androidデベロッパーウェブサイトのサンプルから発生しています。
アクティビティーを呼び出して応答することは可能です。
たとえばここではアクティビティを呼び出すと、別のアクティビティが実行されます。その時点で4桁の数字を入力し、 'ok'ボタンに対応する画面上の100,400の座標を 'クリック'します。
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
if __name__ == "__main__":
# Connects to the current device, returning a MonkeyDevice object
device = MonkeyRunner.waitForConnection()
# Installs the Android package. Notice that this method returns a boolean, so you can test
# to see if the installation worked.
# device.installPackage('myproject/bin/MyApplication.apk')
# sets a variable with the package's internal name
package = 'com.mypackage'
# sets a variable with the name of an Activity in the package
activity = 'com.mypackage.myactivity'
# sets the name of the component to start
runComponent = package + '/' + activity
# Runs the component
device.startActivity(component=runComponent)
if device.getProperty('am.current.comp.class') == 'com.mypackage.anotheractivity':
device.type('0000')
# Click the 'Enter' button on screen at coordinates 100,400
device.touch(100, 600, 'DOWN_AND_UP')
私はそれが助けて欲しい