#6 楼 @chenhengjie123 @sanlengjingvv
出错日志贴上了,还是没有自动安装啊....
PS:bundle id 是必须的,你没有指定的话 appium 自己会去解析 app 来获取。
我记得是如果手机安装了 app 就指定 bundle id,如果未安装 app,就指定 app 路径,这样:“ capabilities.setCapability("app", "/Users/eternally/Downloads/testscoe7.9.2(v3 开发者证书测试接口).ipa"); ” 所以不用指定 bundle id 吧,我想自动安装 app。
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformVersion":"8.4","app":"/Users/eternally/Downloads/testscoe7.9.2(v3开发者证书测试接口).ipa","platformName":"iOS","deviceName":"iPhone 5c","appium-version":"1.0","udid":"27914dfb88cedd20976995846287ac8b63d9eee7"}}
info: Client User-Agent string: Apache-HttpClient/4.4.1 (Java/1.7.0_79)
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. : appium-version
info: [debug] Using local .ipa from desired caps: /Users/eternally/Downloads/testscoe7.9.2(v3开发者证书测试接口).ipa
info: [debug] Copying local zip to tmp dir
info: [debug] /Users/eternally/Downloads/soufun7.9.2(v3开发者证书测试接口).ipa copied to /var/folders/4k/rt5zn03x2m51vp44jxm1sx9c0000gn/T/115718-38808-1nh4362/appium-app.zip
info: [debug] Unzipping /var/folders/4k/rt5zn03x2m51vp44jxm1sx9c0000gn/T/115718-38808-1nh4362/appium-app.zip
info: [debug] Testing zip archive: /var/folders/4k/rt5zn03x2m51vp44jxm1sx9c0000gn/T/115718-38808-1nh4362/appium-app.zip
info: [debug] Zip archive tested clean
info: [debug] Unzip successful
info: [debug] Got a relaxed match for app in zip, be careful for app match errors
info: [debug] Using locally extracted app: /var/folders/4k/rt5zn03x2m51vp44jxm1sx9c0000gn/T/115718-38808-1nh4362/Payload/SouFun.app
info: [debug] Creating new appium session 68dc26ba-fb20-4245-a456-12bfe8125038
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Auto-detecting iOS udid...
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Parsed app Localizable.strings
info: [debug] Getting bundle ID from app
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/eternally/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/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
info: [debug] Dynamic bootstrap path: /Users/eternally/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.js
info: [debug] Reusing dynamic bootstrap: /Users/eternally/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.js
info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog
info: [debug] Creating iDevice object with udid 27914dfb88cedd20976995846287ac8b63d9eee7
info: [debug] App is not installed. Will try to install the app.
info: [debug] Installing ipa found at /Users/eternally/Downloads/soufun7.9.2(v3开发者证书测试接口).ipa
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.8","revision":"c8179bd8352d3c62d98fa58b324491230df9342a"},"isShuttingDown":false},"sessionId":"68dc26ba-fb20-4245-a456-12bfe8125038"}
info: <-- GET /wd/hub/status 200 3.074 ms - 178 {"status":0,"value":{"build":{"version":"1.4.8","revision":"c8179bd8352d3c62d98fa58b324491230df9342a"},"isShuttingDown":false},"sessionId":"68dc26ba-fb20-4245-a456-12bfe8125038"}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.8","revision":"c8179bd8352d3c62d98fa58b324491230df9342a"},"isShuttingDown":false},"sessionId":"68dc26ba-fb20-4245-a456-12bfe8125038"}
info: <-- GET /wd/hub/status 200 1.068 ms - 178 {"status":0,"value":{"build":{"version":"1.4.8","revision":"c8179bd8352d3c62d98fa58b324491230df9342a"},"isShuttingDown":false},"sessionId":"68dc26ba-fb20-4245-a456-12bfe8125038"}
info: [debug] Nothing found on device, going ahead and installing.
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 real device with UDID 27914dfb88cedd20976995846287ac8b63d9eee7
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 27914dfb88cedd20976995846287ac8b63d9eee7 com.soufun.SoufunBasic -e UIASCRIPT "/Users/eternally/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.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] 2015-08-18 20:40:31.735 instruments[38822:11414398] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 4.) : Failed to launch process with bundle identifier 'com.soufun.SoufunBasic'
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 #1
info: [debug] Killall iOS Simulator
info: Launching instruments
info: [debug] Attempting to run app on real device with UDID 27914dfb88cedd20976995846287ac8b63d9eee7
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 27914dfb88cedd20976995846287ac8b63d9eee7 com.soufun.SoufunBasic -e UIASCRIPT "/Users/eternally/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.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] 2015-08-18 20:40:38.999 instruments[38825:11414496] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 4.) : Failed to launch process with bundle identifier 'com.soufun.SoufunBasic'
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 #2
info: [debug] Killall iOS Simulator
info: Launching instruments
info: [debug] Attempting to run app on real device with UDID 27914dfb88cedd20976995846287ac8b63d9eee7
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 27914dfb88cedd20976995846287ac8b63d9eee7 com.soufun.SoufunBasic -e UIASCRIPT "/Users/eternally/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.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] 2015-08-18 20:40:45.735 instruments[38828:11414818] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 4.) : Failed to launch process with bundle identifier 'com.soufun.SoufunBasic'
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 27914dfb88cedd20976995846287ac8b63d9eee7
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 27914dfb88cedd20976995846287ac8b63d9eee7 com.soufun.SoufunBasic -e UIASCRIPT "/Users/eternally/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.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] 2015-08-18 20:40:52.707 instruments[38831:11415026] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 4.) : Failed to launch process with bundle identifier 'com.soufun.SoufunBasic'
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] Killing any other simulator daemons
info: [debug] Killall iOS Simulator
info: [debug] On a real device; cannot clean device state
error: Failed to start an Appium session, err was: Error: Instruments crashed on startup
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/node_modules/appium-instruments/lib/instruments.js:440:31)
at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/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 33548.344 ms - 182