4

【android】app打包成apk文件以后,如何查看versioncode、versionname等版本信息 | iT...

 3 years ago
source link: https://itimetraveler.github.io/2015/12/25/%E3%80%90Android%E3%80%91app%E6%89%93%E5%8C%85%E6%88%90apk%E6%96%87%E4%BB%B6%E4%BB%A5%E5%90%8E%EF%BC%8C%E5%A6%82%E4%BD%95%E6%9F%A5%E7%9C%8BVersionCode%E3%80%81VersionName%E7%AD%89%E7%89%88%E6%9C%AC%E4%BF%A1%E6%81%AF/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

【Android】app打包成apk文件以后,如何查看VersionCode、VersionName等版本信息

Android App打包成Apk后,其实是一个压缩文件,可以将后缀名apk改为zip然后用winrar打开也能看到里面的文件结构。还能看到AndroidManifest.xml。但是里面的内容经过编码显示为乱码,不方便查看。

aapt工具:

  这里我们可以使用aapt工具来查看。aapt.exe工具即Android Asset Packaging Tool,在SDK的build-tools目录下。

  该工具可以查看,创建, 更新ZIP格式的文档附件(zip, jar, apk)。也可将资源文件编译成二进制文件,尽管你可能没有直接使用过aapt工具,但是build scripts和IDE插件会使用这个工具打包apk文件构成一个Android 应用程序。在使用aapt之前需要在环境变量里面配置SDK-tools路径,或者是路径+aapt的方式进入aapt。

  也就是说平时我们不会用这个东西,但是打包成Apk的时候其实是用到了的,只不过IDE替我们做了这一步,那么我们就用这个工具来查看VersionCode和VersionName。

操作流程:

1、首先找到aapt工具,在Android SDK文件夹下的build-tools包里,如下:

cd D:\Android\SDK\build-tools\23.0.0_rc3

2、然后使用aapt dump bading XXX.apk

aapt dump badging C:\Users\kuguan\Desktop\app-release_1.0.9.apk

就能看到PackageName,VersionCode,LauncherActivity等信息,如下图:

应用包名PackageName:

LauncherActivity:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK