adb uninstall failed

前端 未结 24 1558
清歌不尽
清歌不尽 2020-12-12 18:44

I am writing some sample apps.
After I debug these apps, I don\'t see an uninstall button in my device\'s application management.
When I do adb uninstall, it always

相关标签:
24条回答
  • 2020-12-12 19:37

    This worked for me:

    This is the directory where all the APKs are stored:

    cd /system/app
    

    List them:

    ls
    

    Choose one to remove.

    pm install -r <app_to_remove>.apk
    

    Example:

    $ pm install -r Google-Play-services.apk
            pkg: Google-Play-services.apk
    Success
    


    I noticed that I get failure if the application I'm trying to remove is running, so kill it first.

    Also, I noticed you might have to run (on a rooted device):

    $ su
    # mount -o remount +rw /
    
    0 讨论(0)
  • 2020-12-12 19:37

    Make sure you enter the full package name with application name:

    com.domain.app
    
    0 讨论(0)
  • 2020-12-12 19:41

    Maybe you're trying to uninstall an app that is a phone administrator.

    To be able to uninstall it, go to Seetings > Security > Phone Administrators. If the app is listed, uncheck it and confirm the operation.

    After that, you should be able to uninstall it using the App settings area or adb.

    0 讨论(0)
  • 2020-12-12 19:43

    I had a instance of an emulator running and a device connected.

    When I ran command `adb -d uninstall PACKAGE_NAME', I got an error 'DELETE_FAILED_INTERNAL_ERROR' but when I killed the Emulator instance, I got a 'success' in un-installation process.

    0 讨论(0)
  • 2020-12-12 19:46

    In my case I often get this issue when I first complise a app in debug mode and later try to install the google signed app.

    That is because both apps have the same package name but diffent signatures. Since I upgraded to Android lollypop I sometimes even get this error if I uninstall the app via the settings\Apps. If you have this problem check if the app is installed in a other User profile and uninstall it in all user accounts.

    0 讨论(0)
  • I assume that you enable developer mode on your android device and you are connected to your device and you have shell access (adb shell).

    Once this is done you can uninstall application with this command pm uninstall --user 0 <package.name>. 0 is root id -this way you don't need too root your device.

    Here is an example how I did on my Huawei p10 lite device.

    # gain shell access
    $ adb shell
    
    # check who you are
    $ whoami
    shell
    
    # obtain user id
    $ id
    uid=2000(shell) gid=2000(shell)
    
    # list packages
    $ pm list packages | grep google                                                                                                                                                         
    package:com.google.android.youtube
    package:com.google.android.ext.services
    package:com.google.android.googlequicksearchbox
    package:com.google.android.onetimeinitializer
    package:com.google.android.ext.shared
    package:com.google.android.apps.docs.editors.sheets
    package:com.google.android.configupdater
    package:com.google.android.marvin.talkback
    package:com.google.android.apps.tachyon
    package:com.google.android.instantapps.supervisor
    package:com.google.android.setupwizard
    package:com.google.android.music
    package:com.google.android.apps.docs
    package:com.google.android.apps.maps
    package:com.google.android.webview
    package:com.google.android.syncadapters.contacts
    package:com.google.android.packageinstaller
    package:com.google.android.gm
    package:com.google.android.gms
    package:com.google.android.gsf
    package:com.google.android.tts
    package:com.google.android.partnersetup
    package:com.google.android.videos
    package:com.google.android.feedback
    package:com.google.android.printservice.recommendation
    package:com.google.android.apps.photos
    package:com.google.android.syncadapters.calendar
    package:com.google.android.gsf.login
    package:com.google.android.backuptransport
    package:com.google.android.inputmethod.latin
    
    # uninstall gmail app
    pm uninstall --user 0 com.google.android.gms
    
    0 讨论(0)
提交回复
热议问题