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

[linux] sudo password prompt causing "unknown adb state" #11

Open
amo13 opened this issue Jan 7, 2022 · 4 comments
Open

[linux] sudo password prompt causing "unknown adb state" #11

amo13 opened this issue Jan 7, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@amo13
Copy link
Owner

amo13 commented Jan 7, 2022

unknown state:
StdOUT:
StdERR:[sudo] password amo: error: no devices/emulators found

 unknown adb state

  File "/home/amo/Anarchy-Droid/logger/logger.go", line 156, in LogError.func1
    sentry.CaptureException(fmt.Errorf(message + " " + err.Error()))
  File "/home/amo/Anarchy-Droid/logger/logger.go", line 150, in LogError
    sentry.WithScope(func(scope *sentry.Scope) {
  File "/home/amo/Anarchy-Droid/device/adb/adb.go", line 124, in State
    logger.LogError("unknown state:\nStdOUT:" + stdout + "\nStdERR:" + stderr + "\n", fmt.Errorf("unknown adb state"))
  File "/home/amo/Anarchy-Droid/device/device.go", line 92, in (*Device).GetState
    adb_state := adb.State()
  File "/home/amo/Anarchy-Droid/device/observer.go", line 43, in (*Device).doObservation
    new_state := d.GetState()
  File "/home/amo/Anarchy-Droid/device/observer.go", line 31, in (*Device).startObserver
    new_state = d.doObservation(last_state)

in adb.State()

(and: Unknown ADB error: [sudo] password for amo: in adb.unavailable())


*errors.errorString: Unknown ADB error: [sudo] password for amo: 
  File "/home/runner/work/Anarchy-Droid/Anarchy-Droid/logger/logger.go", line 156, in LogError.func1
  File "/home/runner/work/Anarchy-Droid/Anarchy-Droid/logger/logger.go", line 150, in LogError
  File "/home/runner/work/Anarchy-Droid/Anarchy-Droid/device/adb/adb.go", line 77, in unavailable
  File "/home/runner/work/Anarchy-Droid/Anarchy-Droid/device/adb/adb.go", line 186, in IsBooting
  File "/home/runner/work/Anarchy-Droid/Anarchy-Droid/device/adb/adb.go", line 113, in State
  File "/home/runner/work/Anarchy-Droid/Anarchy-Droid/device/device.go", line 94, in (*Device).GetState
  File "/home/runner/work/Anarchy-Droid/Anarchy-Droid/device/observer.go", line 43, in (*Device).doObservation
  File "/home/runner/work/Anarchy-Droid/Anarchy-Droid/device/observer.go", line 31, in (*Device).startObserver
@amo13 amo13 added the help wanted Extra attention is needed label Mar 9, 2022
@amo13
Copy link
Owner Author

amo13 commented Mar 12, 2022

Also:

ADB command kill-server gave an unexpected error: stdout: ; stderr: Password: **** is not in the sudoers file.  This incident will be reported.

Though this error actually could be caught and reported to the user. This is probably simply a linux (or bsd?) system without sudo.

@srulikuk
Copy link

srulikuk commented Feb 1, 2023

Not sure if this error is related

Bug: sudo password prompt instead of command output. Killing adb server and retrying kill-server
Stderr contains [sudo]

but running the command with sudo works fine, (not sure why the need to provide the sudo pass in the dialog if the command is running with sudo anyway)

@amo13
Copy link
Owner Author

amo13 commented Feb 2, 2023

Providing the sudo password in the dialog is preferred rather than running the whole application with sudo. This way, if the application has a bug, it will not misbehave with sudo-rights on your system. The even more preferred way is to configure udev rules for your device (on archlinux, this is done by simply installing the package android-udev).

@srulikuk
Copy link

srulikuk commented Feb 2, 2023

I used it on Ubuntu 20.04, without sudo the application would just throw endless errors as above, with sudo it worked fine so the error above should be some indication as to why that is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants