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

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

问题描述

在继续发展我的应用程序的和测试它真正的手机,我需要有它的发行版在同一部手机,为了演示(发行版本更为敏感,由于无日志)。

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).

现在的问题是,为了使两个应用程序在Android中在同一设备上共存的唯一途径是由具有不同的包名。

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...

理想的情况是,Eclipse + ADT将允许追加修改变量,会自动生成调试/发布不同的包名,而允许这种共存,但我找不到任何允许这样做的机制。

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.

推荐答案

您可以尝试这种技术使用的蚂蚁,的詹金斯甚至其他工具来自动包重命名所建议的@LAS_VEGAS。

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

虽然不是你问的是什么,这个很酷的code段可以帮你找到了在运行时无论您code是调试或发布。

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

另一个有趣的这样的尝试可以在找到这个线程。我不知道但如果它工作在Android上。

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

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

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