通过appium运行Android应用程序时出错

时间:2016-01-14 18:20:42

标签: appium

我在通过appium运行应用时遇到错误。当我运行appium医生时,所有检查都成功了。但是在appium中得到错误。我做的是在appium中启动应用程序。然后我从eclipse运行代码。在我运行代码后,我在appium中得到了错误。错误如下:

Launching Appium with command: export ANDROID_HOME="(null)"; '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --address "127.0.0.1" --callback-address "127.0.0.1" --command-timeout "7200" --session-override --automation-name "Appium" --platform-name "Android" --platform-version "4.4" --app "/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk" --device-name "Nexus" --language "en"

info: Welcome to Appium v1.3.5 (REV a124a15677e26b33db16e81c4b3b34d9c6b8cac9)

info: Appium REST http interface listener started on 127.0.0.1:4723

info: [debug] Non-default server args: {"app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","address":"127.0.0.1","callbackAddress":"127.0.0.1","sessionOverride":true,"deviceName":"Nexus","platformName":"Android","platformVersion":"4.4","automationName":"Appium","language":"en","defaultCommandTimeout":7200}

info: Console LogLevel: debug

info: --> POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true,"rotatable":true,"takesScreenshot":true,"version":"4.4"}}

info: Client User-Agent string: undefined

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. : platform, browserConnectionEnabled, rotatable, takesScreenshot, version

info: [debug] No appActivity desired capability or server param. Parsing from apk.

info: [debug] No appPackage desired capability or server param. Parsing from apk.

info: [debug] Using local app from desired caps: /Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk

info: [debug] Creating new appium session 3e250c44-f7c1-4787-8551-7e9cf12edf4d

info: Starting android appium

info: [debug] Getting Java version

info: Java version is: 1.7.0_71

info: [debug] Checking whether adb is present

error: Unhandled error: Error: ENOENT, no such file or directory '/Applications/Appium.app/Contents/Resources/node_modules/appium/(null)/build-tools'

    at Error (native)

    at Object.fs.readdirSync (fs.js:765:18)

    at exports.getDirectories (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/helpers.js:100:18)

    at ADB.checkSdkBinaryPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:89:25)

    at ADB.checkAdbPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:126:8)

    at androidCommon.initAdb (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1060:14)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:610:21

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:249:17

    at iterate (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:149:13)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:160:25 context: [POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true]

info: <-- POST /wd/hub/session - - ms - - 

info: --> POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true,"rotatable":true,"takesScreenshot":true,"version":"4.4"}}

info: Client User-Agent string: undefined

info: Found an existing session to clobber, shutting it down first...

info: Shutting down appium session

info: [debug] Pressing the HOME button

info: [debug] executing cmd: adb shell "input keyevent 3"

info: [debug] Cleaning up android objects

info: [debug] Cleaning up appium session

info: Old session shut down OK, proceeding to new session

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. : platform, browserConnectionEnabled, rotatable, takesScreenshot, version

info: [debug] No appActivity desired capability or server param. Parsing from apk.

info: [debug] No appPackage desired capability or server param. Parsing from apk.

info: [debug] Using local app from desired caps: /Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk

info: [debug] Creating new appium session 73f67505-4d83-4d3f-8bed-5d4b2b5a97ad

info: Starting android appium

info: [debug] Getting Java version

info: Java version is: 1.7.0_71

info: [debug] Checking whether adb is present

error: Unhandled error: Error: ENOENT, no such file or directory '/Applications/Appium.app/Contents/Resources/node_modules/appium/(null)/build-tools'

    at Error (native)

    at Object.fs.readdirSync (fs.js:765:18)

    at exports.getDirectories (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/helpers.js:100:18)

    at ADB.checkSdkBinaryPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:89:25)

    at ADB.checkAdbPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:126:8)

    at androidCommon.initAdb (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1060:14)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:610:21

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:249:17

    at iterate (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:149:13)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:160:25 context: [POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true]

undefined

info: <-- POST /wd/hub/session - - ms - - 

info: --> POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true,"rotatable":true,"takesScreenshot":true,"version":"4.4"}}

info: Client User-Agent string: undefined

info: Found an existing session to clobber, shutting it down first...

info: Shutting down appium session

info: [debug] Pressing the HOME button

info: [debug] executing cmd: adb shell "input keyevent 3"

info: [debug] Cleaning up android objects

info: [debug] Cleaning up appium session

info: Old session shut down OK, proceeding to new session

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. : platform, browserConnectionEnabled, rotatable, takesScreenshot, version

info: [debug] No appActivity desired capability or server param. Parsing from apk.

info: [debug] No appPackage desired capability or server param. Parsing from apk.

info: [debug] Using local app from desired caps: /Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk

info: [debug] Creating new appium session 56c5cb37-9da8-46cd-a6ea-c11254470b2c

info: Starting android appium

info: [debug] Getting Java version

info: Java version is: 1.7.0_71

info: [debug] Checking whether adb is present

error: Unhandled error: Error: ENOENT, no such file or directory '/Applications/Appium.app/Contents/Resources/node_modules/appium/(null)/build-tools'

    at Error (native)

    at Object.fs.readdirSync (fs.js:765:18)

    at exports.getDirectories (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/helpers.js:100:18)

    at ADB.checkSdkBinaryPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:89:25)

    at ADB.checkAdbPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:126:8)

    at androidCommon.initAdb (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1060:14)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:610:21

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:249:17

    at iterate (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:149:13)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:160:25 context: [POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true]

请帮我解决问题。我是appium的新手

3 个答案:

答案 0 :(得分:1)

我认为你需要再次安装节点。关注here

答案 1 :(得分:0)

您如何执行代码,是否可以发布代码。您的问题的初步印象是您需要设置ANDROID_HOME。 您可以看到link

答案 2 :(得分:0)

阅读完日志后,我认为您没有传递正确的应用程序活动和应用程序包名称。请尝试传递正确的细节。