【发布时间】:2014-11-21 20:24:12
【问题描述】:
长话短说,我遵循了这个http://appium.io/slate/en/tutorial/ios.html?java# 教程,现在我有了一个项目。不幸的是,我找不到使用网页运行 appium 的教程。到目前为止,我已经根据自己的需要进行了编辑,也就是说,它会打开 google.com,它可以在模拟器中运行。
我已经在设备上安装了 SafariLauncher。手动单击应用程序时,它确实有效。
但是,当我使用 SafariLauncher 和 appium 时,你可以看出它不起作用。
这是控制台告诉我的 ->
info: [debug] Attempting to run app on real device with UDID 5343fa7f9c04cb60f02cb40f1233073d23dbbbc7
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.bundle/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w 5343fa7f9c04cb60f02cb40f1233073d23dbbbc7 /Users/wroberts/Library/Developer/Xcode/DerivedData/SafariLauncher-fvxpuhbhozeuydcsrdzjhhzlzpsu/Build/Products/Debug-iphoneos/SafariLauncher.app -e UIASCRIPT "/Users/wroberts/Library/Application Support/appium/bootstrap/bootstrap-971fed56c9389ee5.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] 2014-11-21 15:09:18.206 instruments[19158:3c0b] Error fetching kdebug events
info: [debug] [INSTSERVER] Instruments exited with code 253
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] We exceeded the number of retries allowed for instruments to successfully start; failing launch
info: [debug] Stopping iOS log capture
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iPhoneSimulator
info: [debug] Killing any other simulator daemons
info: [debug] On a real device; cannot clean device state
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Instruments crashed on startup
info: [debug] Error: Instruments crashed on startup
at Instruments.onInstrumentsExit (/Users/wroberts/dev/differnt_svns/mobile_automation/appium/submodules/appium-instruments/lib/instruments.js:387:31)
at null.<anonymous> (/Users/wroberts/dev/differnt_svns/mobile_au`enter code here`tomation/appium/submodules/appium- instruments/lib/instruments.js:308:12)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:809:12)
这是我的相关代码
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("appium-version", "1.3.1");
//capabilities.setCapability("platformVersion", "8.1");
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("deviceName", "Tahir's iPhone");
capabilities.setCapability("udid", "5343fa7f9c04cb60f02cb40f1233073d23dbbbc7");
String bundle = "/Users/wroberts/Library/Developer/Xcode/DerivedData/SafariLauncher-fvxpuhbhozeuydcsrdzjhhzlzpsu/Build/Products/Debug-iphoneos/SafariLauncher.app";
capabilities.setCapability("bundleId", bundle);
capabilities.setCapability("app", bundle);
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.get("http://www.google.com");
Thread.sleep(20000);
简而言之,任何人都可以让 SafariLauncher 在真实设备上运行吗?
【问题讨论】:
标签: java ios selenium safari appium