模拟器替换launcher

模拟器替换launcher

1、启动模拟器

2、赋予权限(重新挂载系统分区,使系统分区重新可写)

Java代码

root@meie:~# adb remount

root@meie:~# adb remount

3、删除Launcher2.apk

Java代码

root@meie:~# adb shell # cd system # cd app # rm Launcher2.apk

root@meie:~# adb shell

# cd system

# cd app

# rm Launcher2.apk

4、卸载Launcher

Java代码

root@meie:~# adb uninstall com.android.launcher

root@meie:~# adb uninstall com.android.launcher

5、安装新Launcher

Java代码

root@meie:~# adb install '/work/official/out/target/product/generic/system/app/Launcher2.apk' 2213 KB/s (893174 bytes in 0.394s) pkg: /data/local/tmp/Launcher2.apk Success

root@meie:~# adb install '/work/official/out/target/product/generic/system/app/Launcher2.apk'

2213 KB/s (893174 bytes in 0.394s)

pkg: /data/local/tmp/Launcher2.apk

Success

注意:只删除apk文件不卸载的话,会残留数据,安装新Launcher报错误

Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

相关推荐