Appium Failed to start an Appium session, err was: Error: spawn ENOENT 这个错大家有没有遇到过?

匿名 · 2014年09月05日 · 最后由 xuxiujin 回复于 2014年09月24日 · 1728 次阅读

刚刚 Appium 提示我有更新,然后我就小手一抖点了更新,完了之后再执行之前写的脚本,
就报下面的错了,各位大神有木有遇到过?Appium 1.2.2

虽然报错,但是后面 App 还是正常安装并启动起来了 o(╯□╰) o

info: [debug] Creating new appium session a567014d-2467-4a23-9b48-6fc905c87746
info: [debug] Removing any remaining instruments sockets

info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder
info: [debug] Setting Xcode version

info: [debug] Setting iOS SDK Version

info: [debug] iOS SDK Version set to 7.1

info: [debug] Detecting automation tracetemplate

info: [debug] Not auto-detecting udid, running on sim

info: [debug] Parsed app Info.plist (as binary)

error: iOS log capture failed: spawn ENOENT

info: [debug] Parsed app Localizable.strings
info: [debug] Not setting locale because we're using a real device
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir:
info: [debug] Dynamic env:
info: [debug] Dynamic bootstrap code:
info: [debug] Dynamic bootstrap path:
info: [debug] Reusing dynamic bootstrap:
info: [debug] Fixing device was changed from:"
info: [debug] Not setting iOS and app preferences since we're on a real device
info: [debug] Starting iOS device log capture via deviceconsole
info: [debug] Cleaning up appium session
info: [debug] Error: spawn ENOENT
    at errnoException (child_process.js:1001:11)
    at Process.ChildProcess._handle.onexit (child_process.js:792:34)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: spawn ENOENT)","code":"ENOENT","errno":"ENOENT","syscall":"spawn","origValue":"spawn ENOENT"},"sessionId":null}
info: <-- POST /wd/hub/session 500 458.278 ms - 197 

error: Failed to start an Appium session, err was: Error: spawn ENOENT

脚本不做任何修改,Appium 版本回退到 1.2.1 就没有报错了,不知道是不是我的配置有啥问题⊙﹏⊙b

debug: Creating new appium session 49030493-be77-4791-963c-72bdcb21d65f

debug: Removing any remaining instruments sockets
debug: Cleaned up instruments socket /tmp/instruments_sock
debug: Setting Xcode folder

debug: Setting Xcode version

debug: Setting iOS SDK Version

debug: iOS SDK Version set to 7.1

debug: Detecting automation tracetemplate

debug: Not auto-detecting udid, running on sim

debug: Parsed app Info.plist (as binary)
debug: Parsed app Localizable.strings
debug: Not setting locale because we're using a real device
debug: Creating instruments
debug: Preparing uiauto bootstrap
debug: Dynamic bootstrap dir: /Users/Link/Library/Application Support/appium/bootstrap
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}
debug: Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

#import "/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/uiauto/bootstrap.js";

bootstrap({
  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,
});
debug: Dynamic bootstrap path: /Users/Link/Library/Application Support/appium/bootstrap/bootstrap-3fd3829137e4c5d0.js
debug: Reusing dynamic bootstrap: /Users/Link/Library/Application Support/appium/bootstrap/bootstrap-3fd3829137e4c5d0.js

debug: Not setting iOS and app preferences since we're on a real device
debug: Starting iOS device log capture via idevicesyslog

debug: Not setting device type since we're connected to a device

debug: Getting bundle ID from app

debug: Parsed app Info.plist (as binary)
共收到 11 条回复 时间 点赞

信息过少,无法分析啊。

匿名 #2 · 2014年09月05日

#1 楼 @lihuazhang
我贴的是 Appium 上面的日志,不知道需要收集哪些日志啊?
我的脚本其实很简单就执行了一段:

def setUp(self):
    self.driver = webdriver.Remote(command_executor='http://192.168.11.11:4723/wd/hub',
                                desired_capabilities={
                                    'app': '/Users/Link/Documents/new.ipa',
                                    'udid' : 'a7a804388c522c332ac4a38142aa64e70b6af4c1',
                                    'platformName': 'iOS',
                                    'platformVersion': 'link1220',
                                    'deviceName': 'iPadAir'})
    Global.driver = self.driver

不知道 1.2.2 的版本对上面的参数有什么修改么?

@link1220 应该没用,不知道问题在哪里。。这个实在看不出来。

匿名 #4 · 2014年09月05日

#3 楼 @lihuazhang
好吧,那我还是暂时继续用 1.2.1 吧

看日志好像 prepareBootstrap 出错了。然后 startInstruments 的时候就挂了。

匿名 #6 · 2014年09月05日

#5 楼 @lihuazhang
是的,没有获取到 Dynamic bootstrap dir,不过也不知道这个目录是干啥的啊

#6 楼 @link1220 这个目录是放 bootstrap.js 的。 iOS 用这个 js 做为 cmd 的枢纽

匿名 #8 · 2014年09月06日

#7 楼 @lihuazhang 节后去公司复现下,看看这个路径下该文件是否存在

楼主你的总是解决了吗?我遇到和你一样的问题!

info: [debug] Not auto-detecting udid, running on sim
info: [debug] Localizable.strings is not currently supported when using real devices.
info: [debug] Not setting locale because we're using a real device
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir:
info: [debug] Dynamic env:
info: [debug] Dynamic bootstrap code:
info: [debug] Dynamic bootstrap path:

error: iOS log capture failed: spawn ENOENT

info: [debug] Reusing dynamic bootstrap:
info: [debug] Not setting iOS and app preferences since we're on a real device
info: [debug] Starting iOS device log capture via deviceconsole
info: [debug] Cleaning up appium session
info: [debug] Error: spawn ENOENT
at errnoException (child_process.js:1001:11)
at Process.ChildProcess._handle.onexit (child_process.js:792:34)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: spawn ENOENT)","code":"ENOENT","errno":"ENOENT","syscall":"spawn","origValue":"spawn ENOENT"},"sessionId":null}
info: <-- POST /wd/hub/session 500 146.424 ms - 197
info: [debug] Not setting device type since we're connected to a device
info: [debug] Creating iDevice object with udid 4880fb6f9866658d651ede8ea883c49ad1d71297
info: [debug] Couldn't find ideviceinstaller, trying built-in at /Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller
info: [debug] Checking app install status using: /Volumes/Appium/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 4880fb6f9866658d651ede8ea883c49ad1d71297 --bundle com.hipalsports.hipal

error: Failed to start an Appium session, err was: Error: spawn ENOENT

info: [debug] App is installed.

info: [debug] fullReset not requested. No need to install.
info: [debug] Starting command proxy.
提示我这样的错误,但是 1.2.1 好像也没成功

匿名 #11 · 2014年09月24日

#10 楼 @xuxiujin 我现在还是在用 1.2.1,我回退到 1.2.1 就好了,如果你从来没有成功过,先检查下配置参数吧,默认值能用的就都用默认值试试

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册