3

This is what I tried:

$ adb -e exec-out run-as com.awesomeproject rm *.jpg
rm: *.jpg: No such file or directory

After that I tried using find

$ adb -e exec-out run-as com.awesomeproject ls
app_textures files10.jpg files15.jpg files20.jpg files25.jpg files30.jpg
app_webview  files11.jpg files16.jpg files21.jpg files26.jpg files31.jpg
cache        files12.jpg files17.jpg files22.jpg files27.jpg lib
code_cache   files13.jpg files18.jpg files23.jpg files28.jpg lib-main
files        files14.jpg files19.jpg files24.jpg files29.jpg shared_prefs 

­

$ adb -e exec-out run-as com.awesomeproject find . -type f -name '*.jpg' -delete

But apparently the files are still there.

I'm not sure if this is because globstar is disabled but of course I can't activate it:

$ adb -e exec-out run-as com.awesomeproject shopt -s globstar
run-as: exec failed for shopt: Permission denied

So how do I get rid of multiple files at once using adb?

1
  • I believe the first command is misinterpreting the last operation within the command. Try giving it more explicit instructions: adb -e exec-out "run-as com.awesomeproject rm *.jpg". Other things to try include single quotes, combining, usage of escapes. Invoking an adb shell separating and throwing the commands one by one should work without issue.
    – Bo Lawson
    Commented Nov 28, 2018 at 15:11

1 Answer 1

1

Here is one thing you can try:

$adb shell "cd path/to/the/folder && rm -rf *.ext"

1
  • 2
    this answer is not sufficient due lack of permissions /data/data/com.awesomeproject
    – alecxs
    Commented Apr 17, 2020 at 13:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .