我们知道在Windows系统下阅读源码利器是Source Insight,但是没有Mac版本,阅读源码一直是个问题,之前我写过关于阅读源码神器的Understand,但是如果项目过大则很慢,所以也不能用来阅读Android系统源码,在网上也查过Sublime text配置ctag,但是相对来说也是不方便,后来使用Visual Studio Code和Sublime text相差不多,最后想到用IntelliJ IDEA来阅读源码,如果直接导入则会分为很多module。最近从网上看到可以导入IntelliJ IDEA软件,所以给大家分享一下。本教程基于Mac OS X 10.12。Android系统版本为:7.1.2_r11(7.1.2最终版)。先介绍方法,后面会给出各种问题解决方案。
system/core/libcutils/threads.c:38:10: error: 'syscall' is deprecated: first deprecated in OS X 10.12 - syscall(2) is unsupported; please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost(). [-Werror,-Wdeprecated-declarations]
return syscall(SYS_thread_selfid);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/unistd.h:733:6: note: 'syscall' has been explicitly marked deprecated here
int syscall(int, ...);
^
1 error generated.
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
解决办法:
1
2
3
4
5
Here is how I fixed it:
Download earlier Mac OSX SDK(10.11 worked for me) from
https://github.com/phracker/MacOSX-SDKs/releases
Unzip and copy to /Applications/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs