环境配置

XODE 版本 7.2
mac ox 版本 10.10.5
appium 版本 1.4.13

真机使用的 ipa 包也是开发使用 Development 证书打的包

PS 开发者 enable ui automation 已打开

下面贴出 appium 出错 log

(node:883) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

2016-08-10 07:42:40:302 - info: [debug] Starting Appium in pre-launch mode

2016-08-10 07:42:40:307 - info: Pre-launching app
2016-08-10 07:42:40:307 - info: *************************************
2016-08-10 07:42:40:308 - info: *************************************
2016-08-10 07:42:40:308 - info: *************************************
2016-08-10 07:42:40:308 - info: *************************************
2016-08-10 07:42:40:309 - info: *************************************
2016-08-10 07:42:40:309 - info: *************************************
2016-08-10 07:42:40:309 - info: *************************************
2016-08-10 07:42:40:310 - info: *************************************
2016-08-10 07:42:40:310 - info: ****        NEW SESSION           ***
2016-08-10 07:42:40:310 - info: ****        NEW SESSION           ***
2016-08-10 07:42:40:311 - info: ****        NEW SESSION           ***
2016-08-10 07:42:40:311 - info: ****        NEW SESSION           ***
2016-08-10 07:42:40:312 - info: ****        NEW SESSION           ***

2016-08-10 07:42:40:312 - info: ****        NEW SESSION           ***
2016-08-10 07:42:40:312 - info: ****        NEW SESSION           ***
2016-08-10 07:42:40:312 - info: ****        NEW SESSION           ***
2016-08-10 07:42:40:313 - info: *************************************
2016-08-10 07:42:40:313 - info: *************************************
2016-08-10 07:42:40:313 - info: *************************************
2016-08-10 07:42:40:314 - info: *************************************
2016-08-10 07:42:40:314 - info: *************************************
2016-08-10 07:42:40:314 - info: *************************************
2016-08-10 07:42:40:314 - info: *************************************
2016-08-10 07:42:40:314 - info: *************************************

2016-08-10 07:42:40:319 - info: [debug] Using local .ipa from command line: /Users/shuai/Documents/workspace/AutoAppiumIosUnittest/APP/5.3APP.ipa
2016-08-10 07:42:40:319 - info: [debug] Copying local zip to tmp dir

2016-08-10 07:42:40:363 - info: [debug] /Users/shuai/Documents/workspace/AutoAppiumIosUnittest/APP/5.3APP.ipa copied to /var/folders/70/lygd9hmj4sl276091zn0x3700000gn/T/116710-883-akf8hn.1imxgpsyvi/appium-app.zip

2016-08-10 07:42:40:377 - info: [debug] Unzipping /var/folders/70/lygd9hmj4sl276091zn0x3700000gn/T/116710-883-akf8hn.1imxgpsyvi/appium-app.zip

2016-08-10 07:42:40:378 - info: [debug] Testing zip archive: /var/folders/70/lygd9hmj4sl276091zn0x3700000gn/T/116710-883-akf8hn.1imxgpsyvi/appium-app.zip

2016-08-10 07:42:40:589 - info: [debug] Zip archive tested clean

2016-08-10 07:42:40:847 - info: [debug] Unzip successful

2016-08-10 07:42:40:848 - info: [debug] Using locally extracted app: /var/folders/70/lygd9hmj4sl276091zn0x3700000gn/T/116710-883-akf8hn.1imxgpsyvi/Payload/APP.app

2016-08-10 07:42:40:850 - info: [debug] Creating new appium session 6ccadd17-add8-4d95-890d-4deab71f6569
2016-08-10 07:42:40:853 - info: [debug] Removing any remaining instruments sockets
2016-08-10 07:42:40:855 - info: [debug] Cleaned up instruments socket /tmp/instruments_sock
2016-08-10 07:42:40:855 - info: [debug] Auto-detecting iOS udid...
2016-08-10 07:42:40:856 - info: [debug] Not auto-detecting udid, running on sim

2016-08-10 07:42:40:861 - info: [debug] Parsed app Info.plist (as binary)
2016-08-10 07:42:40:862 - info: [debug] Parsed app Localizable.strings
2016-08-10 07:42:40:862 - info: [debug] Getting bundle ID from app
2016-08-10 07:42:40:864 - info: [debug] Parsed app Info.plist (as binary)
2016-08-10 07:42:40:865 - info: [debug] Creating instruments
2016-08-10 07:42:40:866 - info: [debug] Preparing uiauto bootstrap
2016-08-10 07:42:40:867 - info: [debug] Dynamic bootstrap dir: /Users/shuai/Library/Application Support/appium/bootstrap
2016-08-10 07:42:40:867 - info: [debug] Dynamic env: {"nodePath":"/usr/local/Cellar/node/6.1.0/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"}

2016-08-10 07:42:40:875 - info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
2016-08-10 07:42:40:875 - info: [debug] Dynamic bootstrap path: /Users/shuai/Library/Application Support/appium/bootstrap/bootstrap-09b3d97391f069cc.js
2016-08-10 07:42:40:880 - info: [debug] Reusing dynamic bootstrap: /Users/shuai/Library/Application Support/appium/bootstrap/bootstrap-09b3d97391f069cc.js
2016-08-10 07:42:40:882 - info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog

2016-08-10 07:42:40:950 - info: [debug] Creating iDevice object with udid 415a5a2f296924baf3b233e70f0d15c01432d0a7

2016-08-10 07:42:42:514 - info: [debug] App is installed.

2016-08-10 07:42:42:515 - info: [debug] fullReset not requested. No need to install.
2016-08-10 07:42:42:515 - info: [debug] Starting command proxy.

2016-08-10 07:42:42:522 - info: [debug] Instruments socket server started at /tmp/instruments_sock
2016-08-10 07:42:42:522 - info: [debug] Starting instruments

2016-08-10 07:42:42:566 - info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments

2016-08-10 07:42:42:567 - info: Launching instruments

2016-08-10 07:42:42:584 - info: [debug] Attempting to run app on real device with UDID 415a5a2f296924baf3b233e70f0d15c01432d0a7

2016-08-10 07:42:42:585 - 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 415a5a2f296924baf3b233e70f0d15c01432d0a7 emas.dis.123 -e UIASCRIPT "/Users/shuai/Library/Application Support/appium/bootstrap/bootstrap-09b3d97391f069cc.js" -e UIARESULTSPATH /tmp/appium-instruments
2016-08-10 07:42:42:586 - info: [debug] And extra without-delay env: {}
2016-08-10 07:42:42:586 - info: [debug] And launch timeouts (in ms): {"global":90000}

2016-08-10 07:42:43:594 - info: [debug] [INST STDERR] Instruments Usage Error : Specified target process is invalid: emas.dis.123

2016-08-10 07:42:43:595 - info: [debug] [INST STDERR] instruments, version 7.2 (59503)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]

2016-08-10 07:42:43:606 - info: [debug] [INSTSERVER] Instruments exited with code 255
2016-08-10 07:42:43:608 - info: [debug] Killall instruments
2016-08-10 07:42:43:611 - info: [debug] Instruments crashed on startup
2016-08-10 07:42:43:612 - info: [debug] Attempting to retry launching instruments, this is retry #1
2016-08-10 07:42:43:614 - info: [debug] Killall iOS Simulator


↙↙↙阅读原文可查看相关链接,并与作者交流