如何在同一台设备上调试和发布apk? [英] How to have both Debug and Release apk on same device?

查看:168
本文介绍了如何在同一台设备上调试和发布apk?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在继续开发我的应用程序并在真实手机上测试时,我需要在同一台手机上发布它的版本,以进行演示(发布版本更加灵敏,感谢无日志)。



问题是,在Android中同一台设备上共同存在两个应用程序的唯一方法就是拥有不同的包名。 / p>

但是包名称需要重新分解和大量的传播手动修复...更不用说这会混淆版本控制...



理想情况下,Eclipse + ADT将允许附加一个修饰符变量,该变量将自动为调试/释放生成不同的包名,并允许这种共存,但是我找不到允许这样做的任何机制。



你知道有什么办法解决这个问题吗?



欢迎创意解决方案和想法。 >

解决方案

您可能想尝试这项技术,使用蚂蚁 Jenkins 以及其他可根据建议自动执行软件包重命名的工具通过@LAS_VEGAS。



尽管不是您要求的,这个很酷的代码段< a>可以帮助您在运行时了解您的代码是调试还是释放。



可以在此线程中找到另一个有趣的尝试。我不确定它是否适用于Android。


While continuing to develop my application and test it on a real phone, I need to have the release version of it on the same phone, for demonstration purposes (the release version is much more responsive, thanks to no-logs).

The problem is that the only way to make two applications co-exist on the same device in Android is by having different package names.

But package names require re-factoring and lots of propagating manual fixes... not to mention that this confuses version control...

Ideally, Eclipse+ADT would allow appending a modifier variable that would automatically generate a different package name for debug/release and would allow such co-existence, but I couldn't find any mechanism that allows doing that.

Do you know of any way to workaround this?

Creative solutions and ideas are welcome.

解决方案

You may want to try this technique using ant, Jenkins and perhaps other tools to automate package renames as suggested by @LAS_VEGAS.

Although not what you asked for, this cool code snippet can help you find out at runtime whether your code is debug or release.

Another interesting such attempt can be found in this thread. I am not sure though if it works on Android.

这篇关于如何在同一台设备上调试和发布apk?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆