Search code examples
androidadbxiaomiinvalid-argument

adb pull fails with Invalid argument


Xiaomi Redmi Note 9 Pro with SD inserted sd card.

adb pull /sdcard C:\Redmi

fails with

adb: error: failed to create directory 'C:\Redmi\MIUI\debug_log\common\com.xiaomi.finddevice\process-com.xiaomi.finddevice:securitypush\': Invalid argument

I believe it's because a folder with : cannot be created.

How to skip the directory to be copied or how to fix the error?


Solution

  • You can use

    adb exec-out tar chf - -C /sdcard . > file.tar
    

    and then extract the tar avoiding errors (you can specify what to extract from tar).

    Or use linux or WSL to run adb pull.