맥에서 hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 60g -volname "Android" -attach ~/Android
위의 명령을 통해서 새로운 volume을 만들고
To install Repo:
Make sure you have a bin/ directory in your home directory and that it is included in your path:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
Download the Repo tool and ensure that it is executable:
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
Run repo init
to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.
$ repo init -u https://android.googlesource.com/platform/manifest
To check out a branch other than "master", specify it with -b:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
에서 원하는 안드로이드 버전은 http://source.android.com/source/build-numbers.html 여기서 확인 가능하다.
4.3 버전이 필요해서 repo init을 다음과 같이 수정함
repo init -u https://android.googlesource.com/platform/manifest -b android-4.3.1_r1
$ repo sync
디바이스에 포팅하기 위해서는 안드로이드 소스뿐만 아니라 하드웨어적인 내용도 필요하다.
그래서 다음 링크에서 필요한 바이너를 다운 받은 후 .sh파일을 실행시키면 ./vendor 폴더가 만들어지게 된다.
https://developers.google.com/android/nexus/drivers
$ source build/envsetup.sh
$ lunch aosp_arm-eng
or
$ lunch
lunch 명령 후 원하는 타켓을 선택하면 된다.
$ make -j4
디바이스에 포팅 하기 위해서
$ make fastboot adb
fastboot 명렁어가 되는지를 확인 후 디바이스를 fastboot모드로 부팅 시킨다.
Booting into fastboot mode
Device | Keys |
---|
hammerhead | Press and hold both Volume Up and Volume Down, then press and hold Power |
flo | Press and hold Volume Down, then press and hold Power |
deb | Press and hold Volume Down, then press and hold Power |
manta | Press and hold both Volume Up and Volume Down, then press and hold Power |
mako | Press and hold Volume Down, then press and hold Power |
grouper | Press and hold Volume Down, then press and hold Power |
tilapia | Press and hold Volume Down, then press and hold Power |
phantasm | Power the device, cover it with one hand after the LEDs light up and until they turn red |
maguro | Press and hold both Volume Up and Volume Down, then press and hold Power |
toro | Press and hold both Volume Up and Volume Down, then press and hold Power |
toroplus | Press and hold both Volume Up and Volume Down, then press and hold Power |
panda | Press and hold Input, then press Power |
wingray | Press and hold Volume Down, then press and hold Power |
crespo | Press and hold Volume Up, then press and hold Power |
crespo4g | Press and hold Volume Up, then press and hold Power |
$ fastboot oem unlock
oem unlock을 시켜야함
Flashing a device
Set the device in fastboot mode if necessary (see above).
An entire Android system can be flashed in a single command: this writes the boot, recovery and system partitions together after verifying that the system being flashed is compatible with the installed bootloader and radio, and reboots the system. This also erases all the user data, similarly to fastboot oem unlock
mentioned earlier.
$ fastboot -w flashall
Note that filesystems created via fastboot on Motorola Xoom aren't working optimally, and it is strongly recommended to re-create them through recovery
$ adb reboot recovery
Once in recovery, open the menu (press Power + Volume Up), wipe the cache partition, then wipe data.
Cleaning up when adding proprietary binaries
In order to make sure that the newly installed binaries are properly taken into account after being extracted, the existing output of any previous build needs to be deleted with
$ make clobber
참고
1. http://androidhuman.tistory.com/entry/Mac-OS-X-107-Lion-%EC%97%90%EC%84%9C-%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C-%EB%B9%8C%EB%93%9C%ED%99%98%EA%B2%BD-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0
2. http://yjaeseok.tistory.com/296
3. http://source.android.com/source/building-devices.html