카테고리

asm (27) bootloader_x86_grub (1) C (92) compile (11) config (76) CPP (13) CSS (1) debugging (7) gimp (1) Go (1) html (1) Java (1) JavaScript (1) kernel (19) LibreOffice (3) Linux system progamming (21) MFC (1) opencv (4) OpenGL (1) PHP (1) Python (4) qemu (29) shell (3) socket (7) troubleshooting (2) ubuntu18.04 (2) windows (1)

2019/01/02

안드로이드 8.1, guest on Ubuntu 17.10 호스트 환경 GDB 에물레이터

안드로이드 8.1, guest on Ubuntu 17.10 호스트 환경

소스코드 다운로드 및 안드로이드 환경 구성
curl https://storage.googleapis.com/git-repo-downloads/repo >repo
chmod a+x repo
vi repo
#!/usr/bin/env python2.7
:wq

정보 추가 선택 사항 임.
git config --global user.email "linuxleejang@gmail.com"
git config --global user.name "JangHo"

하디드스크 용량 100G 정도 여유 공간 확보.
./repo init -b android-8.1.0_r1 --depth 1 -u https://android.googlesource.com/platform/manifest
./repo sync -c  -j $(($(nproc) - 2)) --no-tags --no-clone-bundle

설치
. build/envsetup.sh
lunch aosp_x86_64-eng
USE_CCACHE=1 CCACHE_DIR=ccache make -j $(($(nproc) - 2))

에물레이터 실행
emulator -show-kernel

1분에서 2분 정도 기달림.

안드로이드가 다 부팅 된후 터미널 콘솔에다가 엔터키를 입력 하면 쉘 모드로 진입

참고
./repo init -b 태그 지정. master -release는 버전 변경이 항상 있음.

태크 목록 사이트
https://android.googlesource.com/platform/manifest

두 가지 트리
개발 코드 삭제. Google 및 OEM 개발자의 공개된 마스트로 문제가 해결된 버전.
마스터 빌드 오류는 더이상 지원이 없음. 공개된 버전은 문제가 없으므로, 오류 관련은 빌드 사용자가 기존 해결 내용을 참고 해야 함.

repo sync 호환성 보장 없음.

--depth 1 옵션과 sync -c --no-tags --no-clone-bundle 동기화 처리 옵션은 복제를 빠르게 하지만, 복제의 성공률이 문제가 있을 수 있음.

저장소 동기화 시간 문제
https://stackoverflow.com/questions/28379870/aosp-repo-sync-takes-too-long

호스트 환경 옵션
lunch aosp_x86_64-eng 호스트 환경이 X86
lunch aosp_arm-eng 암 버전 구축

안드로이 에물레이터 응답 대기 및 실패.
https://stackoverflow.com/questions/43779596/process-system-isnt-responding-in-android-emulator
메모리 확장 및 해상도 낮춰서 해결
config
ORIGINAL: disk.dataPartition.size=512M
MODIFIED: disk.dataPartition.size=512MB
ORIGINAL: hw.ramSize=1024
MODIFIED: hw.ramSize=1024MB

-show-kernel 옵션은 터미널과 연결해, 부팅 메시지를 확인할 수 있다. 이 메세지로 디버깅 정보를 확인 할 수 있음.

type emulato emulator 별칭 설정
명시 적으로 ROM을 선택하기 위해 몇 가지 인수 전달하는 방법을 알고 있어야 함.
emulator -help
emulator -help-build-images
emulator -help-disk-images

Android 에뮬레이터에서 맞춤 ROM 실행
https://stackoverflow.com/questions/25985384/run-custom-rom-on-android-emulator

GDB 디버깅 방법
먼저 GDB 명령을 실행 ./rungdb 하여 전체 명령 활성화 : 명령을 실행 하기 전에 명령을 표준 출력으로 출력합니다

findAOSP 빌드 디렉토리 내부에서 명령에 필요한 파일확인.
emulator명령 QEMU에 매개 변수를 전달하는 플래그가 있음.

댓글 없음:

댓글 쓰기