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

Print ADB errors #15

Closed
tuarrep opened this issue Aug 11, 2020 · 1 comment
Closed

Print ADB errors #15

tuarrep opened this issue Aug 11, 2020 · 1 comment
Labels
good first issue Good for newcomers

Comments

@tuarrep
Copy link

tuarrep commented Aug 11, 2020

When adb encounters an error, typically when the devices isn't authorised, the program fails with a Trackback.

It should be clearer if it prints the adb error message and stop gracefully.

The trackback in my case was :

➜ python amdh.py -sA -a /home/nicolas/Android/Sdk/platform-tools/adb
[-] INFO: List of devices:
[-] INFO: The device 97UAY124RZ will be used.

Traceback (most recent call last):
  File "amdh.py", line 408, in <module>
    amdh()
  File "amdh.py", line 209, in amdh
    packages = adb_instance.list_installed_packages(arguments.app_type)
  File "/home/nicolas/Dev/playground/python/AMDH/core/adb.py", line 48, in list_installed_packages
    output_command = self.adb_exec(adb_command)
  File "/home/nicolas/Dev/playground/python/AMDH/core/adb.py", line 25, in adb_exec
    result = run(commands_array,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/nicolas/Android/Sdk/platform-tools/adb', '-s', '97UAY124RZ', 'shell', 'pm', 'list', 'packages', '-3']' returned non-zero exit status 1.

And the adb message was:

➜ adb shell pm list packages -3
adb: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
A-YATTA added a commit that referenced this issue Aug 11, 2020
@A-YATTA
Copy link
Owner

A-YATTA commented Aug 11, 2020

Thanks for reporting the issue. I fixed it in the commit https://github.com/SecTheTech/AMDH/commit/df02fd5b1009a10e8e32b3dc6c433a3948c0c4ca.

@A-YATTA A-YATTA closed this as completed Aug 11, 2020
@A-YATTA A-YATTA added the good first issue Good for newcomers label Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants