adb uninstall failed

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

提交回复
热议问题