I have been trying to run a jython script which installs a package and opens a activity and then takes its screen shot and finally saves it in a File. I am using the following Code to do this:
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
device.installPackage('F:\jind\Example.apk')
package= 'com.android.example'
activity= 'com.android.example.main_activity'
runComponent= package + '/' + activity
device.startActivity(component=runComponent)
device.press('KEYCODE_MENU', MonkeyDevice.DOWN_AND_UP)
result=device.takeSnapshot()
result.writeToFile('F:\jind\lk.png','png')
After running the script. writeToFile() is giving Error saying 'mismatched input 'result' expecting RPAREN
Thanks in Advance
fix missing ')':
device.press()