我在运行 iPhone 6 模拟器的 mac 机器上启动了 appium 服务器。运行我的测试代码时,服务器会产生此输出。
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --address "192.168.56.101" --command-timeout "7200" --debug-log-spacing --platform-version "9.2" --platform-name "iOS" --show-ios-log --default-device
info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)
info: Appium REST http interface listener started on 192.168.56.101:4723
info: [debug] Non-default server args: {"address":"192.168.56.101","platformName":"iOS","platformVersion":"9.2","defaultDevice":true,"showIOSLog":true,"defaultCommandTimeout":7200,"debugLogSpacing":true}
info: Console LogLevel: debug
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"}}}
info: <-- GET /wd/hub/status 200 19.693 ms - 105 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"}}}
info: <-- GET /wd/hub/status 200 13.646 ms - 105 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"}}}
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","platformVersion":"9.2","platform":"Mac","deviceName":"iPhone 6","app":"/Applications/Appium.app/Contents/Resources/node_modules/appium/LinkedIn 910.5.ipa"}}
info: Client User-Agent string: undefined
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : platform
info: [debug] Using local .ipa from desired caps: /Applications/Appium.app/Contents/Resources/node_modules/appium/LinkedIn 910.5.ipa
info: [debug] Copying local zip to tmp dir
info: [debug] /Applications/Appium.app/Contents/Resources/node_modules/appium/LinkedIn 910.5.ipa copied to /var/folders/04/537dh3vj6mx44thqfqk0xmrr0000gn/T/11613-2130-1og0nig/appium-app.zip
info: [debug] Unzipping /var/folders/04/537dh3vj6mx44thqfqk0xmrr0000gn/T/11613-2130-1og0nig/appium-app.zip
info: [debug] Testing zip archive: /var/folders/04/537dh3vj6mx44thqfqk0xmrr0000gn/T/11613-2130-1og0nig/appium-app.zip
info: [debug] Zip archive tested clean
info: [debug] Unzip successful
info: [debug] Using locally extracted app: /var/folders/04/537dh3vj6mx44thqfqk0xmrr0000gn/T/11613-2130-1og0nig/Payload/Voyager.app
info: [debug] Creating new appium session 8c18542f-f9d5-4e3c-bb3a-96f9d45ae13e
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode version
info: [debug] Xcode version set to 7.2
info: [debug] Setting iOS SDK Version
info: [debug] iOS SDK Version set to 9.2
info: [debug] Checking whether instruments supports our device string
info: [debug] Getting list of devices instruments supports
info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: [debug] Getting list of devices instruments supports
error: Failed getting devices. Err: Error: Command failed: /bin/sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/instruments' -s devices
. Stdout: . Stderr: .
info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"7.2","iOSSDKVersion":"9.2","deviceName":"iPhone 6","platformVersion":"9.2"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 6 (9.2)'
info: [debug] iOS sim UDID is 9F1EA875-2501-46D0-A187-BF8DC6FC423B
info: [debug] Auto-detecting iOS udid...
信息:[调试] 不自动检测 udid,在 sim 上运行
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Parsed app Localizable.strings
info: [debug] Getting bundle ID from app
info: [debug] Could not parse plist file (as binary) at /var/folders/04/537dh3vj6mx44thqfqk0xmrr0000gn/T/11613-2130-1og0nig/Payload/Voyager.app/Info.plist
info: Will try to parse the plist file as XML
info: [debug] Parsed app Info.plist (as XML)
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/adibiton/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"oneByOne"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
info: [debug] Dynamic bootstrap path: /Users/adibiton/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js
info: [debug] Reusing dynamic bootstrap: /Users/adibiton/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"7.2","iOSSDKVersion":"9.2","deviceName":"iPhone 6","platformVersion":"9.2"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 6 (9.2)'
info: [debug] We're on iOS7.1+ so forcing defaultDevice on
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"7.2","iOSSDKVersion":"9.2","deviceName":"iPhone 6","platformVersion":"9.2"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 6 (9.2)'
info: [debug] Could not parse plist file (as binary) at /var/folders/04/537dh3vj6mx44thqfqk0xmrr0000gn/T/11613-2130-1og0nig/Payload/Voyager.app/Info.plist
info: Will try to parse the plist file as XML
info: [debug] Parsed app Info.plist (as XML)
info: [debug] Wrote new app Info.plist with device type
info: [debug] Checking whether we need to set app preferences
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] Cleaning sim data files
info: node-simctl: Executing: xcrun with args: simctl erase 9F1EA875-2501-46D0-A187-BF8DC6FC423B and timeout: 2000
info: node-simctl: Executing: xcrun with args: simctl erase 9F1EA875-2501-46D0-A187-BF8DC6FC423B and timeout: 2000
info: [debug] Cleaning app data files
warn: Applications directory /Users/adibiton/Library/Developer/CoreSimulator/Devices/9F1EA875-2501-46D0-A187-BF8DC6FC423B/data/Containers/Data/Application doesn't exist. Have you run this simulator before?
warn: Applications directory /Users/adibiton/Library/Developer/CoreSimulator/Devices/9F1EA875-2501-46D0-A187-BF8DC6FC423B/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] Not setting locale
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS 8.* simulator log capture
info: [debug] Not pre-launching simulator
info: [debug] Starting command proxy.
info: [debug] Instruments socket server started at /tmp/instruments_sock
info: [debug] Starting instruments
info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
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/04/537dh3vj6mx44thqfqk0xmrr0000gn/T/11613-2130-1og0nig/Payload/Voyager.app -e UIASCRIPT "/Users/adibiton/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib","LIB_PATH":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7"}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] dyld: could not load inserted library '/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib' because no suitable image found. Did find:
/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib: mmap() error 1 at address=0x106057000, size=0x00001000 segment=__TEXT in Segment::map() mapping /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib
info: [debug] [INSTSERVER] Instruments exited with code null
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: 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/04/537dh3vj6mx44thqfqk0xmrr0000gn/T/11613-2130-1og0nig/Payload/Voyager.app -e UIASCRIPT "/Users/adibiton/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib","LIB_PATH":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7"}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] dyld: could not load inserted library '/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib' because no suitable image found. Did find:
/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib: mmap() error 1 at address=0x106211000, size=0x00001000 segment=__TEXT in Segment::map() mapping /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib
info: [debug] [INSTSERVER] Instruments exited with code null
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #2
info: [debug] Killall iOS Simulator
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"8c18542f-f9d5-4e3c-bb3a-96f9d45ae13e"}
info: <-- GET /wd/hub/status 200 26.019 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"8c18542f-f9d5-4e3c-bb3a-96f9d45ae13e"}
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/04/537dh3vj6mx44thqfqk0xmrr0000gn/T/11613-2130-1og0nig/Payload/Voyager.app -e UIASCRIPT "/Users/adibiton/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib","LIB_PATH":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7"}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] dyld: could not load inserted library '/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib' because no suitable image found. Did find:
/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib: mmap() error 1 at address=0x10E271000, size=0x00001000 segment=__TEXT in Segment::map() mapping /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib
info: [debug] [INSTSERVER] Instruments exited with code null
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 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/04/537dh3vj6mx44thqfqk0xmrr0000gn/T/11613-2130-1og0nig/Payload/Voyager.app -e UIASCRIPT "/Users/adibiton/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib","LIB_PATH":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7"}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] dyld: could not load inserted library '/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib' because no suitable image found. Did find:
/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib: mmap() error 1 at address=0x107394000, size=0x00001000 segment=__TEXT in Segment::map() mapping /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib
info: [debug] [INSTSERVER] Instruments exited with code null
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] Killing any other simulator daemons
info: [debug] Killall iOS Simulator
info: [debug] Cleaning sim data files
info: node-simctl: Executing: xcrun with args: simctl erase 9F1EA875-2501-46D0-A187-BF8DC6FC423B and timeout: 2000
info: [debug] Cleaning app data files
warn: Applications directory /Users/adibiton/Library/Developer/CoreSimulator/Devices/9F1EA875-2501-46D0-A187-BF8DC6FC423B/data/Containers/Data/Application doesn't exist. Have you run this simulator before?
warn: Applications directory /Users/adibiton/Library/Developer/CoreSimulator/Devices/9F1EA875-2501-46D0-A187-BF8DC6FC423B/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
error: Failed to start an Appium session, err was: Error: Instruments crashed on startup
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 59037.189 ms - 182
我安装了 Xcode 并运行了一个模拟器。为什么服务器无法获取设备?