eclipse导入所有的Android代码

作者: zjc0888
发布时间:2015-07-28 10:11:22

方法如下:
cd myandroid
1. 把eclipse工程配置文件复制到android源码根目录下
cp development/ide/eclipse/.classpath ./
chmod u+w .classpath  # Make the copy writable
2. 修改eclipse程序的配置
1)、增大eclipse内存设置
把eclipse.ini(在eclipse软件的安装目录下)的3个值改为下面的值:
-Xms128m
-Xmx512m
-XX:MaxPermSize=256m
3. 把android源码作为一个工程导入eclipse
导入前先检查.classpath里的文件在android源码中是否有相应的文件(文件夹),否则也会破坏android源码(一般是多添加文件/文件夹),.classpath里多余的路径可删除
新建Java Project(不是android project,否则会破坏android源码),选择从已存在的工程导入,工程名任意,完成。


 .project文件内容                                                                                                                    
==========================================================================================
<?xml version="1.0" encoding="UTF-8"?>                                                                                   
 <projectDescription>
     <name>GingerBread</name>
     <comment></comment>
    <projects>
     </projects>
     <buildSpec>
         <buildCommand>
             <name>org.eclipse.jdt.core.javabuilder</name>
             <arguments>
             </arguments>
         </buildCommand>
     </buildSpec>
     <natures>
         <nature>org.eclipse.jdt.core.javanature</nature>
     </natures>
     <linkedResources>
         <link>
             <name>packages/providers/CalendarProvider/src/com/android/providers/calendar/EventLogTags.java</name>
             <type>1</type>
             <location>/work/gingerbread2.3/out/target/common/obj/APPS/CalendarProvider_intermediates/src/src/com/android/providers/calendar/EventLogTags.java</location>
         </link>
         <link>
             <name>packages/providers/ContactsProvider/src/com/android/providers/contacts/EventLogTags.java</name>
             <type>1</type>
             <location>/work/gingerbread2.3/out/target/common/obj/APPS/ContactsProvider_intermediates/src/src/com/android/providers/contacts/EventLogTags.java</location>
         </link>
     </linkedResources>
 </projectDescription>
===========================================================================================================

版权声明:本文为博主原创文章,未经博主允许不得转载。

来源:http://blog.csdn.net/zjc0888/article/details/6280361

推荐: