adb shell command to make Android package uninstall dialog appear

后端 未结 7 957
执笔经年
执笔经年 2020-12-07 08:30

I have adb running and device is connected to my system in debugging mode,

I want to uninstall app using intent launch using adb shell am start &l

相关标签:
7条回答
  • 2020-12-07 08:40

    Use this command in cmd:

    adb shell pm uninstall -k com.packagename

    For example:

    adb shell pm uninstall -k com.fedmich.pagexray
    

    The -k flag tells the package manager to keep the cache and data directories around, even though the app is removed. If you want a clean uninstall, don't specify -k.

    0 讨论(0)
  • 2020-12-07 08:43

    While the above answers work but in case you have multiple devices connected to your computer then the following command can be used to remove the app from one of them:

    adb -s <device-serial> shell pm uninstall <app-package-name>
    

    If you want to find out the device serial then use the following command:

    adb devices -l
    

    This will give you a list of devices attached. The left column shows the device serials.

    0 讨论(0)
  • 2020-12-07 08:56

    You can do it from adb using this command:

    adb shell am start -a android.intent.action.DELETE -d package:<your app package>
    
    0 讨论(0)
  • 2020-12-07 09:01

    Running the @neverever415 answer I got:

    Failure [DELETE_FAILED_INTERNAL_ERROR]

    In this case check that you wrote a right package name, maybe it is a debug version like com.package_name.debug:

    adb shell pm uninstall com.package_name.debug
    

    Or see https://android.stackexchange.com/questions/179575/how-to-uninstall-a-system-app-using-adb-uninstall-command-not-remove-via-rm-or.

    0 讨论(0)
  • 2020-12-07 09:05

    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 P110 lite

    # 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)
  • 2020-12-07 09:05

    In my case, I do an adb shell pm list packages to see first what are the packages/apps installed in my Android device or emulator, then upon locating the desired package/app, I do an adb shell pm uninstall -k com.package.name.

    0 讨论(0)
提交回复
热议问题