본문 바로가기
[IT]

adb 명령어

by DDBobD 2022. 4. 12.
728x90
반응형
  • 디바이스 검색

adb devices

 

  • adb shell
#한대만 연결되어 있을 때
adb shell

#여러대가 연결되어 있을 때
adb -s DEVICE shell

 

 

  • 앱 실행
adb shell am start -n APP_PACKAGE/APP_ACTIVITY

 

  • 앱 종료
adb shell am force-sotp APP_PACKAGE

 

  • 스크린샷(약 1초정도 딜레이가 필요할 수 있음)
#스크린샷
adb shell screencap -p /sdcard/NAME.png

#다운로드
adb pull /sdcard/NAME.png PATH\NAME.png

#삭제
adb shell rm /sdcard/NAME.png

 

  • input
#Tap
adb shell input touchscreen tap X Y

#Swipe
adb shell input touchscreen swipe X1 Y1 X2 Y2

adb shell input touchscreen motionevent DOWN X1 Y1
adb shell input touchscreen motionevent MOVE X2 Y2
adb shell input touchscreen motionevent UP X2 Y2

#Keyevent
#https://developer.android.com/reference/android/view/KeyEvent.html?hl=ko
adb shell input keyevent KEYCODE

#화면 on
adb shell input keyevent KEYCODE_WAKEUP

#화면 off
adb shell input keyevent KEYCODE_POWER

#unlock fingerprint
adb shell input keyevent KEYCODE_WAKEUP
adb shell input touchscreen swipe X1 Y1 X2 Y2

#text
adb shell input text TEXT

 

  • AppPackage, AppActivity 확인
adb shell window | find "mCurrentFocus"
728x90
반응형