Recently, Android 13 has been added to the Android Open Source Project (AOSP).
AOSP consists of many git projects, and the repo tool makes it easy to download many git projects.
First, I will introduce how to install the repo tool and download the AOSP codes through repo.
1. Install REPO
Repo is a tool implemented as a script. All you have to do is download it. First, create a ~/bin folder and register it in the PATH.
$ mkdir ~/bin
$ PATH=~/bin:$PATH
Download the repo tool using the curl command to the ~/bin folder. And give execution permission to the repo.
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
2. Download Android 13 sources
Before using Repo to get the Android open source, create a folder first. Create it in an appropriate place and move into the folder you created.
$ mkdir android13
$ cd android13
And because Repo uses git, you must install git. Once you have installed git, you must register your basic settings, such as your user name and user email. Please enter your name and email.
$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"
Now we are ready to download the AOSP source with the Repo tool.
2.1 Download Android 13 branch
The following command sets up a project for the source of Android 13's android-13.0.0_r11
branch.
$ repo init -u https://android.googlesource.com/platform/manifest -b android-13.0.0_r11
All branch information of AOSP can be found in Source Code Tags and Builds. If there is a newer branch than
android-13.0.0_r11
, you can download it.
When you execute the command, if you see the message repo has been initialized
, it means the setup is complete.
$ repo init -u https://android.googlesource.com/platform/manifest -b android-13.0.0_r11
Downloading Repo source from https://gerrit.googlesource.com/git-repo
... A new version of repo (2.29) is available.
... You should upgrade soon:
cp /home/js/test/android13/.repo/repo/repo /home/js/.bin/repo
Your identity is: farfs <farfs.dev@gmail.com>
If you want to change this, please re-run 'repo init' with --config-name
repo has been initialized in /home/js/test/android13
And, when the repo sync
command is entered, the git projects set up during setup will be downloaded.
$ repo sync
Receiving objects: 100% (6238/6238), 5.32 MiB | 25.67 MiB/s, done.
Resolving deltas: 100% (1584/1584), done.
Receiving objects: 100% (13918/13918), 7.89 MiB | 37.74 MiB/s, done.
Resolving deltas: 100% (4645/4645), done.
Receiving objects: 100% (1493/1493), 1.10 MiB | 43.47 MiB/s, done.
.....
2.2 Make sure Android 13 downloaded
Once repo sync
is complete, you can check the downloaded files as follows.
$ ls
Android.bp bionic bootstrap.bash compatibility dalvik development docs frameworks kernel libnativehelper packages platform_testing sdk test tools
art bootable build cts developers device external hardware libcore Makefile pdk prebuilts system toolchain
3. Build Android 13
First, set up the build-related dependencies in the downloaded project with the following command.
$ source build/envsetup.sh
And then, select the type of device or architecture to build with the following command.
$ lunch
You\'re building on Linux
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
....
Which would you like? [aosp_arm-eng] 6
Once you have finished setting up the device and architecture, you can build the entire project with the following command. The -jN
option sets the number of threads to use when building to N. -j8
builds with 8 threads.
$ m -j8
4. Run Android 13 on Emulator
Once the build is complete, Android images will be generated.
Enter the following command to run the compiled Android image on the emulator.
$ emulator
Related Posts
- How to download and build Android 13, AOSP
- Notification permission request, pop up notification in Android 13
- Resolve `Access blocked: ComponentInfo` error on Android 13
- Fix error "android gradle plugin requires java 11 to run. you are currently using java 1.8."
- Android - Vibration, Vibrator, VibrationEffect example
- How to get phone number in Android
- How to create Bugreports and Logcat with ADB in Android
- Clear application user data with ADB in Android
- How to disable/enable apps with ADB in Android
- How to find PID of a package with adb in Android
- How to grant/revoke permissions with adb in Android
- How to install an apk(app) with adb in Android
- How to kill a process/package from ADB in Android
- How to transfer files using adb push/pull command in Android
- How to capture the screen from adb in Android
- How to uninstall/install system apps from adb in Android
- How to change Settings values from adb in Android
- How to Factory reset with ADB in Android
- How to get logcat from ADB command in Android
- How to capture Heap Dump from app with ADB in Android
- How to force stop an app with adb in Android
- How to start/stop a service from adb in Android
- How to send/broadcast an intent from adb command in Android
- How to start an activity from adb in Android
- How to generate input from adb in Android
- How to check SQLite DB table in Android Studio
- How to get memory info and thread list from adb in Android
- Android - Uri, Scheme and SSP(Scheme Specific Part)
- How to parse a xml file with XmlResourceParser in Android
- Android - Signing an apk with Platfom key
- How to fix "Cleartext HTTP ... not permitted" for Android development
- How to fix "kvm permission denied" for Android Emulator
- Using ADB over Wifi for Android development