In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "AOSP source code download and how to solve the problem". In daily operation, I believe many people have doubts about AOSP source code download and how to solve the problem. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "AOSP source code download and how to solve the problem". Next, please follow the editor to study!
I. explanation
Due to some reasons, using Google's resources to download Android source code is very slow, we can use the resources inside Tsinghua Source to download.
Second, source code download example
As the configuration download method is very clear in Tsinghua Source, here are only a few summaries:
1. Google Mirror is not available, use Tsinghua Source Mirror
Https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/
two。 Configure repo
Mkdir ~ / binPATH=~/bin:$PATHcurl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~ / bin/repochmod axix ~ / bin/repo
Note: repo is best added to the system's environment variables.
3. Repo update
During the operation of repo, you will try to access the official git source to update yourself. If you want to update yourself with tuna's mirror source, you can copy the following content to your ~ / .bashrc.
Export REPO_URL=' https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
And restart the terminal emulator.
4. Download initialization package
Wget-c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar
5. Decompress the resource package
Tar xf aosp-latest.tar
6. Update the specified version
For example, specify to download android-6.0.1_r62 and execute the following command:
Repo init-u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest-b android-6.0.1_r62repo sync
If you encounter an error such as "SyntaxError: invalid syntax", it is as follows:
File "/ home/jerry/workspace/aosp/.repo/repo/main.py", line 79 file=sys.stderr) ^ SyntaxError: invalid syntax
It should be caused by python syntax, and the solution is as follows:
Python3 ~ / bin/repo init-u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest-b android-6.0.1_r62python3 ~ / bin/repo sync
7. Shortcut script
Due to network and restrictions on network concurrency and other reasons, repo sync often fails to update. You can update it with script. Script example:
Repo sync-j4 while [$? = 1]; do echo "= sync failed, re-sync again =" sleep 3 repo sync-j4 done 3, pay attention
1. Encountered the problem of synchronization failure
For example, if the app synchronization of OMA-DM fails, we can modify .repo / manifests/default.xml in the AOSP directory to block the synchronization of this application, as shown below:
two。 Encountered a python syntax problem
Execute the repo command according to the actual situation according to the following syntax, and note that the repo should write the absolute path, otherwise an error will be reported.
Python3 ~ / bin/repo init-u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest-b android-6.0.1_r62python3 ~ / bin/repo sync so far, the study of "download AOSP source code and how to solve the problem" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.