配置环境:
Mac :10.10.2
appium :1.3.6
ios:iphone 6 iOS 8.1
JAVA 配置代码
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("deviceName", "iPhone 6");
desiredCapabilities.setCapability("platformName", "iOS");
desiredCapabilities.setCapability("platformVersion", "8.1");
desiredCapabilities.setCapability("app", "/Users/Kristina/Desktop/SafariLauncher.ipa");
desiredCapabilities.setCapability("udid","...........设备号....");
URL url = new URL("http://127.0.0.1:4723/wd/hub");
driver = new RemoteWebDriver(url, desiredCapabilities);
appium log 内容
[INST STDERR] 2015-03-17 11:14:30.835 instruments[1829:83101] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug com.dooioo.safariLauncher was denied. The app must be signed with a development identity (e.g. iOS Developer).
info: [debug] [INSTSERVER] Instruments exited with code 253
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #3
info: [debug] Killall iOS Simulator
info: Launching instruments
info: [debug] Attempting to run app on real device with UDID .............
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 ccc918011e6404e43e30ca18ead232b6d4e84e90 com.dooioo.safariLauncher -e UIASCRIPT "/Users/Kristina/Library/Application Support/appium/bootstrap/bootstrap-0b4d5830daa12b26.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":90000}
证书之类的已经安装成功,通过 itunes 也能正常安装 SafariLauncher.ipa 该 app,但是通过脚本启动就发生上述错误,启动失败
Google 之后,发现网上有大致有三种解决方案,但是实在理解能力有限,不太明白所说的内容:
1.修改 Entitlements Plist 文件的 get-task-allow 属性为 true(https://discuss.appium.io/t/the-app-must-be-signed-with-a-development-identity/2653/2)。这个文件我已经创建成果,但是该添加在什么地方,不是很清楚
2.https://github.com/appium/appium/issues/3947 该问题和我的问题一模一样,看到最后的解决方案时 use this: https://github.com/appium/appium/blob/master/bin/ios-webkit-debug-proxy-launcher.js. 这个 js 我看了 我安装的 appium 路径下也有该文件,但他所说的是 “use” 是如何使用呢?也不是很清楚
3.最后一种也是我和我从 log 表面分析的,是证书问题,使用 developer 证书,因为现在用的是 adhoc 的证书,但开发者发布都是用的 adhoc 证书,试着选择 developer 证书后无法进行打包。
看了网上这么多有这种错误,自己却始终没解决,也够郁闷了,希望有人能帮忙解决~