安装应用权限:android.permission.INSTALL_PACKAGES系统应用(安装在/system/app下面)可以采用该方式,第三方应用无法申请安装卸载权限,java.lang.SecurityException: Neither user 10039 nor current process has android.permission.INSTALL_PACKAGES.3、执行install命令。install –r 更新安装,默认新安装;如果不附上-r参数,则会清楚原应用的数据,版本一致则无法安装。(1)am start …(2)Runtime.exec(String[] args)(3)Class<?> execClass = Class.forName("android.os.Exec");4、执行cp / adb push命令。由系统检测到应用程序有更新,自动完成重新安装。
卸载程序的方法:1、通过Intent机制,调出系统卸载应用。
安装程序的方法:1、通过Intent机制,调出系统安装应用,重新安装应用的话,会保留原应用的数据。String fileName = Environment.getExternalStorageDirectory() +apkName; Uri uri = Uri.fromFile(new File(fileName)); Intent int