Tencent / GAutomator

Automation for mobile games
1.33k stars 383 forks source link

执行main报错 #31

Open l1000965431 opened 6 years ago

l1000965431 commented 6 years ago

堆栈: File "E:/HBWork/GAutomator/main.py", line 199, in main _run() File "E:/HBWork/GAutomator/main.py", line 128, in _run prepare = _prepare() File "E:/HBWork/GAutomator/main.py", line 107, in _prepare lanuch_result = _native_prepare() File "E:/HBWork/GAutomator/main.py", line 71, in _native_prepare device = manager.get_device() File "E:\HBWork\GAutomator\wpyscripts\manager.py", line 58, in get_device ui_device = uiauto.get_uiautomator() File "E:\HBWork\GAutomator\wpyscripts\uiautomator\uiautomator_manager.py", line 57, in get_uiautomator port=_init() File "E:\HBWork\GAutomator\wpyscripts\uiautomator\uiautomator_manager.py", line 49, in _init _init_uiautomator() File "E:\HBWork\GAutomator\wpyscripts\uiautomator\uiautomator_manager.py", line 32, in _init_uiautomator print(adb.cmd_wait("push",uiautomator_stub_path,"/data/local/tmp")) File "E:\HBWork\GAutomator\wpyscripts\common\adb_process.py", line 70, in cmd_wait cmd = self.raw_cmd(*args) File "E:\HBWork\GAutomator\wpyscripts\common\adb_process.py", line 81, in raw_cmd return subprocess.Popen(cmd_line, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "C:\Python27\lib\subprocess.py", line 390, in init errread, errwrite) File "C:\Python27\lib\subprocess.py", line 595, in _execute_child args = list2cmdline(args) File "C:\Python27\lib\subprocess.py", line 262, in list2cmdline needquote = (" " in arg) or ("\t" in arg) or not arg TypeError: argument of type 'NoneType' is not iterable

wukenaihe commented 6 years ago

@l1000965431 请问,本地是否安装有adb?

l1000965431 commented 6 years ago

安装了,环境配置好了已经

l1000965431 commented 6 years ago

GAutomatorView可以正常使用

wukenaihe commented 6 years ago

@l1000965431 麻烦你在E:\HBWork\GAutomator\wpyscripts\common\adb_process.py",81行的地方加一句print(cmd_line),输出下这个看下。是在看不会原因来

l1000965431 commented 6 years ago

请问模拟器不支持?测试了一下真机可以拉起游戏。

wukenaihe commented 6 years ago

@l1000965431 支持模拟器的,模拟器只要有adb,是一样的

l1000965431 commented 6 years ago

An exception was thrown by the type initializer for r at WeTest.U3DAutomation.CoordinateTool.GetCurrenScreenScale (System.Single& scalex, System.Single& scaley) [0x00000] in :0 at WeTest.U3DAutomation.CoordinateTool.ConvertMobile2Unity (WeTest.U3DAutomation.Point pt) [0x00000] in :0 at x.b (WeTest.U3DAutomation.Point A_0) [0x00000] in :0 at c.a (WeTest.U3DAutomation.Point A_0) [0x00000] in :0 (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37) 调用screen_shot_click函数会报错,按钮控件可以获取到,麻烦看一下原因谢谢

wukenaihe commented 6 years ago

@l1000965431 GAutomatorView能正常使用,然后使用脚本的时候,这个出错了?

l1000965431 commented 6 years ago

对,是这样。

l1000965431 commented 6 years ago

我发现GAutomatorView上,我选中某个gameobject节点时,也会报这个错。

wukenaihe commented 6 years ago

@l1000965431 什么节点?上面有什么component?

l1000965431 commented 6 years ago

一个按钮,上边有uibutton,uispritre,uibuttionscale,boxcolider这几个component。应该和控件没关系吧,我调用engine.click_position()这个接口也会报错,这个接口应该和具体的gameobject和component没关系吧。

wukenaihe commented 6 years ago

@l1000965431 看报错的位置,应该就是在计算控件长宽高的时候错误的。是所有的,节点都会报这个错误吗?

l1000965431 commented 6 years ago

对,所有节点都会报错。

wukenaihe commented 6 years ago

@l1000965431 你QQ多少?我加你QQ

l1000965431 commented 6 years ago

@wukenaihe 271926641加这个

l1000965431 commented 6 years ago

@wukenaihe 或者你给我一个QQ我加你