我是appium的新手,我尝试使用Java / Intellij下面的代码运行示例
OSX El Capitan 10.11.2 Appium版本1.4.16
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("deviceName", "iPhone 6");
desiredCapabilities.setCapability("platformName", "iOS");
desiredCapabilities.setCapability("platformVersion", "9.2");
desiredCapabilities.setCapability("app", "http://appium.s3.amazonaws.com/TestApp6.0.app.zip");
driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), desiredCapabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
但我收到以下错误
这是日志信息
info: [debug] [INST] Instruments Trace Complete (Duration : 20.832968s; Output : /tmp/appium-instruments/instrumentscli0.trace)
info: [debug] [INSTSERVER] Instruments exited with code 0
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #1
info: [debug] Killall iOS Simulator
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:22 Moisess-MacBook-Pro DTServiceHub[56640]: Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:23 Moisess-MacBook-Pro assertiond[56635]: assertion failed: 15C50 13C75: assertiond + 12188 [8CF1968D-3466-38B7-B225-3F6F5B64C552]: 0x1
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:23 Moisess-MacBook-Pro ScriptAgent[56697]: Warning - Unable to stop script because the script was already stopped.
info: Launching instruments
info: [debug] Attempting to run app on iPhone 6 (9.2)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w "iPhone 6 (9.2)" /var/folders/mj/ysvr7x097ynb626pxp6f2zbm0000gn/T/11605-56384-6yj58r/TestApp.app -e UIASCRIPT "/Users/moisessiles/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:28 Moisess-MacBook-Pro SpringBoard[56630]: Weekly asset update check did fire (force=NO)
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:28 Moisess-MacBook-Pro SpringBoard[56630]: Beginning check for asset updates (force: 0
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:28 Moisess-MacBook-Pro SpringBoard[56630]: Did not complete check for asset updates (force: 0, isVoiceOverRunning: 0
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:29 Moisess-MacBook-Pro assertiond[56635]: assertion failed: 15C50 13C75: assertiond + 12188 [8CF1968D-3466-38B7-B225-3F6F5B64C552]: 0x1
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:29 Moisess-MacBook-Pro DTServiceHub[56640]: DTMemlimitAssertionFactory: failed to remove active and inactive memory limits for pid 56707 (result = -1)
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:29 Moisess-MacBook-Pro com.apple.CoreSimulator.SimDevice.5D6F2EC4-53A3-41E2-BCA6-108B991591C7.launchd_sim[56614] (UIKitApplication:D.TestApp[0xf0ea][56707]): Service exited due to signal: Trace/BPT trap: 5
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:29 Moisess-MacBook-Pro SpringBoard[56630]: Unable to get short BSD proc info for 56707: No such process
info: [debug] [INST] 2016-01-05 22:14:29 +0000 Fail: The target application appears to have died
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:30 Moisess-MacBook-Pro SpringBoard[56630]: Application 'UIKitApplication:D.TestApp[0xf0ea]' crashed.
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:30 Moisess-MacBook-Pro assertiond[56635]: assertion failed: 15C50 13C75: assertiond + 12188 [8CF1968D-3466-38B7-B225-3F6F5B64C552]: 0x1
info: [debug] [INST STDERR] 2016-01-05 16:14:30.057 instruments[56702:7555272] Attempting to change event horizon while disengage
info: [IOS_SYSLOG_ROW ] Jan 5 16:14:30 Moisess-MacBook-Pro ScriptAgent[56708]: Warning - Unable to stop script because the script was already stopped.
info: [debug] [INST] Instruments Trace Complete (Duration : 1.587851s; Output : /tmp/appium-instruments/instrumentscli0.trace)
我尝试使用之前版本的iphone和iOS,而且我正在使用
warn: Applications directory /Users/moisessiles/Library/Developer/CoreSimulator/Devices/5D6F2EC4-53A3-41E2-BCA6-108B991591C7/data/Containers/Bundle/Application doesn't exist. Have you run this simulator before?
info: Couldn't find app directories to delete. Probably it's not installed
info: [debug] Cleaning up appium session
info: [debug] Error: Instruments crashed on startup
at [object Object].Instruments.onInstrumentsExit (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:440:31)
at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:353:12)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null}
info: <-- POST /wd/hub/session 500 147478.284 ms - 182
答案 0 :(得分:2)
您使用的xcode版本是什么?在使用IOS 9.2时,您需要升级Xcode和仪器。 我通过升级我的操作系统,xcode和乐器成功地解决了同样的问题。
希望这有帮助。
答案 1 :(得分:0)
尝试在Mac上配置Android应用程序,如果工作正常,问题不是来自您使用的版本。 否则尝试更新最新版本的Xcode