How to read the source code through android studio without compiling on mac

1. For developers, it is very important to read the first-hand source code. You can use source insight on windows, but not on mac.

 But we still need to read the source code, so what should we do? Some people may say to use subline, but I think I am used to using android studio. Today I

 I will teach you how to use android studio to read the Android source code

2. Environment preparation Download Android source code:

  Download repo, set environment variables for repo, here is to create a new bin folder directly under the root directory, give repo permission
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git- repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

Note that it is best to create a new partition here, which is case-sensitive, otherwise there will be problems during subsequent compilation, and the bold font is specially marked

3. In order to download quickly, because I downloaded android2.3.7, which is relatively small at 3.17G, after the source code is downloaded

4. Download Xcode, I downloaded Xcode 10,

5. Execute, make idegen && development/tools/idegen/idegen.sh may have a problem that the macOs sdk cannot be found when compiling, then

Let's look at the error message and modify the code. For example, when I compiled, I said that the sdk could not be found, then I searched according to the error message and found it in Makefile.android

It says that the sdk path cannot be found, the first is that my path is wrong, and the second is that there is no corresponding sdk under my path, because I

Guess you like

Origin blog.csdn.net/qq_18757557/article/details/105017387