This article was published on WeChat official account “Liu Wangshu”

This is the third post of BatCoder. BatCoder is an extension to the Android Advanced Trilogy. It will expand and update the content of the Android Advanced Trilogy. As for why it’s called Batcoder, it’s because I want you to watch my technical videos and get into your favorite big factory.

This might be the easiest article I’ve written in years, but if it helps a few people, it’s useful.

In the first chapter of the second part of the Android Advanced Trilogy, Android Advanced Decryption, I introduced two ways to read the source code, one of which is from the Baidu net disk: https://pan.baidu.com/s/1ngsZs will download the source code, then use SouceInsight to view, this way is very convenient, suitable to read the source code, but there are two disadvantages, one is unable to get the latest source code, the other one is not able to compile the source code. In the future, we need to compile and debug the source code, which needs to be compiled under Linux environment. Many students’ systems are not Ubuntu, but we can use VirtualBox to install Ubuntu on Windows and Mac (AOSP can be downloaded directly on Mac, but it may pollute the system). So before I talk about downloading the system source code, I will first explain the process of installing Ubuntu with VirtualBox on Windows10. The Mac environment is similar. In addition, under Windows 10, you can also download Ubuntu software in the Microsoft Store, you can go to try.

Video version

Many details, only in the video version ~, welcome to watch the video

Watch by Independent Bloggers

B stand to watch

<! –more–>

The preparatory work

First you need to download two files:

  1. VirtualBox: download address is: https://www.virtualbox.org/wi…
  2. Ubuntu desktop version: download address is: https://www.ubuntu.com/downlo…

The VirtualBox installation process is simple, one step along the way. This is mainly about installing Ubuntu with VirtualBox.

VirtualBox install Ubuntu

1. Click the VirtualBox New button to create a new virtual machine.

There may be no 64-bit option in the version option, so you need to go to the BIOS and turn on CPU virtualization. Different motherboard into different ways (specific please own Baidu), such as my HP desktop, in the boot of the continuous press F10 will enter the BIOS, in the security -> system security -> virtualization technology option Settings can be enabled. If there is still no 64 – bit option please see this article: https://blog.csdn.net/tai5324…

2. Set the memory allocated to the virtual machine. The recommended memory for this version is 1GB, which can be determined according to your computer configuration.

3. Create the size of the virtual hard drive, all the way to the next click can be.





4. Although the recommended size of the virtual hard disk is 10G, but if you want to compile the Android source code, you need more hard disk space, it is recommended to divide 200GB at least, I divide 200GB here.

5. Select Ubuntu and click Start.

6. Select the Ubuntu image you have downloaded and click Start.

7. Select the language of your system and install Ubuntu.

Just follow the steps below.



9. Enter your name and password, and click Continue:

10. Start installing Ubuntu, click restart now.



Install the enhancement tool

There are two main purposes for installing enhancements:

  1. Implement file sharing between virtual machine (Ubuntu) and host machine (Windows).
  2. You can use full screen mode.

1. Configure Ubuntu to open the top of the screen in the user interface.

Create a new shared folder and check auto mount and fixed allocation.

Select Device -> to install the enhancements at the top of the emulator screen, which will generate a VBOX_GAS_6.0.4 drive character on the desktop, and then configure it. If there is no drive generated, you can go to the file to find.

2. Install the enhancement tool

Install the GCC and Perl libraries first:

sudo apt-get install gcc perl make

Go to the vbox_gas_6.0.4 directory in your desktop or Ubuntu main file and click Run Software to install the enhancements.

The following prompts indicate that the installation was successful.

To add the current user not yet added to the vboxsf group:

sudo adduser zhangrj vboxsf

Restarting UNBANTU will generate a disk on the desktop, which can be used to share files with the host. If no disk is generated, you can look it up in the file.

In addition to installing enhancements, a very common feature in Settings -> General -> Advanced is the shared paste board and drag and drop selection two-way, which makes the interaction between the virtual machine and the host much easier. See this video for more details.

Independent blog: http://liuwangshu.cn/batcoder… B station address: https://www.bilibili.com/vide…

About the author: Liu Wangshu, the most valuable expert of Tencent Cloud, has written the best selling books “Android advanced light”, “Android advanced decode”, “Android advanced refers to the north”, won four consecutive annual excellent author of the Publishing House of Electronics Industry, former Huawei interviewer, is now the technical director of Dachang, Google developer community invited lecturer.

You are also welcome to pay attention to my public number will share large front end, JAVA related technology.