USB 호스트 및 액세서리 개요
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Android는 두 가지 모드, 즉 USB 액세서리와 USB 호스트를 통해 다양한 USB 주변기기와 Android USB 액세서리(Android 액세서리 프로토콜을 구현하는 하드웨어)를 지원합니다. USB 액세서리 모드에서 외부 USB 하드웨어는 USB 호스트 역할을 합니다. 액세서리의 예는 다음과 같습니다.
- 로봇 컨트롤러
- 도킹 스테이션
- 진단 및 음악 장비
- 키오스크
- 카드 리더
기타 등등 이렇게 하면 호스트 기능이 없는 Android 지원 기기가 USB 하드웨어와 상호작용할 수 있습니다. Android USB 액세서리는 Android 지원 기기와 호환되도록 설계되어야 하며, Android 액세서리 통신 프로토콜을 준수해야 합니다. USB 호스트 모드에서 Android 지원 기기는 호스트 역할을 합니다. 기기의 예로는 디지털 카메라, 키보드, 마우스, 게임 컨트롤러가 있습니다. 다양한 애플리케이션과 환경을 위해 설계된 USB 기기는 기기와 올바르게 통신할 수 있는 Android 애플리케이션과 계속 상호작용할 수 있습니다.
그림 1은 두 모드의 차이점을 보여줍니다. Android 지원 기기는 호스트 모드일 때 USB 호스트 역할을 하며 버스에 전원을 공급합니다. Android 지원 기기가 USB 액세서리 모드일 때 연결된 USB 하드웨어 (이 경우 Android USB 액세서리)는 호스트 역할을 하고 버스에 전원을 공급합니다.

그림 1. USB 호스트 및 액세서리 모드
USB 액세서리 및 호스트 모드는 Android 3.1 (API 수준 12) 이상의 플랫폼에서 직접 지원됩니다. 또한 USB 액세서리 모드는 다양한 기기를 지원하기 위한 부가기능 라이브러리로 Android 2.3.4(API 수준 10)로 백포팅됩니다.
기기 제조업체는 기기의 시스템 이미지에 부가기능 라이브러리를 포함할지 선택할 수 있습니다.
참고: USB 호스트 및 액세서리 모드 지원은 플랫폼 수준과 관계없이 궁극적으로 기기의 하드웨어에 따라 다릅니다. <uses-feature>
요소를 통해 USB 호스트 및 액세서리를 지원하는 기기를 필터링할 수 있습니다.
자세한 내용은 USB 액세서리 및 호스트 문서를 참고하세요.
디버그 고려사항
USB 액세서리 또는 호스트 기능을 사용하는 애플리케이션을 디버깅할 때는 USB 하드웨어가 Android 지원 기기에 연결되어 있을 가능성이 큽니다. 이렇게 하면 USB를 사용하여 Android 지원 기기에 adb
연결을 할 수 없습니다. 네트워크 연결을 통해 adb
에 계속 액세스할 수 있습니다. 네트워크 연결을 통해 adb
를 사용 설정하는 방법은 다음과 같습니다.
- USB를 사용하여 Android 지원 기기를 컴퓨터에 연결합니다.
- SDK
platform-tools/
디렉터리의 명령 프롬프트에 adb tcpip 5555
을 입력합니다.
adb connect <device-ip-address>:5555
를 입력합니다. 이제 Android 지원 기기에 연결되었으며 adb logcat
와 같은 일반적인 adb
명령어를 실행할 수 있습니다.
- 기기가 USB를 수신 대기하도록 설정하려면
adb usb
를 입력합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-26(UTC)"],[],[],null,["# USB host and accessory overview\n\nAndroid supports a variety of USB peripherals and Android USB accessories\n(hardware that implements the Android accessory protocol) through two modes: USB\naccessory and USB host. In USB accessory mode, the external USB hardware acts as\nthe USB host. Examples of accessories might include:\n\n- robotics controllers\n- docking stations\n- diagnostic and musical equipment\n- kiosks\n- card readers\n\nand many more. This gives Android-powered devices that don't have host\ncapabilities the ability to interact with USB hardware. Android\nUSB accessories must be\ndesigned to work with Android-powered devices and must adhere to the [Android\naccessory communication protocol](http://accessories.android.com/demokit). In\nUSB host mode, the Android-powered device acts as the host. Examples of devices\ninclude digital cameras, keyboards, mice, and game controllers. USB devices that\nare designed for a wide range of applications and environments can still\ninteract with Android applications that can correctly communicate with the\ndevice.\n\nFigure 1 shows the differences between the two modes. When the Android-powered\ndevice is in host mode, it acts as the USB host and powers the bus. When the\nAndroid-powered device is in USB accessory mode, the connected USB hardware (an\nAndroid USB accessory in this case) acts as the host and powers the bus.\n\n**Figure 1.** USB Host and Accessory Modes\n\nUSB accessory and host modes are directly supported in Android 3.1 (API level\n12) or newer platforms. USB accessory mode is also backported to Android 2.3.4\n(API level 10) as an add-on library to support a broader range of devices.\nDevice manufacturers can choose whether or not to include the add-on library on\nthe device\\\\'s system image.\n\n**Note:** Support for USB host and accessory modes are ultimately dependant on\nthe device\\\\'s hardware, regardless of platform level. You can filter for devices\nthat support USB host and accessory through a\n[`\u003cuses-feature\u003e`](/guide/topics/manifest/uses-feature-element) element.\nSee the USB [accessory](/develop/connectivity/usb/accessory) and\n[host](/develop/connectivity/usb/host) documentation for more details.\n\nDebug considerations\n--------------------\n\nWhen debugging applications that use USB accessory or host features, you most\nlikely have USB hardware connected to your Android-powered device. This\nprevents you from having an `adb` connection to the Android-powered device\nusing USB. You can still access `adb` over a network connection. To enable `adb`\nover a network connection:\n\n1. Connect the Android-powered device using USB to your computer.\n2. From your SDK `platform-tools/` directory, enter `adb tcpip 5555` at the command prompt.\n3. Enter `adb connect \u003cdevice-ip-address\u003e:5555` You should now be connected to the Android-powered device and can issue the usual `adb` commands like `adb logcat`.\n4. To set your device to listen on USB, enter `adb usb`."]]