目前做framework开发,仅仅导入framework源码进行查看,发现很多跳转并不能跳转,
得益于公司配备的电脑性能超好,查看的时候导入源码进行查看比较方便。
1.拷贝android.iml 和 android.ipr 放到源码根目下面
如下路径
development/tools/idegen/templates/android.iml
development/tools/idegen/templates/android.ipr
2.打开 根目录下拷贝的android.iml 文件 用如下代码替换掉 SOURCE_FOLDERS
<content url="file://$MODULE_DIR$">
//替换掉
SOURCE_FOLDERS
</content>
替换之后
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/external" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/miui" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/vendor" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/frameworks" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/.repo" />
<excludeFolder url="file://$MODULE_DIR$/abi" />
<excludeFolder url="file://$MODULE_DIR$/art" />
<excludeFolder url="file://$MODULE_DIR$/bionic" />
<excludeFolder url="file://$MODULE_DIR$/bootable" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/cts" />
<excludeFolder url="file://$MODULE_DIR$/dalvik" />
<excludeFolder url="file://$MODULE_DIR$/developers" />
<excludeFolder url="file://$MODULE_DIR$/development" />
<excludeFolder url="file://$MODULE_DIR$/device" />
<excludeFolder url="file://$MODULE_DIR$/docs" />
<excludeFolder url="file://$MODULE_DIR$/frameworks/base/docs" />
<excludeFolder url="file://$MODULE_DIR$/hardware" />
<excludeFolder url="file://$MODULE_DIR$/kernel" />
<excludeFolder url="file://$MODULE_DIR$/libcore" />
<excludeFolder url="file://$MODULE_DIR$/libnativehelper" />
<excludeFolder url="file://$MODULE_DIR$/ndk" />
<excludeFolder url="file://$MODULE_DIR$/out" />
<excludeFolder url="file://$MODULE_DIR$/pdk" />
<excludeFolder url="file://$MODULE_DIR$/platform_testing" />
<excludeFolder url="file://$MODULE_DIR$/prebuilt" />
<excludeFolder url="file://$MODULE_DIR$/prebuilts" />
<excludeFolder url="file://$MODULE_DIR$/rc_projects" />
<excludeFolder url="file://$MODULE_DIR$/sdk" />
<excludeFolder url="file://$MODULE_DIR$/system" />
<excludeFolder url="file://$MODULE_DIR$/tools" />
<excludeFolder url="file://$MODULE_DIR$/trusty" />
</content>
3.AndroidStudio 打开根目录 android.ipr 过程比较慢,耐心等待
4.导入完成之后点击 Progect Structure-->点击Modules 再点击 Dependencies。
5.点击 + 号 选择 JARS OR Directories 将frameworks 和external 分别 导入项目 --> Apply