Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[DEV][WIP] PyAdb Python 2.7 Package [Windows/Unix]

OP cybojenix

17th December 2013, 11:41 PM   |  #1  
cybojenix's Avatar
OP Recognized Developer
Thanks Meter: 1,694
 
854 posts
Join Date:Joined: Apr 2012
Donate to Me
More
KEarlier I saw a thread that demonstrated a python wrapper for the adb command. I remembered a while ago that adb uses a TCP protocol (duh it's written in the docs)

I had some spare time today so I decided to write a script for you all (I know how redundant it is, but hey why not)
This script incorporates the core functionality of adb into it, such as detecting your device... that's pretty much it at this stage..

so here it is. PyAdb

I doubt this will brick anyone's devices... but just in case..
disclaimer:
Quote:

if this bricks your device, it was not my fault. you used this at your own risk.
I don't care if this crashes your computers, or shoots you in the foot. you used it, not me

The general concept with how this works is below:
firstly, you have to choose your command from this list
secondly: the length of that command (in hexadecimal) needs to be prefixed before the command is sent. This is probably to do with security so the adb server on the device only reads the right amount of data
thirdly:... well there's not much more to it. just enjoy, tinker with it, and remember to contribute!!

note about getting device detected:
You need to ensure that the Android Debugging Bridge driver is installed for your device. this is normally supplied with standard device drivers. please refer to your device forums for instructions on how to install these
You also need to make sure your pc is authorised with stock adb, otherwise you won't be able to connect with PyAdb (for 4.2 upwards)

note about the current shell integration:
I now have a threaded interactive console, however single commands are still not read from a thread. If you want to use grep or kmsg, launch a full session
Last edited by cybojenix; 25th December 2013 at 08:38 AM.
The Following 10 Users Say Thank You to cybojenix For This Useful Post: [ View ]
24th December 2013, 01:09 AM   |  #2  
DaGr81's Avatar
Member
Flag Kathmandu
Thanks Meter: 21
 
70 posts
Join Date:Joined: Aug 2010
More
page not found!
24th December 2013, 01:31 AM   |  #3  
omegavesko's Avatar
Member
Thanks Meter: 197
 
88 posts
Join Date:Joined: Jun 2012
Fixed link: https://github.com/cybojenix/PyAdb/

Looks like OP removed the file he linked to and forgot to change the link. :P
The Following User Says Thank You to omegavesko For This Useful Post: [ View ]
24th December 2013, 04:11 PM   |  #4  
Senior Member
Flag Doncaster
Thanks Meter: 20
 
422 posts
Join Date:Joined: Nov 2009
Donate to Me
More
404 page not found?
Quote:
Originally Posted by cybojenix

Earlier I saw a thread that demonstrated a python wrapper for the adb command. I remembered a while ago that adb uses a TCP protocol (duh it's written in the docs)

I had some spare time today so I decided to write a script for you all (I know how redundant it is, but hey why not)
This script incorporates the core functionality of adb into it, such as detecting your device... that's pretty much it at this stage..

so here it is. PyAdb

I doubt this will brick anyone's devices... but just in case..
disclaimer:


The general concept with how this works is below:
firstly, you have to choose your command from this list
secondly: the length of that command (in hexadecimal) needs to be prefixed before the command is sent. This is probably to do with security so the adb server on the device only reads the right amount of data
thirdly:... well there's not much more to it. just enjoy, tinker with it, and remember to contribute!!

note about getting device detected:
You need to ensure that the Android Debugging Bridge driver is installed for your device. this is normally supplied with standard device drivers. please refer to your device forums for instructions on how to install these

note about the current shell integration:
I haven't added a threaded data capture method yet, purely because I don't have time at the moment. it will (should) work with single commands. it isn't reliable for commands that take a while to run (such as grep)

404 page not found?
24th December 2013, 04:26 PM   |  #5  
cybojenix's Avatar
OP Recognized Developer
Thanks Meter: 1,694
 
854 posts
Join Date:Joined: Apr 2012
Donate to Me
More
Quote:
Originally Posted by omegavesko

Fixed link: https://github.com/cybojenix/PyAdb/

Looks like OP removed the file he linked to and forgot to change the link. :P

lol yeah thanks. I did some file changes and forgot I linked to the file in the thread rather than the repo
The Following User Says Thank You to cybojenix For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes