2

I'm trying to achieve the goal of clearing all app data using Git Bash on Windows, but I don't know exactly if this approach is wrong, because it shows FAILED on every line.

adb shell 'pm list packages' | sed -e "s/package\://" | xargs -n1 adb shell pm clear
  1. List all packages

    adb shell 'pm list packages'
    
  2. Remove "package:" from the begining of each line

    adb shell 'pm list packages' | sed -e "s/package\://" 
    
  3. Execute "pm clear" on every package name

    adb shell 'pm list packages' | sed -e "s/package\://" | xargs -n1 adb shell pm clear
    

Regards.

2
  • I wonder what's wrong with this. Seems to work fine when I tried a dry run. See if everything is fine and no special character is causing an issue. Replace pm clear with pm path and see if it also fails.
    – Firelord
    Sep 19, 2018 at 16:49
  • 1
    @Firelord: pm path is working correctly!!
    – M. A.
    Sep 19, 2018 at 18:04

0

You must log in to answer this question.

Browse other questions tagged .