adb uninstall failed

前端 未结 24 1559
清歌不尽
清歌不尽 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:27

    If it is an Android internal app you may need to:

    • adb shell
    • mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
    • rm /system/app/your_app
    • rm /data/data/your_app
    • remove any entries in /data/system/packages.xml
    • remove any entries in /data/system/packages.list
    • edit AndroidManifest.xml and get rid of android:sharedUserId="android.uid.shared"

    This is at your own risk;-|, try in emulator first...

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

    I find that adb shell pm uninstall <package> works consistently, where adb uninstall <package> does not.

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

    Open your application Manifest and check the application's package first.

    After that, be sure that your device is set into debugger mode.

    Check if ADB can interact with your device:

    adb devices

    If your device is listed, then run:

    adb uninstall PACKAGE_WRITTEN_IN_MANIFEST

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

    Yes, mobile device management would bring its own problems, but i bet 'Failure' is a dos2unix problem. On my Linux machines, adb is appending a DOS newline which causes 'Failure' because uninstall thinks the CR character is part of the package name. Also remove '-1.apk' from the end of the package-1.apk filename.

    adb root
    adb shell
    pm list packages
    pm uninstall com.android.chrome
    

    In my case, i have a phone that is in permanent 'Safe mode' so only apps under /system/app/ have a chance of running. So i install them to get the .apk files copied off, then uninstall in bulk and copy to /system/app/, wipe the /cache and reboot. Now i have more apps running even though in safe mdoe.

    # adb root
    # pm list packages -3 > /root/bulkuninstall.txt
    # vi /root/bulkuninstall.txt  and check ^M characters at end of each line.   
       If ^M, then must run dos2unix /root/bulkuninstall.txt.  
       Remove '-1.apk' using vi search and replace:  
            :%s/-1\.apk//g 
       Or sed...
    
    # cp /data/app/* /storage/sdcard1/APKs/
    # for f in `cat /root/bulkuninstall.txt`; do echo $f; pm uninstall $f; done;
    # 
    # echo Now remount system and copy the APK files to /system/app/
    # mount | grep system
    # mount -o remount,rw /dev/block/(use block device from previous step)  /system 
    # cp /storage/sdcard1/APKs/* /system/app/
    # reboot
    

    wipe cache power on.

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

    You can follow below steps to uninstall the app from the device via command prompt.

    1. execute the command : adb -s [devicename] uninstall -k [packagename]. this command will retain the data and cache in the device but will remove the app from the device.
    2. To remove the data and cache also from the device along with the application execute the command below. adb shell pm uninstall -k [packagename].

    if it shows sucess your app is uninstalled successfully'

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

    Mine was on samsung j7 pro, issue was simple.

    j7y17lte:/system $ pm list packages|grep airtel                                                                                                                                                                                            
    package:com.samsung.android.airtel.stubapp
    
    j7y17lte:/system $ pm uninstall -k --user 0 com.samsung.android.airtel.stubapp
    

    DO NO-NOT include the word package in the unistall command

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