This article was first published on wechat official account “Liu Wangshu”
Android system start series application process start series Android in-depth understanding of the four components of Android Context series Android in-depth understanding of JNI series Android parsing WindowManager WMS series AMS series Android package management mechanism Android input system series
preface
In Android advanced trilogy second “Android advanced decryption” in the first chapter, I introduced two ways to read the source code, one of which is from Baidu network disk: pan.baidu.com/s/1ngsZs will download the source code, and then use SouceInsight to view, this way is very convenient, suitable for reading the source code, but there are two disadvantages, one is not able to obtain the latest source code, the other is not able to compile the source code. This series is about downloading and compiling source code. The source code needs to be compiled in A Linux environment. Many of you do not have Ubuntu, but you can install Ubuntu on Windows and Mac using VirtualBox. This article will explain the installation process for Windows10, the Mac environment is similar. You can also download Ubuntu for Windows 10 from the Microsoft Store and try it out.
The preparatory work
Two files need to be downloaded:
- VirtualBox: download address is: www.virtualbox.org/wiki/Downlo… 6.0.4.
- Ubuntu desktop version: download address is: www.ubuntu.com/download/de… 18.04.2 LTS.
Installing VirtualBox is a simple step along the way.
VirtualBox install Ubuntu
1. Click VirtualBox Create button to create a virtual computer.
Blog.csdn.net/tai53243990…
2. Set the memory allocated to the VIRTUAL machine. The recommended memory for this version is 1 GB.
3. Create the size of the virtual hard drive and click Next.
4. The recommended size of the virtual hard disk is 10GB, but if you want to compile Android source code, you need a larger hard disk space, the recommended minimum amount of 200GB, I have 200GB.
5. Select Ubuntu and click Start.
6. Select the downloaded Ubuntu image and click Start.
7. Select a language and install Ubuntu.
8. Follow the steps below.
9. Enter your name and password and click Continue:
10. Start installing Ubuntu. Once installed, click Restart Now and you’re done.
Install enhancement tools
There are two main purposes for installing the enhancement tool:
- File sharing between the Vm (Ubuntu) and host (Windows).
- You can use full screen mode.
1. Configure Ubuntu to turn on the top of the screen in the user interface.
Create a shared folder and select Auto Mount and Fixed Assignment.
Selecting Devices -> Install enhancements at the top of the emulator screen will generate a drive letter for vbox_GAS_6.0.4 on the desktop and then configure it.
2. Install the enhancement tool
Install GCC and perl libraries first:
sudo apt-get install gcc perl make
Copy the code
Go to the vbox_gas_6.0.4 directory in your desktop or Ubuntu main file and click Run to install the enhancements.
If the following information is displayed, the installation is successful. Restart the VM.
At this time, a drive letter will be generated on the desktop, through which you can share files with the host.
In addition to installing the enhancement tools, there is another feature that is very commonly used, sharing the stickboard and dragging and dropping in Settings -> General -> Advanced to make the interaction between the virtual machine and the host easier.
Afterword.
This is probably the simplest article I’ve ever written. There’s really nothing to write, but someone needs it. Next we’ll learn how to download the AOSP source code.
Share big front-end, Android, Java and other technologies to help 50,000 programmers grow and advance.