728x90
728x90
ADB(Android Debug Bridge) 명령어 정리
들어가며
- ADB(Android Debug Bridge) 명령어를 정리해본다.

명령어 사용 전 주의 사항
- 안드로이드 기기의
[설정]
에서[개발자 도구]
를 활성화 시킨 후,USB 디버깅
을 활성화 해줘야 한다. - PC에 Android SDK Platform-Tools를 설치해야 한다.
- 안드로이드 스튜디오(Android Studio)를 설치할 경우, 함께 설치된다.
SDK 플랫폼 도구 출시 노트 | Android Studio | Android Developers
Android SDK 플랫폼 도구는 Android SDK의 구성요소입니다.
developer.android.com
명령어
기본 명령어
명령어 | 설명 |
adb devices |
연결된 안드로이드 기기 목록 표시 |
adb version |
ADB 버전 확인 |
adb kill-server |
ADB 서버 종료 |
adb start-server |
ADB 서버 시작 |
기기 연결
명령어 | 설명 |
adb connect <ip_address>:<port> |
네트워크를 통해 안드로이드 기기 연결 |
adb disconnect |
모든 네트워크 연결 해제 |
adb disconnect <ip_address>:<port> |
특정 네트워크 연결 해제 |
파일 관리
명령어 | 설명 |
adb push <local> <remote> |
로컬 파일을 안드로이드 기기로 전송 |
adb pull <remote> <local> |
안드로이드 기기에서 로컬로 파일 복사 |
앱 관리
명령어 | 설명 |
adb install <apk_file> |
APK 파일 설치 |
adb install -r <apk_file> |
APK 파일 재설치 (기존 앱 데이터 유지) |
adb uninstall <package_name |
앱 삭제 |
adb shell pm list packages |
설치된 모든 패키지 목록 표시 |
adb shell pm path <package_name> |
패키지의 APK 파일 경로 확인 |
디버깅 및 로그 확인
명령어 | 설명 |
adb logcat |
실시간 로그 확인 |
adb logcat > log.txt |
로그를 파일로 저장 |
adb shell dumpsys <service> |
특정 서비스 상태 정보 확인 |
adb bugreport > bugreport.zip |
기기 버그 리포트 생성 |
셸 명령어
명령어 | 설명 |
adb shell |
기기의 셸에 접속 |
adb shell <command> |
기기에서 명령어 실행 |
adb shell ls |
현재 디렉토리의 파일 목록 표시 |
adb shell top |
실행 중인 프로세스 목록 표시 |
스크린샷 및 화면 녹화
명령어 | 설명 |
adb shell screencap /sdcard/screen.png |
스크린샷 캡처 |
adb pull /sdcard/screen.png |
캡처한 스크린샷을 로컬로 복사 |
adb shell screenrecord /sdcard/record.mp4 |
화면 녹화 시작 |
adb pull /sdcard/record.mp4 |
녹화한 영상을 로컬로 복사 |
기기 재부팅 및 부트로더
명령어 | 설명 |
adb reboot |
기기 재부팅 |
adb reboot bootloader |
부트로더 모드로 재부팅 |
adb reboot recovery |
복구 모드로 재부팅 |
포트 포워딩
명령어 | 설명 |
adb forward tcp:<local_port> tcp:<device_port> |
로컬과 기기 간의 포트 연결 |
adb reverse tcp:<device_port> tcp:<local_port> |
기기에서 로컬로 포트 연결 |
기타 명령어
명령어 | 설명 |
adb shell am start -n <package_name>/<activity_name> |
특정 액티비티 실행 |
adb shell input keyevent <keycode> |
키 입력 시뮬레이션 |
adb shell input text "<text>" |
텍스트 입력 시뮬레이션 |
참고 사이트
Adb useful commands list
Adb useful commands list. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
adb (Android Debug Bridge) cheatsheet
The one-page guide to adb (Android Debug Bridge): usage, examples, links, snippets, and more.
devhints.io
ADB Commands | HackTricks
Last updated 4 months ago
book.hacktricks.xyz
728x90
728x90
'Programming > Android' 카테고리의 다른 글
[Android] VS Code에서 명령어로 안드로이드 에뮬레이터 실행 방법 (0) | 2024.12.02 |
---|---|
[Android] adb 명령어 실행 방법 (adb: command not found 문제 해결법) (2) | 2024.12.02 |
[Android] ADB(Android Debug Bridge)를 이용하여 컴퓨터와 안드로이드 장치 연결하기 (0) | 2023.06.18 |