简体   繁体   English

我如何获取导出apk的日期

[英]how can i get the date of when i exported my apk

I'm trying to set some kind of a version number that will be updated automatically, as im adding and changing the code every time, i was thinking of just making the version number relate to the last date (ie 1.2.7.16 for 16.7) and show it somewhere on my app, so coworkers could check for related bugs. 我试图设置某种版本号,该版本号将自动更新,因为每次添加和更改代码时,我都在考虑使版本号与上次日期相关(即1.6.7.16为16.7)并将其显示在我的应用程序中的某个位置,以便同事可以检查相关的错误。

so i'v make a simple string, but it is 2 much work changing it every time, would it be possible to somehow do it programmatically? 所以我做了一个简单的字符串,但是每次都要更改它要花2个工作,是否有可能以某种方式进行编程?
How can i make that string be the corelate to the date of then i export my apk? 我如何才能使该字符串成为日期的核心,然后导出我的apk?

Write a perl/python/your_language_of_choice script that does it for you before compiling. 编写一个perl / python / your_language_of_choice脚本,在编译之前为您执行此操作。 Put it into your build process. 将其放入您的构建过程中。 If you don't use a build script and you're a professional, its time to treat this like a real project and do things right. 如果您不使用构建脚本而又是专业人士,那么该将其视为真实项目并正确处理事情的时候了。

BTW, better than date is to use the SVN/git/cvs/other version number, so you can backtrace to the exact code used in a bug report. 顺便说一句,比日期更好的是使用SVN / git / cvs /其他版本号,因此您可以回溯到错误报告中使用的确切代码。 If you aren't using source control, start NOW. 如果您不使用源代码管理,请立即开始。

You may use a version control such as GIT. 您可以使用版本控制,例如GIT。 This kind of tools can help you versioning your application. 这种工具可以帮助您对应用程序进行版本控制。 This could help: http://www.vogella.com/tutorials/EclipseGit/article.html 这可能会有所帮助: http : //www.vogella.com/tutorials/EclipseGit/article.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM