基本环境
mac:10.10.2
appium : 1.3.5
iphone Simulator:iphone 5, ios 8
配置 Java 代码:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "iPhone 5");
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("platformVersion", "8.1");
capabilities.setCapability("app", "safari");
driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"),
capabilities);
日志代码
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] 2015-03-13 14:47:06.294 instruments[873:31261] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST] Waiting for device to boot...
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Unable to install app with path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/MobileSafari.app: "(null)"
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 iOS Simulator
info: [debug] Killing any other simulator daemons
info: [debug] Cleaning sim data files
此处省略。。。
error: Could not reset simulator. Leaving as is. Error: Command failed: An error was encountered processing the command (code=146):
Unable to erase contents and settings in current state: Booted
info: [debug] Cleaning mobile safari data files
info: [debug] Deleting /Users/Kristina/Library/Developer/CoreSimulator/Devices/65C402AB-91E1-4512-8E29-00F093463C00/data/Library/Caches/Snapshots/com.apple.mobilesafari
此处省略。。。
error: Failed to start an Appium session, err was: Error: Instruments crashed on startup
info: [debug] Error: Instruments crashed on startup
at Instruments.onInstrumentsExit (/usr/local/lib/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:389:31)
at null.<anonymous> (/usr/local/lib/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:308:12)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:810: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}
Unable to install app with path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/MobileSafari.app: "(null)"
这个路径存在,但是不明白为什么不能 install?启动 safari 的时候失败,模拟器未启动成功。困扰良久,希望能解答~
PS:日志模块 不知道贴什么语言的代码,若有不当之处,还望提出