In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to get rid of the host environment restrictions to compile Android source code at will, the content is concise and easy to understand, absolutely can make your eyes bright, through the detailed introduction of this article, I hope you can get something.
Use docker to compile aosp source code
The official Android compiler source code recommended by google is 14.04. because the current working environment is macosx environment or a high version of ubuntu environment, there will be many problems in compiling directly on the local machine, but this worry can be solved with the help of docker, a powerful tool.
Install docker
Google can search for installation method.
Docker replaces domestic mirror sources
To speed up the pull of docker images, you can set a domestic image source, such as NetEase's image source, as follows:
Create / etc/docker directory
Sudo mkdir-p / etc/docker
Create a daemon.json file in the / etc/docker directory and write the following
{"registry-mirrors": ["http://hub-mirror.c.163.com"]}"
Restart the docker service
Sudo systemctl daemon-reloadsudo systemctl restart docker creates a compiled image
Since the aosp source code is recommended to be compiled on ubuntu 14.04, we create an image based on 14.04. You are going to use the 5.1.1 source code here, so you need to install jdk7.
For more information on building an image, please see Dockerfile.
Create a mirror using the following command
Docker build-t aosp-build:1.0.0.
View the images created successfully
Use image to compile source code
Download aosp source code it is recommended to go to Tsinghua Mirror Station to download the packaged source code, or you can use repo to download the specified version. For more information, please see the website documentation.
Suppose the download path of aosp source code is / home/user/aosp, create a container using aosp-build image, and mount the path of aosp source code
Docker run-itd-- name aosp-build-v / home/user/aosp:/home/aosp aosp-build:1.0.0docker exec-it aosp-build / bin/bash
Go to the / home/rom directory and compile the source code directly
. Build/envsetup.shlunchmake-J8 the above content is how to get rid of the host environment restrictions to compile Android source code at will, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.