Android Debug Bridge(adb) 주요 사용법 정리

 

연결

장치 목록 보기

연결을 위해 현재 장치 목록 보기

$ adb devices
 
List of devices attached
emulator-5554  device
emulator-5556  device
emulator-5558  device

 

Direct command

-s 옵션으로 장치에 바로 명령 전송. 

 

Debug

logcat

Prints log data to the screen.

adb -s emulator-5554 logcat 

bugreport

Prints dumpsys, dumpstate, and logcat data to the screen, for the purposes of bug reporting.

 

Data

Ref

install <path-to-apk>

Pushes an Android application (specified as a full path to an .apk file) to an emulator/device.

adb -s emulator-5554 install <path-to-apk>

 

pull <remote> <local>

Copies a specified file from an emulator/device instance to your development computer.

adb -s emulator-5554 pull <path-to-apk>

파일 가져오기 예제

adb -s emulator-5554 pull /data/user/0/com.sgitest.apps.sgitestandroidapp/files/reg-deligate1.sig.sig.sig .


push <local> <remote>

Copies a specified file from your development computer to an emulator/device instance.

adb -s emulator-5554 push a.pdf /sdcard

 

* 이 안 먹으므로 개별 파일을 적어주어야 함.

adb -s emulator-5554 push abcd.sig /data/user/0/com.sgitest.apps.sgitestandroidapp/files
adb -s emulator-5554 push user-cert.der /data/user/0/com.certipro.pkixutilstest.test/files

 

Shell

a

shell

Starts a remote shell in the target emulator/device instance. See ADB Shell Commands for more information.

adb -s emulator-5554 shell 

 

shell [shellCommand]

Issues a shell command in the target emulator/device instance and then exits the remote shell.

adb -s emulator-5554 shell ls /data/user/0/com.sgitest.apps.sgitestandroidapp/files