본문 바로가기

Android

adb 명령어 주로 사용하는 adb 명령어 정리 매번 검색해서 보곤 또 까먹어서 찾으로 다녀서 이곳에 정리 adb devices 연결된 장비의 이름과 상태를 알려준다. $ adb devicesList of devices attached[device_name1] device[device_name2] connecting 한번에 2개 이상의 장비를 연결한 경우 adb 뒤에 -s (select)옵션으로 adb 명령어를 날릴 수 있다. $ adb -s [device_name1] shell root@어쩌구저쩌구 : / # 가 나오지만 $ adb -s [device_name2] shell하면 안나옵니다. -wait for device- 이런거 떳던기억이... 상태가 connecting 이기 때문입니다. 이경우 장비를 reboot하.. 더보기
안드로이드 드래그? 이벤트 (adb shell input swipe) adb shell input swipe 500 500 100 1000 100 command: adb shell input swipe xSource, ySource, xDestination, yDestination, Duration ex) adb shell input swipe 500 500 100 1000 100-> (500, 500) 좌표에서 (100,1000)로 100ms동안 터치를 해서 움직인다. 응용 :Source x,y 와 Destination x,y를 같게 설정하고 Duration만 길게하면 길게터치 (Long Press)가 된다. 더보기
안드로이드 터치 이벤트 (adb shell input tap) adb shell input tap 500 500 Command: adb shell input tap xPosition YPosition (xPosition, yPosition은 tap하고자 하는 위치를 의미) 설명: xPosition, yPosition 위치에 짧게 터치. xPosition, yPosition을 쉽게 찾는 방법은 Developer Options에서 “Show Pointer Location”을 On 하면 단말 화면 위에 터치하는 부분의 X, Y Position 값을 확인 할 수 있다. 더보기
안드로이드 키 이벤트 (adb shell input keyevent) 가장 많이 쓰는 거 Home키- adb shell input KEYCODE_HOME- adb shell input keyevent 3 Back키-adb shell input KEYCODE_BACK-adb shell input keyevent 4 Option키-adb shell input KEYCODE_MENU-adb shell input keyevent 1 usage: input [text|keyevent] input text input keyevent 0 --> "KEYCODE_UNKNOWN" 1 --> "KEYCODE_MENU" 2 --> "KEYCODE_SOFT_RIGHT" 3 --> "KEYCODE_HOME" 4 --> "KEYCODE_BACK" 5 --> "KEYCODE_CALL" 6 --> ".. 더보기