在没有eclipse的情况下将android项目编译成apk [英] Compile android project to apk without eclipse

查看:127
本文介绍了在没有eclipse的情况下将android项目编译成apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了我从eclipse项目中获取的类文件,并通过优化器/混淆器运行它们。所以我现在已经优化了类文件,我想以一个apk的形式获得,所以我可以签名并发布它。但是,我迷失了如何做到这一点。我想我不能将它们复制到我的eclipse项目的bin文件夹中,因为当我尝试导出一个签名的apk时,eclipse将会用新的编译来覆盖它们。那么如何从这些类文件中创建一个apk?

解决方案

你可以尝试将它们放在bin / classes中使用蚂蚁命令构建您的应用程序

  cd / path / to / my / app 
ant release

每次您都会询问您的私钥签名应用程序,可以将其配置为自动签名通过编辑build.properties文件:

  key.store = release.keystore 
key.alias = release
key.store.password = my_key_password
key.alias.password = my_key_password

您还可以调查Android SDK,找到它实际使用的ANT构建脚本,并在构建过程的中间插入自定义混淆器/优化器调用。


What I have done is I have taken the class-files from my eclipse project and run them trough an optimizer/obfuscator. So I now have optimized class-files that I want to get in the form of an apk so I can sign and publish it. However, I am lost on how to do this. I guess I cant just copy them into the bin-folder of my eclipse-project, because eclipse would just overwrite them with a new compilation when I try to export a signed apk. So how do I create an apk from these class-files?

解决方案

you can try to put them in bin/classes and then use "ant" command to build your application

cd /path/to/my/app
ant release

it will ask you every time for your private key to sign the app, it can be configured to auto-sign by editing "build.properties" file:

key.store=release.keystore
key.alias=release
key.store.password=my_key_password
key.alias.password=my_key_password

you can also investigate Android SDK, find the ANT build scripts it actually uses, and insert your custom obfuscator/optimizer call in middle of build process.

这篇关于在没有eclipse的情况下将android项目编译成apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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