PackageManager pm = context.getPackageManager(); PackageInfo info = pm.getPackageArchiveInfo(filePath, PackageManager.GET_ACTIVITIES); // filePath为apk文件路径 return info.versionCode; // apk安装包中的版本号