Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pulling directories #211

Open
wimmatthijs opened this issue Jan 12, 2023 · 2 comments
Open

Add support for pulling directories #211

wimmatthijs opened this issue Jan 12, 2023 · 2 comments

Comments

@wimmatthijs
Copy link

wimmatthijs commented Jan 12, 2023

Description

Was trying to automate a command where i pull a complete directory from the device.
Just like adb pull /sdcard/someDirectory

Log

Traceback (most recent call last):
  File "C:\Artland_script\Artland_logscript.py", line 52, in <module>
    device.pull("/sdcard/someDirectory",os.getcwd()+"\someDirectory")
  File "C:\Users\Wim.Matthijs\AppData\Local\Programs\Python\Python310\lib\site-packages\adb_shell\adb_device.py", line 944, in pull
    self._pull(device_path, stream, progress_callback, adb_info, filesync_info)
  File "C:\Users\Wim.Matthijs\AppData\Local\Programs\Python\Python310\lib\site-packages\adb_shell\adb_device.py", line 969, in _pull
    for cmd_id, _, data in self._filesync_read_until([constants.DATA], [constants.DONE], adb_info, filesync_info):
  File "C:\Users\Wim.Matthijs\AppData\Local\Programs\Python\Python310\lib\site-packages\adb_shell\adb_device.py", line 1433, in _filesync_read_until
    cmd_id, header, data = self._filesync_read(expected_ids + finish_ids, adb_info, filesync_info)
  File "C:\Users\Wim.Matthijs\AppData\Local\Programs\Python\Python310\lib\site-packages\adb_shell\adb_device.py", line 1372, in _filesync_read
    raise exceptions.AdbCommandFailureException('Command failed: {}'.format(reason))
adb_shell.exceptions.AdbCommandFailureException: Command failed: read failed: Is a directory
@JeffLIrion
Copy link
Owner

It should be possible to accomplish this by using shell with ls to see the directory's contents and then pulling the files individually. If someone would like to submit this functionality in a pull request, that would be welcome.

@wimmatthijs
Copy link
Author

wimmatthijs commented Jan 14, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants