如何从一个项目创建多个apk?[英] How to create multiple apks from one project?

本文是小编为大家收集整理的关于如何从一个项目创建多个apk?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我有一个Android项目,我需要创建多个APK.每个APK之间的唯一区别将是包名称(例如com.my.package.name)和app字符串名称,因此我可以在一个设备上安装多个应用程序实例.有更好的方法是这样做吗?我想到了创建一个图书馆项目,但我认为可能有一种更简单的方式.

推荐答案

我实际使用 apktool 分解APK然后编辑使用一些perl脚本的smali文件来更改包名称.

其他推荐答案

您可以将您的主代码放在库中并构建具有生成多个APK的多个兄弟项目:

我测试了这个,而且比我第一次想到的更容易: https://stackoverflow.com/a/9971543/305135

其他推荐答案

库项目是这样做的正确方法.您在库项目中创建和工作,并为每个版本进行项目,这取决于库项目.盲目地铭记你需要为每个项目拥有正确的androidmanifest.

本文地址:https://www.itbaoku.cn/post/1937944.html

问题描述

I have one android project where I need to create multiple apks. The only difference between each apk will be package name (e.g. com.my.package.name) and the app string name so I can install multiple instances of the app on one device. Is there a better way of doing this? I thought about creating a library project, but I thought there might be an easier way of doing this.

推荐答案

I actually used the apktool to decompile the apk and then edited the smali files using some Perl script to change the package name.

其他推荐答案

You can put your main code in a Library and build multiple sibling projects that have multiple APKs generated:

I tested this and was much easier than I first thought: https://stackoverflow.com/a/9971543/305135

其他推荐答案

The library project is the correct way of doing this. You create and work on the library project and have a project for each version, that depends on the library project. Bare in mind that you need to have a correct Androidmanifest for each project.