0

我正在尝试将 rect 输出与执行操作命令一起使用。例如:

query("* text:’Hello’", :y)
                                                                                        [
    [0] 226.0
]

试: perform_action('long_press_coordinate',200,y)

并得到错误:

RuntimeError: Action 'long_press_coordinate' unsuccessful: Can not deserialize instance of java.lang.String[] out of END_OBJECT token
 at [Source: java.io.StringReader@412a8480; line: 1, column: 61] (through reference chain: sh.calaba.instrumentationbackend.Command["arguments"])

这是我正在处理的语法问题还是更多?如何将 y 值“转换”为常规数字?

4

1 回答 1

-1

我找到了有效的代码:

y=query("* text:’Hello’", :y)

perform_action('long_press_coordinate',200,y[0])

希望它有所帮助。

于 2015-03-15T14:17:19.077 回答