Giter Club home page Giter Club logo

sadb's Introduction

sadb

(safe adb)Easy your adb operation when connected multiple devices

PyPI version

It's painful to use adb commands if your computer has connected multiple devices, especially you type a very long command and adb shows error that there has multiple devices and you need to try it again with the device's identity argument.

sadb was created by solving this problem, no -s argument need anymore, you can also use one command to operate multiple devices in batch:

Install


sadb has already uploaded to PYPI,so the simplest way is to install by pip:

$ pip install sadb

Also,you can install from source code:

$ git clone [email protected]:linroid/sadb.git
$ cd sadb
$ python setup.py install

Usage

Use sadb as same as the orignal adb command, it will let you choose target devices when needed.

Upgrade:

$ pip install sadb --upgrade

License


Apache License 2.0 (here)

sadb's People

Contributors

barryzzz avatar kaiziwangzi avatar linroid avatar xlzd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sadb's Issues

install error

Collecting sadb
Downloading sadb-0.0.3.tar.gz
Installing collected packages: sadb
Running setup.py install for sadb ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/ry/jqzp89x10cz_tqkd4dc82h4h0000gn/T/pip-build-TfP0zv/sadb/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/ry/jqzp89x10cz_tqkd4dc82h4h0000gn/T/pip-QeuSNK-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/sadb
copying sadb/init.py -> build/lib/sadb
running install_lib
creating /Library/Python/2.7/site-packages/sadb
error: could not create '/Library/Python/2.7/site-packages/sadb': Permission denied

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/ry/jqzp89x10cz_tqkd4dc82h4h0000gn/T/pip-build-TfP0zv/sadb/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/ry/jqzp89x10cz_tqkd4dc82h4h0000gn/T/pip-QeuSNK-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/ry/jqzp89x10cz_tqkd4dc82h4h0000gn/T/pip-build-TfP0zv/sadb/

TypeError: expected string or buffer

嗨,当我选择设备安装的时候遇到了这个问题
➜ debug git:(xxx) ✗ adb install facedemo-debug.apk
Device list:
0) All devices

  1. 1795826 transport_id:5
  2. 0123abcd transport_id:4

select: 1
Traceback (most recent call last):
File "/usr/local/bin/sadb", line 9, in
load_entry_point('sadb==0.0.2', 'console_scripts', 'sadb')()
File "/Library/Python/2.7/site-packages/sadb/init.py", line 33, in sadb
nums = select_devices(devices)
File "/Library/Python/2.7/site-packages/sadb/init.py", line 51, in select_devices
splits = re.split(r'[\s+,]', str)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 171, in split
return _compile(pattern, flags).split(string, maxsplit)
TypeError: expected string or buffer

用模拟器会有问题

模拟器 devices 输出:
emulator-5554 device product:sdk_gphone_x86 model:Android_SDK_built_for_x86 device:generic_x86
报错:
Traceback (most recent call last):
File "/usr/local/bin/sadb", line 11, in
sys.exit(sadb())
File "/usr/local/lib/python2.7/site-packages/sadb/init.py", line 23, in sadb
devices, outputs = read_devices()
File "/usr/local/lib/python2.7/site-packages/sadb/init.py", line 96, in read_devices
'device': d[5]
IndexError: list index out of range

IndexError: list index out of range

单个设备
使用命令 sadb devices
以下错误:

$ sadb devices
Traceback (most recent call last):
  File "E:\Lang\Python36\Scripts\sadb-script.py", line 11, in <module>
    load_entry_point('sadb==0.0.4', 'console_scripts', 'sadb')()
  File "e:\lang\python36\lib\site-packages\sadb\__init__.py", line 22, in sadb
    devices, outputs = read_devices()
  File "e:\lang\python36\lib\site-packages\sadb\__init__.py", line 96, in read_devices
    'transport_id': d[6]
IndexError: list index out of range

使用adb devices,正常

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.