Giter Site home page Giter Site logo

Comments (4)

JeffLIrion avatar JeffLIrion commented on August 22, 2024

Does this work?

dev._service(b'install', b'<package.apk>')

from adb_shell.

jmcerrejon avatar jmcerrejon commented on August 22, 2024

Hello. I'm trying the next on a Quest 2 using macOS:

    result = device._service(
        b"install",
        b"/Users/ulysess/Documents/test/test.apk",
    )

I get the next issue (running with both sudo or not):

Traceback (most recent call last):
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/adb_shell/transport/usb_transport.py", line 283, in bulk_read
    return bytes(self._transport.bulkRead(self._read_endpoint, numbytes, timeout=self._timeout_ms(transport_timeout_s)))
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/usb1/__init__.py", line 1412, in bulkRead
    transferred = self._bulkTransfer(endpoint, data, length, timeout)
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/usb1/__init__.py", line 1358, in _bulkTransfer
    mayRaiseUSBError(libusb1.libusb_bulk_transfer(
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/usb1/__init__.py", line 127, in mayRaiseUSBError
    __raiseUSBError(value)
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/usb1/__init__.py", line 119, in raiseUSBError
    raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorTimeout: LIBUSB_ERROR_TIMEOUT [-7]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ulysess/Documents/sc/test_adb/main.py", line 235, in <module>
    main()
  File "/Users/ulysess/Documents/sc/test_adb/main.py", line 203, in main
    install_apk(args.install, destination_full_path)
  File "/Users/ulysess/Documents/sc/test_adb/main.py", line 164, in install_apk
    result = device._service(
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/adb_shell/adb_device.py", line 710, in _service
    return b''.join(self._streaming_command(service, command, transport_timeout_s, read_timeout_s, timeout_s)).decode('utf8', _DECODE_ERRORS)
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/adb_shell/adb_device.py", line 1288, in _streaming_command
    adb_info = self._open(b'%s:%s' % (service, command), transport_timeout_s, read_timeout_s, timeout_s)
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/adb_shell/adb_device.py", line 1186, in _open
    _, adb_info.remote_id, _, _ = self._io_manager.read([constants.OKAY], adb_info)
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/adb_shell/adb_device.py", line 339, in read
    cmd, arg0, arg1, data = self._read_packet_from_device(adb_info)
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/adb_shell/adb_device.py", line 486, in _read_packet_from_device
    msg = self._read_bytes_from_device(constants.MESSAGE_SIZE, adb_info)
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/adb_shell/adb_device.py", line 442, in _read_bytes_from_device
    temp = self._transport.bulk_read(length, adb_info.transport_timeout_s)
  File "/Users/ulysess/Documents/sc/test_adb/.venv/lib/python3.9/site-packages/adb_shell/transport/usb_transport.py", line 285, in bulk_read
    raise exceptions.UsbReadFailedError('Could not receive data from %s (timeout %sms)' % (self.usb_info, self._timeout_ms(transport_timeout_s)), e)
adb_shell.exceptions.UsbReadFailedError: Could not receive data from first 1WMHH812AS9999 (timeout 10000ms): LIBUSB_ERROR_TIMEOUT [-7]

The log I get: messages.log

from adb_shell.

wimmatthijs avatar wimmatthijs commented on August 22, 2024

@jmcerrejon @JeffLIrion I worked around the issue by pushing the apk myself and doing a shell pm install command.....
So for now my workaround works, i just thought it would be a nice feature to have in this otherwise very nice and useful package.

from adb_shell.

jmcerrejon avatar jmcerrejon commented on August 22, 2024

Yeah, that's the way to proceed now, but It's a great feature to take into account. 😉

from adb_shell.

Related Issues (20)

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.