[Android] adb & fastboot 관련 명령 정리

자주 쓰는 명령 몇 개만 정리하자.

adb shell [명령] : shell 또는 명령 실행(‘cat /proc/kmsg’ 라던가..)
adb reboot :  reboot
adb reboot [bootloader | recovery] : reboot & [fastboot | recovery]모드 들어가기
adb logcat [TAG:LEVEL] [*:S] : logcat, 특정 TAG를 LEVEL(S,V,I,D,…)로 보기, *:S 넣으면 나머지는 Silent.
adb root : root 로 adbd 재실행
adb remount : system 파티션을 rw로 remount
adb push, pull : 파일 넣기, 빼오기, read/write 시스템 콜 이용으로도 사용 가능.
adb wait-for-devices [명령] : adb 연결 기다렸다 명령 실행
adb devices : 붙었나?
adb sideload <파일이름.zip> : OTA패키지인 파일이름.zip 을 adb 를 통해 업데이트. JB부터 추가

fastboot flash <파티션 이름> <파일명> : 파티션 이름에는 bootloader, boot, zimage, ramdisk, system, userdata, cache, recovery 등이 올 수 있다.
fastboot wait-for-devices : 윈도우즈는 그냥 명령 주면 대기하므로 필요없다. 리눅스용에서 사용.
fastboot [-w] flashall : 윈도우즈에서는 “set ANDROID_PRODUCT_OUT=D:\out\target\product\crespo” 해두고 하면 된다. -w 옵션주면 userdata 등 파티션 날리고 모두 flash
fastboot [-w] update <zip 파일이름> : update용 zip 파일(make updatepackage로 생성)로 업데이트, 역시 -w 옵션 주면 나머지 날림.
fastboot reboot-bootloader : fastboot 모드로 reboot
fastboot reboot : reboot.
fastboot getvar <Variable> : Variable 을 얻어옴. 전체는 all(“fastboot getvar all”)
fastboot devices : 붙었나?