使用 Eclipse 重建 .apk 而无需运行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8057465/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Rebuild .apk using Eclipse without Run
提问by Ronen P.
I've got a dual-core 1.6Mhz CPU with 2G RAM, thus, I'm trying to use the emulator external to Eclipse and install/un-install the .apk using adb. When I try to build the project (after some code changes) without running it, Eclipse seems to-do nothing ?? any idea how to make Eclipse re-build the .apk without the need to Run it
我有一个带 2G RAM 的双核 1.6Mhz CPU,因此,我尝试使用 Eclipse 外部的模拟器并使用 adb 安装/卸载 .apk。当我尝试构建项目(在一些代码更改之后)而不运行它时,Eclipse 似乎什么都不做??知道如何让 Eclipse 重新构建 .apk 而无需运行它
Thank you
谢谢
回答by ArtOfWarfare
On a Mac menubar: Eclipse -> Preferences
在 Mac 菜单栏上:Eclipse -> Preferences
On Windows menubar: Windows -> Preferences
在 Windows 菜单栏上:Windows -> Preferences
From this Preferences window: Android -> Build
从这个首选项窗口:Android -> Build
Now uncheck "Skip packaging and dexing until export or launch. (Speeds up automatic builds on file save.)"
现在取消选中“在导出或启动之前跳过打包和 dexing。(加快文件保存时的自动构建。)”
You may have to restart Eclipse for the preference change to actually be reflected.
您可能必须重新启动 Eclipse 才能实际反映首选项更改。
回答by Geekswordsman
By default, Eclipse auto-builds the .apk as you make changes. You can find this at any time in the your project's bin/ directory.
默认情况下,Eclipse 会在您进行更改时自动构建 .apk。您可以随时在项目的 bin/ 目录中找到它。
If there are no new changes (and you haven't performed a clean on the project) then requesting a build will do nothing as Eclipse has nothing to do; it already compiled the project for you.
如果没有新的更改(并且您还没有对项目进行清理),那么请求构建将无济于事,因为 Eclipse 与此无关;它已经为您编译了项目。
回答by Simon K
Right click on your project in Eclipse. Choose "Android Tools". Choose "Export Unsigned Application Package".
在 Eclipse 中右键单击您的项目。选择“安卓工具”。选择“导出未签名的应用程序包”。
回答by Kevin Coulombe
I'm not much more experience than you are with Android, but from what I understand, the .apk is built incrementally as you modify the sources. So you don't have to do anything. Just save your code and use the .apk.
我的经验并不比您在 Android 方面多多少,但据我所知,.apk 是在您修改源时逐步构建的。所以你什么都不用做。只需保存您的代码并使用 .apk。
回答by Igor Filippov
Do you have "Build Automatically" checked(look it in menu "Project")? If so, apk is being built after every code change. You can also build it manually, in "Project" menu.
您是否选中了“自动构建”(在菜单“项目”中查看)?如果是这样,则每次代码更改后都会构建 apk。您也可以在“项目”菜单中手动构建它。