JeffLIrion / adb_shell

A Python implementation of ADB with shell and FileSync functionality.
Apache License 2.0
530 stars 60 forks source link

Shell command arguments not executed #185

Closed enty8080 closed 3 years ago

enty8080 commented 3 years ago

Description

I tried to execute ls in shell(), then it executes, but when I try to execute ls /bin it executes only ls without /bin argument.

Log

From python3 adb_shell

device1.shell('ls')

output:

Reserve0   default.prop                init.usb.rc      sdcard     
acct       dev                         init.zygote32.rc storage    
bin        etc                         lost+found       sys        
bugreports file_contexts.bin           mnt              system     
cache      init                        odm              tmp-mksh   
charger    init.environ.rc             oem              ueventd.rc 
config     init.rc                     proc             vendor     
d          init.recovery.sun50iw6p1.rc product          verity_key 
data       init.usb.configfs.rc        sbin         

with /bin:

device1.shell('ls /bin')

output:

Reserve0   default.prop                init.usb.rc      sdcard     
acct       dev                         init.zygote32.rc storage    
bin        etc                         lost+found       sys        
bugreports file_contexts.bin           mnt              system     
cache      init                        odm              tmp-mksh   
charger    init.environ.rc             oem              ueventd.rc 
config     init.rc                     proc             vendor     
d          init.recovery.sun50iw6p1.rc product          verity_key 
data       init.usb.configfs.rc        sbin 

NOTE: But if use generic adb from android-platform-tools then ls /bin executes as ls /bin, but not as ls

P.S.: If you try to execute touch somefile, shell() will execute only touch and then the error appears:

touch: Needs 1 argument (see "touch --help")
JeffLIrion commented 3 years ago

That's odd, I don't have that issue. Could you please attach a debug log, as described in the issue template: https://github.com/JeffLIrion/adb_shell/blob/master/.github/ISSUE_TEMPLATE/bug_report.md

enty8080 commented 3 years ago

@JeffLIrion Sorry, it's problem in my code