android: workaround for slow ‘building workspace’ problem in eclipse

解决Android开发中Eclipse慢编译问题
本文提供了一种解决在使用Eclipse开发Android应用时遇到的慢编译问题的方法,通过禁用AndroidPackageBuilder和使用ant build部署到模拟器,可以保持Eclipse的正常运行速度,同时在需要在模拟器上运行应用时执行ant install。

While developing for android on eclipse 3.6 i had the problem that each time i saved a file, eclipse blocked me several seconds with ‘building workspace…’. Similar to these:

stackoverflow – android-compilation-is-slow-using-eclipse
stackoverflow – android-eclipse-workspace-takes-a-long-time-to-build
groups.google – android-developers/thread/a16202975510de39


The best workaround i found for me:

  • disable Android Package Builder (right-click on project#Properties#Builders)
  • use ant build to deploy on emulator

This way i can work (as) fast (as usual) with eclipse, everything compiles and gets generated, but once i want the app on the emulator, i execute ‘ant install‘ from console.

Setting up the ant build is quite easy, see using-ant-to-automate-building-android for details.
In short you have to simply execute ‘android update project --path .‘ which generates your build.xml.


Note: If you have 3rd party jars put them in ‘libs’ folder, that way ant is aware of them.

Note: You also can build a signed apk with ‘ant release‘. Add therefor a build.properties with such a keystore setup:


key.store=/Users/jz/.android/debug.keystore
key.alias=androiddebugkey
key.store.password=android
key.alias.password=android

 



PS: i also stumbled into the ‘external folder’ synchronization problem. Closing all android projects and reopening again helped!

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值