gpt4 book ai didi

android - 想在windows平台运行Monkeyrunner加载图片对比

转载 作者:行者123 更新时间:2023-11-29 14:56:23 24 4
gpt4 key购买 nike

  1. checking=MonkeyRunner.loadImageFromFile(chk)
  2. checking=MonkeyRunner.loadFromFile(chk)
  3. checking=MonkeyImage.loadFromFile(chk)

以上都报错

Traceback (most recent call last): File "stdin", line 1, in AttributeError: type object 'com.android.monkeyrunner.MonkeyRunner' has no attri bute 'loadFromFile'

最佳答案

要查看您的 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']

如果不符合您的预期,请从源代码构建。

关于android - 想在windows平台运行Monkeyrunner加载图片对比,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5881712/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com