Appium Server version:1.4.13

问题一

问题描述:发送一个非法的 xpath 请求,例如:driver.findElement(By.xpath("delay->8")).click(),导致 Appium Server 直接崩溃退出
开始以为服务端顶多抛个异常,通知用户非法指令或非法参数之类的,也不至于退出吧,自己犯的的一个低级错误无意踩中 Appium 的一个问题

Appium Server Log
error: uncaughtException: selectedNodes.slice is not a function date=Mon May 23 2016 11:10:30 GMT+0800 (CST)

问题二

问题描述:iOS 真机运行 1 个多小时,instruments 异常导致 Appium Server 退出
问题分析:是否是 app 内存泄露、溢出导致 instruments 工作异常而退出,最终导致 appium 服务的退出?

App Log
2016-05-30 22:06:09 app_log : May 30 22:02:31 iPhone XXX[1973] <Warning>: TalkingData: event 主页面:主页面_点击_财经快讯 parameters:{
2016-05-30 22:06:09 app_log : May 30 22:02:31 iPhone XXX[1973] <Warning>: TalkingData: trackPage begin pageName:财经快讯_首页
2016-05-30 22:06:09 app_log : May 30 22:02:32 iPhone XXX[1973] <Warning>: TalkingData: 页面简单理财停留时间: 10
2016-05-30 22:06:09 app_log : May 30 22:02:33 iPhone XXX[1973] <Warning>: Received memory warning.

Appium Client Log
org.openqa.selenium.WebDriverException: Instruments died while responding to command, please check appium logs (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 155.20 seconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: 'macdeMBP', ip: '192.168.1.5', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.5', java.version: '1.8.0_74'
Driver info: io.appium.java_client.ios.IOSDriver

Appium Server Log
info: [debug] [INST] 2016-05-30 13:44:08 +0000 Debug: Got new command 2899 from instruments: au.tapById('219')
info: [debug] [INST] 2016-05-30 13:44:08 +0000 Debug: evaluating au.tapById('219')
info: [debug] [INST] 2016-05-30 13:44:08 +0000 Debug: target.frontMostApp().elements()[0].elements()[1].elements()[21].tap()
info: [debug] [INST] 2016-05-30 13:44:08 +0000 Debug: evaluation finished
info: [debug] [INST] 2016-05-30 13:44:08 +0000 Debug: responding with:
info: [debug] [INST] 2016-05-30 13:44:08 +0000 Debug: Running system command #2900: /usr/local/Cellar/node/5.9.0/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":""}...
info: [debug] [INST] 2016-05-30 13:44:10 +0000 Debug: Got new command 2900 from instruments: au.mainApp().getTreeForXML()
info: [debug] [INST] 2016-05-30 13:44:10 +0000 Debug: evaluating au.mainApp().getTreeForXML()
info: [debug] [INST] 2016-05-30 13:44:11 +0000 Debug: evaluation finished
info: [debug] [INSTSERVER] Instruments exited with code null
info: [debug] Cleaning up after instruments exit
info: [debug] Instruments exited unexpectedly
info: [debug] Shutting down command proxy and ignoring any errors
info: [debug] Closing socket server.
info: [debug] Instruments socket server was closed
info: [debug] Stopping iOS log capture
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killing any other simulator daemons
info: [debug] Killall iOS Simulator
info: [debug] On a real device; cannot clean device state
info: [debug] We were in the middle of processing a command when instruments died; responding with a generic error
info: [debug] Cleaning up appium session
info: [debug] Responding to client with error: {"status":13,"value":{"message":"Instruments died while responding to command, please check appium logs","name":"UnknownError","origValue":"Instruments died while responding to command, please check appium logs"},"sessionId":null}
info: <-- GET /wd/hub/session/f4b19ca1-ca3d-4d78-afd6-39d9e8ce9177/source 500 155113.474 ms - 230 
info: --> GET /wd/hub/session/f4b19ca1-ca3d-4d78-afd6-39d9e8ce9177/source {}
info: <-- GET /wd/hub/session/f4b19ca1-ca3d-4d78-afd6-39d9e8ce9177/source 404 2.884 ms - 40 
info: --> POST /wd/hub/session/f4b19ca1-ca3d-4d78-afd6-39d9e8ce9177/appium/app/close {}


↙↙↙阅读原文可查看相关链接,并与作者交流