在工程某位置如3rdparty/cmcc/CMCC/special/新建一个文件夹如mmapp
并在当前目录下修改build.sh
...
function my_local_install()
{
...
#------begin
cd ${MYCHIP_BASE}/mmapp
mkdir -p ${ANDROID_3RDPARTY_ANDROID_OUT}/system/mmapp
cp -f *.apk ${ANDROID_3RDPARTY_ANDROID_OUT}/system/mmapp
#------end
}
部分Demo代码如下
public void setupAPK(String apkname){
//String fileName = Environment.getExternalStorageDirectory() + "/" + "apkname"; //sdcard读取apk
String fileName ="/system/mmapp/" + "apkname"; //手机内存中读取apk
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(fileName)), "application/vnd.android.package-archive");
startActivity(intent);
}