Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:edge2:development:android:download-android-source-code

This is an old revision of the document!


Edge2 Download Android Source Code

Introduction

This document mainly introduces how to download the Android source code of Edge2.

Get Source Code

1. Create an empty directory to hold your working files:

$ mkdir -p WORKING_DIRECTORY
$ cd WORKING_DIRECTORY

2. Run repo init to download the manifest repository first:

  • Android 12.0:
    $ repo init -u https://github.com/khadas/android_manifest.git -b khadas-edge2-android12

3. Run repo sync to pull down the Android Source Tree:

$ repo sync -j4

The initial sync operation may take an hour or more to complete.

You might need to run above command repeatly if it fails halfway. Or you can try with this script instead:

sync_helper.sh
#!/bin/bash
repo sync -j4
while [ $? = 1 ]; do
	echo "Sync failed, repeat again:"
	repo sync -j4
done

If needed, press Ctrl+C to quit.

4. Based on different unbutu versions, the following operations may be required to pull large files(Otherwise, the corresponding file is small and incorrect). You need to go to the following three directories and use the 'git lfs pull' command to pull large files, otherwise an [error](https://forum.khadas.com/t/cannot-build-an-android/15886) will be reported during compilation:

external/camera_engine_rkaiq
prebuilts/module_sdk
system/core
device/khadas/rk3588
xxx@server:/users/edge2$ cd external/camera_engine_rkaiq
xxx@server:/users/edge2/external/camera_engine_rkaiq$ git lfs pull
Git LFS: (6 of 6 files) 239.31 MB / 239.31 MB                                                                                                                                                                                         
xxx@server:/users/edge2/external/camera_engine_rkaiq$ cd -
/users/edge2
xxx@server:/users/vim4$ cd prebuilts/module_sdk/
xxx@server:/users/vim4/prebuilts/module_sdk$ 
xxx@server:/users/vim4/prebuilts/module_sdk$ git lfs pull
Git LFS: (2 of 2 files) 231.89 MB / 231.89 MB
。。。...

5. Begin a new branch for development:

$ repo start <BRANCH_NAME> --all

See Also

Last modified: 2022/09/07 09:04 by goenjoy