Appium 求助:Could not find adb in tools, platform-tools

lilycalla · 2014年10月23日 · 最后由 strayeagle 回复于 2014年10月23日 · 1395 次阅读

appium 环境: win7, appium1.2.0.1

java\android 环境变量均已配置 ok,使用 eclipse 创建的 android 工程可以正常运行,但是在执行 appium 的 java client 例子工程时,就报如下错误,网上查过其他资料,但问题一直存在,求救!!

Checking if an update is available
Update available to new version 1.2.4.1
Starting Node Server
info: Welcome to Appium v1.2.0 (REV e53f49c706a25242e66d36685c268b599cc18da5)
debug: Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"9","automationName":"Appium"}
info: Appium REST http interface listener started on 127.0.0.1:4723
info: LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"E:\sourcecode\appiumdemo\..\..\..\sourcecode\apps\ContactManager\ContactManager.apk","platformVersion":"4.0","deviceName":"Android","platformName":"Android","appActivity":".ContactManager","browserName":"","appPackage":"com.example.android.contactmanager"}}
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"app":"E:\sourcecode\appiumdemo\..\..\..\sourcecode\apps\ContactManager\ContactManager.apk","platformVersion":"4.0","deviceName":"Android","platformName":"Android","appActivity":".ContactManager","browserName":"","appPackage":"com.example.android.contactmanager"}}
info: Starting android appium
debug: Using local app from desired caps: E:\sourcecode\apps\ContactManager\ContactManager.apk
debug: Creating new appium session 9fe3be29-3731-41e6-b997-83b4c71c8742
debug: Using fast reset? true
debug: Preparing device for session
debug: Checking whether app is actually present
debug: Checking whether adb is present
debug: Sent shutdown command, waiting for UiAutomator to stop...
warn: UiAutomator did not shut down fast enough, calling it gone
debug: Cleaning up android objects
info: <-- POST /wd/hub/session 500 7049.391 ms - 844
debug: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Could not find adb in tools, platform-tools, or supported build-tools under "D:\tools\java\android-sdk-windows\platform-tools;D:\tools\java\android-sdk-windows\tools"; do you have android SDK or build-tools installed into this location? Supported build tools are: 17.0.0, 18.0.1, 19.0.0, 19.0.1, 19.1.0, 20.0.0, android-4.2.2, android-4.3, android-4.4
debug: Error: Could not find adb in tools, platform-tools, or supported build-tools under "D:\tools\java\android-sdk-windows\platform-tools;D:\tools\java\android-sdk-windows\tools"; do you have android SDK or build-tools installed into this location? Supported build tools are: 17.0.0, 18.0.1, 19.0.0, 19.0.1, 19.1.0, 20.0.0, android-4.2.2, android-4.3, android-4.4
at ADB.checkSdkBinaryPresent (D:\autotest\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:103:10)
at ADB.checkAdbPresent (D:\autotest\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:130:8)
at null. (D:\autotest\Appium\node_modules\appium\lib\devices\android\android-common.js:287:30)
at D:\autotest\Appium\node_modules\appium\node_modules\async\lib\async.js:610:21
at D:\autotest\Appium\node_modules\appium\node_modules\async\lib\async.js:249:17
at iterate (D:\autotest\Appium\node_modules\appium\node_modules\async\lib\async.js:149:13)
at D:\autotest\Appium\node_modules\appium\node_modules\async\lib\async.js:160:25
at D:\autotest\Appium\node_modules\appium\node_modules\async\lib\async.js:251:21
at D:\autotest\Appium\node_modules\appium\node_modules\async\lib\async.js:615:34
at null. (D:\autotest\Appium\node_modules\appium\lib\devices\android\android-common.js:307:9)
debug: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Could not find adb in tools, platform-tools, or supported build-tools under \"D:\tools\java\android-sdk-windows\platform-tools;D:\tools\java\android-sdk-windows\tools\"; do you have android SDK or build-tools installed into this location? Supported build tools are: 17.0.0, 18.0.1, 19.0.0, 19.0.1, 19.1.0, 20.0.0, android-4.2.2, android-4.3, android-4.4)","origValue":"Could not find adb in tools, platform-tools, or supported build-tools under \"D:\tools\java\android-sdk-windows\platform-tools;D:\tools\java\android-sdk-windows\tools\"; do you have android SDK or build-tools installed into this location? Supported build tools are: 17.0.0, 18.0.1, 19.0.0, 19.0.1, 19.1.0, 20.0.0, android-4.2.2, android-4.3, android-4.4"},"sessionId":null}

共收到 7 条回复 时间 点赞

将 sdk\build-tools\android-4.4W 目录下的 aapt.exe 拷贝到 sdk\tools 目录下

将 sdk\build-tools\android-4.4W 目录下的 zipalign.exe 拷贝到 sdk\tools 目录下

#1 楼 @strayeagle 谢谢!我的 sdk\build-tools 目录下怎么什么都没有??看来要重新找一个 sdk 包:(

debug: Error: Could not find adb in tools, platform-tools, or supported build-tools under "D:\tools\java\android-sdk-windows\platform-tools;D:\tools\java\android-sdk-windows\tools"; do you have android SDK or build-tools installed into this location? Supported build tools are: 17.0.0, 18.0.1, 19.0.0, 19.0.1, 19.1.0, 20.0.0, android-4.2.2, android-4.3, android-4.4

#1 楼 @strayeagle 找同事在 build-tools 下打了个 android-4.2.2 目录过来,但只有 aapt.exe,没有 zipalign.exe,拷贝到了 sdk\tools,问题还是存在:(

#3 楼 @mingway_hu sdk\platform-tools, sdk\tools 目录下都有 adb.exe 啊,实在想不通,能否明示?谢谢!而且 android 工程都可以正常运行的。

打开 Android SDK Manager 下载日志里支持版本的 Android SDK Build-tools

#4 楼 @lilycalla 6 楼正解,下载后,如果报找不到文件,你将 sdk\build-tools\android-X.X 目录下文件拷贝过去就行

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