Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stderr: 'error: device unauthorized. #9

Open
xwSurfer opened this issue Jun 16, 2018 · 0 comments
Open

Stderr: 'error: device unauthorized. #9

xwSurfer opened this issue Jun 16, 2018 · 0 comments

Comments

@xwSurfer
Copy link

I get "device unauthorized" when i running a sample code which is from appium website ,

appium client code :

// javascript
const wdio = require('webdriverio');

console.log("starting running test...");
// javascript
const opts = {
port: 4723,
desiredCapabilities: {
platformName: "Android",
platformVersion: "7.1.2",
deviceName: process.env.UDID,
// app: "/Users/david/work/xw/stf-appium-example/apks/android-sample-app.apk",
app: "/Users/david/work/xw/appium/files/demoApk/ApiDemos-debug.apk",
automationName: "UiAutomator2"
}
};

const client = wdio.remote(opts);

// javascript
client
.init()
.click("~App")
.click("~Alert Dialogs")
.back()
.back()
.end();

the command is :

DEVICE_SERIAL=b125680d7d04 ./scripts/run_integration_test.sh

appium log:

[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {"javascriptEnabled":true,"...
[BaseDriver] The following capabilities were provided, but are not recognized by appium: javascriptEnabled, locationContextEnabled, handlesAlerts, rotatable, requestOrigins.
[BaseDriver] Session created with session id: bc7c8cd7-f4be-4b7b-a839-70ccfed628d3
[BaseDriver] Using local app '/Users/david/work/xw/appium/files/demoApk/ApiDemos-debug.apk'
[debug] [UiAutomator2] Checking whether app is actually present
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_92
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 2 device(s) connected
[AndroidDriver] Looking for a device with Android '7.1.2'
[debug] [ADB] Setting device id to localhost:7401
[ADB] Getting device platform version
[debug] [ADB] Running '/Users/david/tools/Library/Android/sdk/platform-tools/adb -P 5037 -s localhost:7401 shell getprop ro.build.version.release'
[debug] [ADB] Running '/Users/david/tools/Library/Android/sdk/platform-tools/adb -P 5037 -s localhost:7401 shell getprop ro.build.version.release'
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1529116125651 (10:28:45 GMT+0800 (CST))
[MJSONWP] Encountered internal error running command: Error: Error getting device platform version. Original error: Error executing adbExec. Original error: 'Command '/Users/david/tools/Library/Android/sdk/platform-tools/adb -P 5037 -s localhost:7401 shell getprop ro.build.version.release' exited with code 1'; Stderr: 'error: device unauthorized.
[MJSONWP] This adb server's $ADB_VENDOR_KEYS is not set
[MJSONWP] Try 'adb kill-server' if that seems wrong.
[MJSONWP] Otherwise check for a confirmation dialog on your device.'; Code: '1'
[MJSONWP] at ADB.callee$0$0$ (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/adb-commands.js:89:11)
[MJSONWP] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[MJSONWP] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[MJSONWP] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[MJSONWP] at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant