如何配置Eclipse作为Android源码IDE
1.下载Eclipse
$sudo apt-get install eclipse
2.配置Eclipse作为Android源码IDE流程
拷贝development/ide/eclipse/.classpath到源代码根目录并修改.classpath
删除下面两行
<
classpathentry
kind
="lib"
path
="out/target/common/obj/JAVA_LIBRARIES/google-common_intermediates/javalib.jar"
/>
< classpathentry kind ="lib" path ="out/target/common/obj/JAVA_LIBRARIES/gsf-client_intermediates/javalib.jar" />
< classpathentry kind ="lib" path ="out/target/common/obj/JAVA_LIBRARIES/gsf-client_intermediates/javalib.jar" />
添加
<
classpathentry
kind
="lib"
path
="out/target/common/obj/JAVA_LIBRARIES/android-common_intermediates/javalib.jar"
/>
Eclipse中创建Java工程,将源码工程导入
通过create file from existing source 导入Gingerbread源代码
如何Debug Android源码
设置断点,在 Run->Debug Configurations->Remote java application上双击,然后,”Host:”设为 localhost,”Port:”设为8700,”Connection Type”为Standard(Socket Attach)
然后“Apply”点击“Debug”,是不是看见一个提示框?Ok,开始你的源码开发之旅吧。
需要注意的是,对源码进行修改后,需要:
(以Settings.apk为例)
1.重新编译
$ make Settings
2.重新打包映像文件
$ make snod
3.重启模拟器