Design-loving front-end engineer
Ryong
Design-loving front-end engineer
전체 방문자
오늘
어제
    • Framework
    • React
      • Concept
      • Library
      • Hook
      • Component
      • Test
    • NodeJS
    • Android
      • Concept
      • Code
      • Sunflower
      • Etc
    • Flutter
      • Concept
      • Package
    • Web
    • Web
    • CSS
    • Language
    • JavaScript
    • TypeScript
    • Kotlin
    • Dart
    • Algorithm
    • Data Structure
    • Programmers
    • Management
    • Git
    • Editor
    • VSCode
    • Knowledge
    • Voice
Design-loving front-end engineer

Ryong

Android/Etc

adb 명령어

2021. 11. 24. 10:06

안드로이드 adb 명령어 Official

https://developer.android.com/studio/command-line/adb?hl=ko#screencap 

 

Android 디버그 브리지(adb)  |  Android 개발자  |  Android Developers

기기와 통신할 수 있는 다목적 명령줄 도구인 Android 디버그 브리지를 알아보세요.

developer.android.com

 

시스템

💬  사용자 PC에 연결된 안드로이드 디바이스를 확인

adb devices

 

💬  안드로이드 디바이스 재시작

adb reboot

 

💬  특정 디바이스에 명령어 실행 | SERIAL_NUMBER는 adb devices의 가장 왼쪽 부분을 보면 알 수 있다.

adb -s [SERIAL_NUMBER] [COMMAND]

 

 

파일 관리

💬  현재 폴더에 있는 [FILENAME].apk 파일을 안드로이드 장비에 다운로드

adb install [FILE_NAME].apk
adb install -r [FILE_NAME].apk  // 재설치
adb install -s [FILE_NAME].apk  // 메모리 카드에 설치
# ex) adb install -r test.apk

 

 

💬  해당 패키지 이름을 갖는 apk 파일 삭제

 adb uninstall [PACKAGE_NAME]
 # ex) adb uninstall com.test.package

 

 

💬  윈도우에 있는 파일을 디바이스로 복사하여 이동

# 편의상 이동할 파일이 있는 폴더로 이동 후,
adb push [FILE_NAME] [DEST_LOCATION]
# ex) adb push android.jpg /sdcard

 

 

기능

💬  디바이스에서 스크린샷 후 윈도우에 옮기고, 디바이스에 있는 파일은 삭제 메커니즘

# 디바이스 내 /sdcard/screen.png 경로에 스크린샷
adb shell screencap /sdcard/screen.png 
# 윈도우 현재 위치로 /sdcard/screen.png 파일을 가져오기
adb pull /sdcard/screen.png
# 디바이스에 있는 파일 삭제
adb shell rm /sdcard/screen.png

 

 

💬  디바이스에서 동영상 캡쳐 후 윈도우에 옮기고, 디바이스에 있는 파일은 삭제 메커니즘

# 디바이스의 /sdcard/screen.mp4에 동영상 캡쳐
adb shell screenrecord /sdcard/screen.mp4
# 윈도우 현재 위치로 /sdcard/screen.png 파일을 가져오기
adb pull /sdcard/screen.mp4
# 디바이스에 있는 파일 삭제
adb shell rm /sdcard/screen.mp4

 

 

💬  안드로이드 디바이스에 포커스 되어 있는 EditText에 "TEXT" 입력

adb shell input text "TEXT"

 

 

상태 확인

💬  안드로이드 버전 확인

adb shell getprop ro.build.version.release

 

💬  로그 출력

# 모든 로그 출력
adb logcat

# 특정 로그 출력
adb logcat *:char

# char list
# - V : Verbose
# - D : Debug
# - I : Info
# - W : Warning
# - E : Error
# - F : Fatal
# - S - Silent
# ex) adb logcat *:E

 

💬  커널 버전 확인

adb shell cat /proc/version

 

💬  프로세서 정보

adb shell cat /proc/cpuinfo

 

💬  실제 메모리 및 가상 메모리 확인

adb shell cat /proc/meminfo

 

💬  커널에 등록된 파일 시스템 목록

adb shell cat /proc/filesystems

 

💬  시스템 가동 시간

adb shell cat /proc/uptime

 

💬  시스템 상태 정보

adb shell cat /proc/stat

 

💬  시스템 리소스 모니터

adb shell vmstat

 

💬  시스템 프로세스 상황 모니터링

adb shell top

 

 

패키지 관리

💬  설치된 패키지 출력

adb shell pm list package

 

💬  설치된 패키지 데이터 삭제

adb shell pm celar [PACKAGE_NAME]
# ex) adb shell pm clear com.test.package

 

💬  특정 패키지 비활성화

adb shell pm disable [PACKAGE_NAME]                # 구버전 ADB
adb shell pm hide [PACKAGE_NAME]                   # 신버전 ADB
adb shell pm uninstall -k --user 0 [PACKAGE_NAME]  # 권한 문제 있을 경우

 

💬  특정 패키지 활성화

adb shell pm enable [PACKAGE_NAME]  # 구버전 ADB
adb shell pm unhide [PACKAGE_NAME]  # 신버전 ADB

 

💬  특정 패키지 강제 종료

adb shell am force-stop [PACKAGE_NAME]

 

저작자표시 (새창열림)

'Android > Etc' 카테고리의 다른 글

[ Android ] [ Kotlin ] 초기 설정  (0) 2021.12.15
    'Android/Etc' 카테고리의 다른 글
    • [ Android ] [ Kotlin ] 초기 설정
    Design-loving front-end engineer
    Design-loving front-end engineer
    디자인에 관심이 많은 모바일 앱 엔지니어 Ryong입니다.

    티스토리툴바