如何重建在释放模式Android应用通过命令行界面的另一个包的名字吗? [英] How to rebuild Android app in release mode with another package name by command line interface?

查看:209
本文介绍了如何重建在释放模式Android应用通过命令行界面的另一个包的名字吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好即时作出通用的应用程序,是通过水库XML的文件和配置。我试着去从code的同一来源做出型动物的apk。现在的问题是,即时通讯triying通过命令行界面来做到这一点,我仍然不找到一种方法来更改包名称,然后在释放模式构建。

Hello im making an generic app that is configurable by xmls and files on res. Im trying to make differents apks from the same source of code. The problem is that im triying to do this by command line interface and i still dont find a way to change the package name and then build it in release mode.

我创建我的自定义的build.xml Ant文件和我trye​​d <一个href=\"http://stackoverflow.com/questions/17287018/changing-application-package-name-in-custom-ant-build-step\">this解决方案,它会产生2的APK: MainActivity-debug.apk MainActivity-调试unaligned.apk ,但对我没有工作,因为APK只是建立在调试模式,并没有甚至在模拟器跑丢[INSTALL_FAILED_INVALID_APK]

I created my custom build.xml ant file and I tryed this solution,it generates 2 apks: MainActivity-debug.apk and MainActivity-debug-unaligned.apk but didnt work for me since the apk just built on debug mode and didnt even ran on emulator throwing [ INSTALL_FAILED_INVALID_APK].

那么,有没有这样做的方法吗?主要的问题心不是关于调试或发布模式,因为我想我只是将不得不使用蚂蚁发布命令,大约是用不同的软件包名称创建一个APK所以我可以有双方签字,并在同一台设备上运行。

So is there a way of doing this? The main problem isnt about debug or release mode since i think i just will have to use ant release command, is about creating an apk with different packages names so i can have both signed and running in same device.

感谢您!

推荐答案

commonsWare 建议我用的摇篮此解决方案。

As commonsWare proposed i used Gradle for this solutions.


  • 我用教程摇篮与Android。

  • 我用<一个href=\"http://stackoverflow.com/questions/18328730/how-to-create-a-release-signed-apk-file-using-gradle\">this答案在释放模式构建应用程序的

  • 我用香精也可作为commonsWare说,读

  • I used this tutorial for Gradle with android.
  • I used this answer for building apps in release mode
  • I used flavors also as commonsWare said, read this

非常感谢!

这篇关于如何重建在释放模式Android应用通过命令行界面的另一个包的名字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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