Git Product home page Git Product logo

amdh's Issues

Detect adb if it's in PATH

My adb bin is in /home/nicolas/Android/Sdk/platform-tools/adb but it's resolved by my Linux PATH.

If I run the script, it search for /usr/bin/adb by default, I need to provide it manually through -a.

It'll great to have it resolved automatically by using the PATH env var

Print ADB errors

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.