sch3m4 / pyadb Goto Github PK
View Code? Open in Web Editor NEWSimple python module to interact with Android Debug Bridge (ADB) tool
Home Page: http://safetybits.net
License: Other
Simple python module to interact with Android Debug Bridge (ADB) tool
Home Page: http://safetybits.net
License: Other
Are you able to do provide support for Python 3? There is a similar version which is called pyadb3, but it has issues with getting device list.
get_devices return wrong result set if adb server is not running
in the get_devices function
self.__devices=self.__output.partition('\n')[2]
if the adb server is not running, the adb devices
command will start adb server before get device list, so the index 2
will be * daemon not running
, not truely device infomation
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
ADB.set_target_device()
sets state globally.
This design decision is a problem in environments where concurrency is a requirement, which is what ultimately drove me to switch to Google's catapult/devil project.
Rather a single global target device setting, a safer alternative is to have each ADB instance keep its own reference to its selected device.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
In [44]: adb = ADB(adb_path="/opt/android/sdk/r24.4.1/platform-tools/adb")
In [45]: adb.get_devices()
Out[45]: (0, ['XXX', 'c'])
In [46]: adb.set_target_device("XXX")
Out[46]: True
In [47]: adb.shell_command("ls")
Out[47]: 'acct\r\ncache\r\nconfig\r\nd\r\ndata\r\ndefault.prop\r\ndev\r\netc\r\ninit\r\ninit.goldfish.rc\r\ninit.rc\r\ninit.sun5i.rc\r\ninit.sun5i.usb.rc\r\ninit.trace.rc\r\ninit.usb.rc\r\ninitlogo.rle\r\nmnt\r\nnand.ko\r\nproc\r\nroot\r\nsbin\r\nsdcard\r\nsys\r\nsystem\r\nueventd.goldfish.rc\r\nueventd.rc\r\nueventd.sun5i.rc\r\nvendor\r\n'
In [48]: adb.set_target_device("XXX")
Out[48]: True
In [49]: adb.shell_command("ls")
Out[49]: 'acct\ncache\ncharger\nconfig\nd\ndata\ndev\netc\nfirmware\nmnt\noem\nproc\nproperty_contexts\nres\nroot\nsbin\nsdcard\nstorage\nsys\nsystem\nvendor\n'
In [50]: adb = ADB(adb_path="/opt/android/sdk/r24.4.1/platform-tools/adb")
In [51]: adb.get_devices(mode="usb")
Out[51]: (0, ['2-2', '2-1'])
In [52]: adb.set_target_device("2-2")
Out[52]: True
In [53]: adb.shell_command("ls")
In [54]: adb.get_error()
Out[54]: "error: device '2-2' not found\n"
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
If thread is alive...
Here is my case
I connect 8 devices
When i use Ubuntu 18.10
adb devices
shows 7 devices
pyadb devices
shows 8 devices
When i use Windows 7 x64
adb devices
shows all 8 devices
As i get it right PyADB wraps ADB commands.
For sure the problem is in Ubuntu itself but results are different. Both commands should list 7 or 8 devices at once.
Where should i dig?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
88line : w,r,e = pipe(self.build_command(cmd), mode='r') is error
except popen3() takes no keyword arguments
so i using
w,r,e = pipe(self.build_command(cmd)) is ok
Hi,
The latest PyADB version on the PyPi package repository is 0.1.1 and on the git repository it is 0.1.4. Could you update the PyPi version, please?
Link to PyPi: https://pypi.python.org/pypi/pyadb
Thanks,
Ignas
pyadb is great python library, but currently it is missing clearly defined license (e.g. GPL, LGPL, BSD or etc). This make it bit unclear that what limitations there are in legal point of view.
I propose that that there should be LICENSE file which describe license terms of this library.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.