Eclipse错误:ENOENT,没有这样的文件或目录

时间:2015-08-22 07:46:44

标签: android eclipse appium

我在appium工具中运行第一个测试脚本时得到Error: ENOENT, no such file or directory 'D:\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk;\build-tools'

我在环境变量

中设置了路径
ANDROID_HOME:D:\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\;D:\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\build-tools;

JAVA_HOME:C:\Program Files\Java\jdk1.7.0_51\;

PATH:;D:\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk;%Path%;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;

但我仍然收到错误

 Starting Node Server
 warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade!
 info: Welcome to Appium v1.4.0 (REV 8f63e2f91ef7907aed8bda763f4e5ca08e86970a)
 info: Appium REST http interface listener started on 127.0.0.1:4723
 info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true,"deviceName":"Micromax","platformName":"Android","platformVersion":"19","automationName":"Appium"}
 info: Console LogLevel: debug
 info: --> POST /wd/hub/session {"desiredCapabilities":{"automationName":"Appium","app":"D:\\Appium testExample\\SimpleTestng\\apk\\SmpleTest.apk","platformName":"Android","VERSION":"4.4.2","deviceName":"Micromax","appActivity":"com.example.smpletest.MainActivity","appPackage":"com.example.smpletest","BROWSER_NAME":"Android"}}
 info: Client User-Agent string: Apache-HttpClient/4.4.1 (Java/1.7.0_51)
 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. : VERSION, BROWSER_NAME
 info: [debug] Using local app from desired caps: D:\Appium testExample\SimpleTestng\apk\SmpleTest.apk
 info: [debug] Creating new appium session 6cb0fb12-87f7-45c8-96c3-1cdfcbaaf4bc
 info: Starting android appium
 info: [debug] Getting Java version
 info: Java version is: 1.7.0_51
 error: Unhandled error: Error: ENOENT, no such file or directory 'D:\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk;\build-tools'
     at Object.fs.readdirSync (fs.js:654:18)
     at exports.getDirectories (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\helpers.js:100:18)
     at [object Object].ADB.checkSdkBinaryPresent (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:97:25)
     at [object Object].ADB.checkAdbPresent (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:134:8)
     at Function.ADB.createADB (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:73:7)
     at [object Object].androidCommon.initAdb (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:1083:9)
     at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:610:21
     at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:249:17
     at iterate (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:149:13)
     at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:160:25
     at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:251:21
     at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:615:34
     at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:1077:12)
     at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:1064:12)
     at ChildProcess.exithandler (child_process.js:635:7)
     at ChildProcess.EventEmitter.emit (events.js:98:17)
     at maybeClose (child_process.js:743:16)
     at Socket.<anonymous> (child_process.js:956:11)
     at Socket.EventEmitter.emit (events.js:95:17)
     at Pipe.close (net.js:465:12) context: [POST /wd/hub/session {"desiredCapabilities":{"automationName":"Appium","app":"D:\\Appium testExample\\SimpleTestng\\apk\\SmpleTest.apk","platformName":"Android","VERSION":"4.4.2","deviceName":"Micromax","appActivity":"com]
 info: [debug] Checking whether adb is present

请帮我解决这个问题..

1 个答案:

答案 0 :(得分:1)

问题似乎是你在“sdk”之后的路径中得到了一个分号:

D:\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk;\build-tools
                                                                            ↑
here _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|

我相信你的问题在于你的ANDROID_HOME var的定义。这不是“路径类型”变量(即包含路径列表的变量);它应该只包含一条路径。

看看这是否更好:

ANDROID_HOME:D:\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\