#3 楼 @chenhengjie123 已更新。
1 楼 @chenhengjie123
这条 log 是有的,你说的这种方法我也试过了,没有效果,而且编译出来的 instruments 只有 300 多 byte,原来的有 14k。
编译完后还有下面的错误。估计不支持最新的 simulator,毕竟 github 上的也是好几个月前更新的了。
instruments[1132:35871] WebKit Threading Violation - initial use of WebKit from a secondary thread.
Instruments Usage Error : Ambiguous device name/identifier 'iPhone 5s (8.':
iPhone 5s (8.3 Simulator) [D4ED661F-56EB-491B-8776-4C0D9E33BB49]
iPhone 5s (8.1 Simulator) [11CA4F0F-F9FD-4D7E-AF96-E254E0D7C94D]
#9 楼 @chenhengjie123
启动 appium 的时候
appium -U 838ea3943db8c9a39c8db92d99f753d3006caf45 --app com.Alps.TestApp --native-instruments-lib false --log-timestamp
无法运行,说 “appium: error: Unrecognized arguments: false.”。貌似--native-instruments-lib 是不能带参数的。但是如果不带参数执行,这个配置又是 true:
[debug] Non-default server args: {"app":"com.Alps.TestApp","udid":"838ea3943db8c9a39c8db92d99f753d3006caf45","logTimestamp":true,"nativeInstrumentsLib":true}
请问下这个配置到底要怎么用啊?
#9 楼 @chenhengjie123
非常感谢,另外我还想问一下,appium.app 就是指的下载 appium.dmg 安装后的应用是吧?我用这个可以录制脚本,但是始终没有找到打开脚本运行的按钮,请问要怎么在 appium.app 中运行脚本?
如果我理解有误,那么你说的用 appium.app 指的是什么?
#7 楼 @chenhengjie123
我用了--log-timestamp,这是点击一个按键的 log,后发现
2015-04-24 02:49:53:329 - info: [debug] [INST] 2015-04-24 02:49:54 +0000 Debug: Got new command 3 from instruments: au.getElementByName('IntegerA')
以及
2015-04-24 02:49:54:433 - info: [debug] [INST] 2015-04-24 02:49:55 +0000 Debug: Got new command 4 from instruments: au.tapById('0')
都和上面相差了 1s,请问这是什么原因?
2015-04-24 02:49:52:349 - info: --> POST /wd/hub/session/ad96edc6-92b4-4b29-a2fc-d98281c83664/element {"using":"name","sessionId":"ad96edc6-92b4-4b29-a2fc-d98281c83664","value":"IntegerA"}
2015-04-24 02:49:52:349 - info: [debug] Waiting up to 0ms for condition
2015-04-24 02:49:52:349 - info: [debug] Pushing command to appium work queue: "au.getElementByName('IntegerA')"
2015-04-24 02:49:52:350 - info: [debug] Sending command to instruments: au.getElementByName('IntegerA')
2015-04-24 02:49:53:329 - info: [debug] [INST] 2015-04-24 02:49:54 +0000 Debug: Got new command 3 from instruments: au.getElementByName('IntegerA')
2015-04-24 02:49:53:331 - info: [debug] [INST] 2015-04-24 02:49:54 +0000 Debug: evaluating au.getElementByName('IntegerA')
2015-04-24 02:49:53:332 - info: [debug] [INST] 2015-04-24 02:49:54 +0000 Debug: evaluation finished
2015-04-24 02:49:53:334 - info: [debug] [INST] 2015-04-24 02:49:54 +0000 Debug: Lookup returned [object UIATextField] with the name "IntegerA" (id: 0).
2015-04-24 02:49:53:335 - info: [debug] [INST] 2015-04-24 02:49:54 +0000 Debug: responding with:
2015-04-24 02:49:53:337 - info: [debug] [INST] 2015-04-24 02:49:54 +0000 Debug: Running system command #4: /usr/local/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"ELEMENT":"0"}}...
2015-04-24 02:49:53:443 - info: [debug] Socket data received (38 bytes)
2015-04-24 02:49:53:444 - info: [debug] Socket data being routed.
2015-04-24 02:49:53:444 - info: [debug] Got result from instruments: {"status":0,"value":{"ELEMENT":"0"}}
2015-04-24 02:49:53:445 - info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"0"},"sessionId":"ad96edc6-92b4-4b29-a2fc-d98281c83664"}
2015-04-24 02:49:53:445 - info: <-- POST /wd/hub/session/ad96edc6-92b4-4b29-a2fc-d98281c83664/element 200 1096.855 ms - 87 {"status":0,"value":{"ELEMENT":"0"},"sessionId":"ad96edc6-92b4-4b29-a2fc-d98281c83664"}
2015-04-24 02:49:53:448 - info: --> POST /wd/hub/session/ad96edc6-92b4-4b29-a2fc-d98281c83664/element/0/click {"sessionId":"ad96edc6-92b4-4b29-a2fc-d98281c83664","id":"0"}
2015-04-24 02:49:53:448 - info: [debug] Pushing command to appium work queue: "au.tapById('0')"
2015-04-24 02:49:53:448 - info: [debug] Sending command to instruments: au.tapById('0')
2015-04-24 02:49:54:433 - info: [debug] [INST] 2015-04-24 02:49:55 +0000 Debug: Got new command 4 from instruments: au.tapById('0')
2015-04-24 02:49:54:435 - info: [debug] [INST] 2015-04-24 02:49:55 +0000 Debug: evaluating au.tapById('0')
2015-04-24 02:49:54:437 - info: [debug] [INST] 2015-04-24 02:49:55 +0000 Debug: UIATextField.tap()
2015-04-24 02:49:54:679 - info: [debug] Socket data received (25 bytes)
2015-04-24 02:49:54:680 - info: [debug] Socket data being routed.
2015-04-24 02:49:54:680 - info: [debug] Got result from instruments: {"status":0,"value":""}
2015-04-24 02:49:54:681 - info: [debug] Responding to client with success: {"status":0,"value":"","sessionId":"ad96edc6-92b4-4b29-a2fc-d98281c83664"}
2015-04-24 02:49:54:681 - info: <-- POST /wd/hub/session/ad96edc6-92b4-4b29-a2fc-d98281c83664/element/0/click 200 1233.742 ms - 74 {"status":0,"value":"","sessionId":"ad96edc6-92b4-4b29-a2fc-d98281c83664"}
启动的时候慢也就算了,但是运行起来每按一个键都要等 1-2s 再按第二个键,跑完一个简单的脚本都要跑好久,这是正常的吗?