,看看有什麼在你的monkeyrunner,運行此腳本:
#! /opt/android-sdk/tools/monkeyrunner
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
for m in [MonkeyRunner, MonkeyDevice, MonkeyImage]:
print "%s:\n %s\n" % (m.__name__, dir(m))
你會看到什麼是定義和在哪裏。例如,SDK中的monkeyrunner返回
MonkeyRunner:
['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 'alert', 'choice', 'help', 'input', 'sleep', 'waitForConnection']
MonkeyDevice:
['DOWN', 'DOWN_AND_UP', 'UP', '__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 'broadcastIntent', 'drag', 'getProperty', 'getSystemProperty', 'installPackage', 'instrument', 'press', 'reboot', 'removePackage', 'shell', 'startActivity', 'takeSnapshot', 'touch', 'type', 'wake']
MonkeyImage:
['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 'convertToBytes', 'getRawPixel', 'getRawPixelInt', 'getSubImage', 'sameAs', 'writeToFile']
如果不符合您的預期,則從源代碼構建。
dtmilano。我得到了與預期相同的結果。但我的問題是升級monkeyrunner。請給我詳細資料,以找到最新的monkeyrunner。 – Ravi 2011-06-16 12:42:42