Comments (7)
Could you please post a log from an exec command with the log level set to debug. That way I can add a unit test for this function.
from adb_shell.
Sorry, I am not familiar with adb debugging. I need more detailed information on how to get the log so I can help.
from adb_shell.
Python logs, not ADB logs. This should work:
import logging
logging.getLogger("adb_shell.adb_device").setLevel(logging.DEBUG)
logging.getLogger("adb_device").setLevel(logging.DEBUG)
from adb_shell.
import logging
from adb_shell.adb_device import AdbDeviceTcp
logging.basicConfig(level=logging.INFO)
logging.getLogger("adb_shell.adb_device").setLevel(logging.DEBUG)
logging.getLogger("adb_device").setLevel(logging.DEBUG)
device = AdbDeviceTcp("127.0.0.1", 7555)
try:
device.connect()
r = device._service(b"exec", "echo TEST".encode("utf8"))
print(r)
finally:
device.close()
DEBUG:adb_shell.adb_device:bulk_write: b'CNXN\x00\x00\x00\x01\x00\x00\x10\x00\x16\x00\x00\x00\x07\x06\x00\x00\xbc\xb1\xa7\xb1'
DEBUG:adb_shell.adb_device:bulk_write: b'host::DESKTOP-70888G8\x00'
DEBUG:adb_shell.adb_device:bulk_read(24): b'CNXN\x00\x00\x00\x01\x00\x10\x00\x00L\x00\x00\x00\x08\x1c\x00\x00\xbc\xb1\xa7\xb1'
DEBUG:adb_shell.adb_device:bulk_read(76): b'device::ro.product.name=cancro;ro.product.model=MuMu;ro.product.device=x86;\x00'
DEBUG:adb_shell.adb_device:bulk_write: b'OPEN\x01\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\xde\x04\x00\x00\xb0\xaf\xba\xb1'
DEBUG:adb_shell.adb_device:bulk_write: b'exec:echo TEST\x00'
DEBUG:adb_shell.adb_device:bulk_read(24): b'OKAY\x14\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb0\xb4\xbe\xa6'
DEBUG:adb_shell.adb_device:bulk_read(24): b'WRTE\x14\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00J\x01\x00\x00\xa8\xad\xab\xba'
DEBUG:adb_shell.adb_device:bulk_read(5): b'TEST\n'
DEBUG:adb_shell.adb_device:bulk_write: b'OKAY\x01\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb0\xb4\xbe\xa6'
DEBUG:adb_shell.adb_device:bulk_write: b''
DEBUG:adb_shell.adb_device:bulk_read(24): b'CLSE\x14\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbc\xb3\xac\xba'
DEBUG:adb_shell.adb_device:bulk_write: b'CLSE\x01\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbc\xb3\xac\xba'
DEBUG:adb_shell.adb_device:bulk_write: b''
TEST
from adb_shell.
The difference between exec
and shell
is that shell
will turn \n
into \r\n
.
from adb_shell.
Thanks, I can work with that.
From https://www.linux-magazine.com/Issues/2017/195/Ask-Klaus:
adb exec-out "<command>"
Run command on Android and capture its unfiltered binary output (stdout)
I think I'll keep the default value of decode=true
for this function, although it seems like this will produce the same results as shell, aside from the \n
vs. \r\n
difference that you pointed out.
from adb_shell.
Closed via #142
from adb_shell.
Related Issues (20)
- Using pull on BytesIO object HOT 3
- Pushing large files always timeouts HOT 12
- Implement the pair command for Android 11+ devices HOT 6
- How to connect more than two devices at the same time? HOT 3
- AdbDeviceUsb not working with MacOS X due to error 'LIBUSB_ERROR_ACCESS [-3]' HOT 2
- default_transport_timeout_s is ignored HOT 1
- Add support for pulling directories HOT 2
- usb1.USBErrorAccess: LIBUSB_ERROR_ACCESS [-3] HOT 2
- adb server claims usb device: results in USBErrorBusy
- Feature request install package analog to adb install HOT 4
- get return code of shell command HOT 4
- How can I get access to the device with password to adb? HOT 5
- Add adb forward functionality
- packaging this project for Debian HOT 3
- Improvement
- Streaming Shell doesn't result in a stream ?
- usb1.USBErrorBusy: LIBUSB_ERROR_BUSY [-6] when connect to device HOT 2
- Timeout shell commands after gaining root on device
- Please avoid re-tagging
- No ability to list attached devices?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adb_shell.