1

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.

  • 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 '18 at 16:49
  • 1
    @Firelord: pm path is working correctly!! – Abdelhafid Madoui Sep 19 '18 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.