안드로이드

Android adb 사용

SourceTree 2021. 11. 14. 22:41
반응형

1. 윈도우 adb.exe 환경변수 등록

1. Window키+R
2. "sysdm.cpl ,3" 입력 후 엔터
3. 시스템 변수의 Path에 adb.exe 위치 추가
4. adb.exe위치 : "C:\Users\사용자계정이름\AppData\Local\Android\Sdk\platform-tools"

2. 맥북 adb.exe 환경변수 등록

1. 히든파일 보이게 설정해야 함(cmd+shift+.)

2. 터미널에서 /users/사용자계정이름/ 들어간 다음
 - ".bash_profile" 파일없으면 생성(touch .bash_profile)
 - ".bash_profile" 파일있으면 수정(open -e .bash_profile)
 
3. /users/사용자계정이름/.bash_profile 파일에 PATH설정

4. 설정내용 : export PATH=${PATH}:/Users/사용자계정이름/Library/Android/sdk/platform-tools

3. adb.exe 명령어

1. APK 설치
  adb install -r "APK파일 경로"

2. APK 제거
  adb unintall 패키지명

3. 안드로이드 액티비티 스택 보기
   adb shell dumpsys activity
   
4. 안드로이드 액티비티 스택 간략히 보기
   adb shell dumpsys activity activities
   adb shell dumpsys activity activities | grep -i run (기타정보 다 빼고 간략히)
   
5. 장치 모델명 확인
  adb shell getprop ro.product.model

6. 화면 해상도 확인
  adb shell dupsys window | grep DisplayWidth

7. App data 삭제
   adb shell pm clear 패키지명

8. Screenshot 저장
   adb shell /system/bin/screencap -p 장치내경로

9. 장치 검색
   adb devices

10. 장치 재부팅
   adb reboot 

11. adb 종료
   adb kill-sever

12. adb 실행
   adb start-server
반응형