상세 컨텐츠

본문 제목

android adb command 로 fastboot mode 로 부팅하기, fastboot mode booting thru adb command

IT : SmartPhone

by 휀스 2015. 10. 9. 00:30

본문


android adb command 로 fastboot mode 로 부팅하기, fastboot mode booting thru adb command


android 개발을 하다보면 특정 키를 눌러 fastboot mode 로 부팅하거나 recovery mode 로 부팅을 해야하는 경우가 많습니다. 하지만 초기 개발보드일경우 키를 누르기도 쉽지 않을때가 많고 귀찮기도 합니다. 이럴 때 adb command 를 통해 간단히 fastboot mode 나 recovery mode 로 들어갈 수 있습니다.





이 방법은 adb help 에 나와있지 않은 내용이기도 합니다. (안드로이드를 본지 몇년인데 오늘 처음 알았네요. ^^)


command line 에 adb 명령을 실행하면 아래와 같은 help 내용을 볼 수 있습니다.


scripting:

  adb wait-for-device          - block until device is online

  adb start-server             - ensure that there is a server running

  adb kill-server              - kill the server if it is running

  adb get-state                - prints: offline | bootloader | device

  adb get-serialno             - prints: <serial-number>

  adb get-devpath              - prints: <device-path>

  adb status-window            - continuously print device status for a specified device

  adb remount                  - remounts the /system partition on the device read-write

  adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program

  adb reboot-bootloader        - reboots the device into the bootloader

  adb root                     - restarts the adbd daemon with root permissions

  adb usb                      - restarts the adbd daemon listening on USB

  adb tcpip <port>             - restarts the adbd daemon listening on TCP on the specified port


이중 adb reboot 부분을 보면 bootloader 나 recovery mode 로 부팅할 수 있는 옵션을 제공해 주고 있습니다. 그래서 혹시나 하는 마음에 


$ adb reboot fastboot


이라는 명령을 실행시켜 보았습니다. 결과는 성공!!!!!

힘들게 손으로 키를 누르며 부팅을 하지 않아도 간단히 adb 명령으로 바로 fastboot 모드로 진입합니다.

이 상태에서 binary download 를 받고 다시 fastboot 명령으로 reboot 시키면 다운로드 받은 바이너리로 부팅하게 됩니다.


$ fastboot reboot



 


이 두가지 명령으로 많은 보드가 있을 경우 하나씩 손으로 fastboot 모드로 진입시켜 다운로드 받지 않고 명령어로 보드를 다운로드 받을 수 있게 되었습니다.



각 보드를 컨트롤 하는 방법은 adb devices 명령으로 board id 를 알아낸 후


$ adb devices

List of devices attached

0123456789ABCDEF device


아래 명령으로 해당 보드를 fastmode 로 진입 시킬 수 있습니다.


adb -s 0123456789ABCDE reboot fastboot


그리고 fastboot devices 명령으로 동일하게 device id 를 알아낸 후


fastboot -s deviceID 명령어


형식으로 해당 보드에 특정 바이너리를 다운로드 받을 수 있습니다.

이것을 자동화 하려면 adb devices 명령의 결과와 fastboot devices 명령의 결과를 잘 parsing 해서 사용해야겠죠?

다음엔 parsing 방법을 알아보도록 해야겠네요.


이상 android adb command 로 fastboot mode 로 부팅하기, fastboot mode booting thru adb command에 대한 글 이였습니다.




관련글 더보기