[Android/Kotlin] 안드로이드 스튜디오 adb 연결 / adb: more than one device/emulator 에러

SoyoungLee·2024년 4월 2일
0

안드로이드/코틀린

목록 보기
68/68
post-thumbnail

💌 [Android/Kotlin] Android Studio adb 연결

안드로이드 스튜디오 (Android Studio Giraffe | 2022.3.1 Patch 1), 맥북 M1 사용 환경에서
Android 버전 9 (API level 28) 디바이스에 앱을 Run/Debug 해주려고 했으나,
USB 연결이 안되고 안드로이드 스튜디오 Wifi 무선 디버깅도 안드로이드 11 이상 부터 지원이 가능하였다.

터미널을 이용하여 adb 연결을 해주자.

📌 adb 경로 확인

안드로이드 스튜디오를 설치하면 기본으로 adb 가 내장되어 있다.
경로는 아래와 같다.

/Users/사용자명/Library/Android/sdk/platform-tools/

🤦🏻‍♀️ 맥북에서 adb 명령어를 실행하면 source .bash_profile 이 실행되지 않았을 때 다음과 같은 에러가 난다.

zsh: command not found: adb

📌 source .bash_profile 실행

source .bash_profile

📌 adb 경로로 이동

cd /Users/사용자명/Library/Android/sdk/platform-tools/   

📌 adb 연결

PC와 디바이스가 동일한 네트워크 사용해야 함.

adb connect ip주소

📌 연결된 adb 디바이스 확인

adb devices 

📌 adb shell

adb shell

🚨 adb: more than one device/emulator

위와 같이 adb를 연결해주고 디버깅을 했는데 "adb: more than one device/emulator" 가 무제한으로 뜨고 화면이 멈춰있었다.

🩵 해결 방법

  • USB 연결된 디바이스가 2개가 되어서 발생한 에러였다.
    다음과 같이 클리어 시켜준 뒤 터미널에서 재실행 시켜준다 !!
1. adb devices
2. adb -s 디바이스이름 shell
3. adb -s 디바이스이름 shell am clear-debug-app
4. adb -s 디바이스이름 shell

profile
Android Developer..+ iOS 슬쩍 🌱 ✏️끄적끄적,,개인 기록용 👩🏻‍💻

0개의 댓글