명령줄 도구
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Android SDK는 앱 개발에 필요한 여러 패키지로 구성됩니다.
이 페이지에서는 사용 가능한 가장 중요한 명령줄 도구를 제공되는 패키지별로 정리해 보여줍니다.
Android 스튜디오의 SDK Manager 또는 sdkmanager
명령줄 도구를 사용하여 각 패키지를 설치하고 업데이트할 수 있습니다.
모든 패키지는 Android SDK 디렉터리에 다운로드되며, 이 디렉터리는 다음 방법을 통해 찾을 수 있습니다.
- Android 스튜디오에서 File > Project Structure를 클릭합니다.
- 왼쪽 창에서 SDK Location을 선택합니다.
경로가 Android SDK location 아래 표시됩니다.
환경 변수 설정
명령줄을 사용할 때는 ANDROID_HOME
환경 변수를 설정하는 것이 좋습니다. 또한 ANDROID_HOME/tools
, ANDROID_HOME/tools/bin
, ANDROID_HOME/platform-tools
를 포함하도록 명령어 검색 경로를 설정하여 가장 일반적인 도구를 찾습니다. 이 단계는 OS에 따라 다르지만, 일반적인 안내는 환경 변수 설정 방법을 참고하세요.
위치: android_sdk/cmdline-tools/version/bin/
참고: cmdline-tools
에 있는 Android SDK 명령줄 도구 패키지가 tools
에 있는 SDK 도구 패키지를 대체합니다. 새 패키지를 사용하면 설치하려는 명령줄 도구의 버전을 선택할 수 있고 한 번에 여러 버전을 설치할 수 있습니다. 이전 패키지를 사용하면 최신 버전의 도구만 설치할 수 있습니다. 따라서 새 패키지를 사용하면 새 버전이 출시될 때 코드 중단 없이 명령줄 도구의 특정 버전을 사용할 수 있습니다. 지원 중단된 SDK 도구 패키지에 관한 자세한 내용은 SDK 도구 출시 노트를 참고하세요.
Android 스튜디오를 사용하지 않는 경우 여기에서 명령줄 도구 패키지를 다운로드할 수 있습니다.
apkanalyzer
- 빌드 프로세스가 완료된 후 APK의 구성에 관한 유용한 정보를 제공합니다.
avdmanager
- 명령줄에서 Android Virtual Device(AVD)를 만들고 관리할 수 있습니다.
lint
- 코드를 스캔하여 코드의 구조적 품질 문제를 식별하고 수정할 수 있도록 지원합니다.
retrace
- R8로 컴파일된 애플리케이션의 경우
retrace
는 원래 소스 코드에 다시 매핑되는 난독화된 스택 트레이스를 디코딩합니다.
sdkmanager
- Android SDK용 패키지를 보고 설치하고 업데이트하고 제거할 수 있습니다.
위치: android_sdk/build-tools/version/
자세한 내용은 SDK 빌드 도구 출시 노트를 참고하세요.
이 패키지는 Android 앱을 빌드하기 위해 필요합니다. 이 패키지의 도구는 대부분 빌드 도구에서 호출하며 개발자를 위한 것이 아닙니다. 하지만 다음과 같은 명령줄 도구가 유용할 수도 있습니다.
AAPT2
- Android 리소스를 Android 플랫폼에 최적화된 바이너리 형식으로 파싱하고 색인을 생성하며 컴파일한 후 컴파일된 리소스를 단일 출력으로 패키징합니다.
apksigner
- APK에 서명하고 APK 서명이 지정된 APK가 지원하는 모든 플랫폼 버전에서 성공적으로 인증되는지 확인합니다.
zipalign
- 압축되지 않은 모든 데이터가 파일 시작 부분을 기준으로 특정 정렬이 적용된 상태로 시작되도록 하여 APK 파일을 최적화합니다.
참고: 여러 버전의 빌드 도구를 사용하여 다양한 Android 버전용 앱을 빌드할 수 있습니다.
위치: android_sdk/platform-tools/
자세한 내용은 SDK 플랫폼 도구 출시 노트를 참고하세요.
이러한 도구는 Android 플랫폼의 새 버전이 출시될 때마다 업데이트되어 새로운 기능을 지원하고 도구를 수정하거나 개선하며 각 업데이트는 이전 플랫폼 버전과 호환됩니다.
여기에서 SDK 플랫폼 도구를 다운로드할 수도 있고 SDK Manager에서 다운로드할 수도 있습니다.
adb
- adb(Android 디버그 브리지)는 에뮬레이터 인스턴스 또는 Android 지원 기기의 상태를 관리할 수 있는 다목적 도구입니다. adb를 사용하여 기기에 APK를 설치할 수도 있습니다.
etc1tool
- PNG 이미지를 ETC1 압축 표준으로 인코딩하고 압축된 ETC1 이미지를 PNG로 다시 디코딩할 수 있는 명령줄 유틸리티입니다.
fastboot
- 기기를 플랫폼 및 기타 시스템 이미지로 플래시합니다. 플래시 안내는 Nexus 및 Pixel 기기용 공장 출고 시 이미지를 참고하세요.
logcat
- 앱 및 시스템 로그를 보기 위해 adb에서 호출합니다.
위치: android_sdk/emulator/
자세한 내용은 Android Emulator 출시 노트를 참고하세요.
Android Emulator를 사용하려면 이 패키지가 있어야 합니다. 이 패키지에는 다음 도구가 포함되어 있습니다.
emulator
- 실제 Android 런타임 환경에서 애플리케이션의 디버그 및 테스트에 사용할 수 있는 QEMU 기반 기기 에뮬레이션 도구입니다.
mksdcard
- SD 카드와 같은 외부 메모리 카드의 존재를 시뮬레이션하기 위해 에뮬레이터와 함께 사용할 디스크 이미지를 만들 수 있습니다.
참고: 25.3.0 버전 이전에는 에뮬레이터 도구가 SDK 도구 패키지에 포함되었습니다.
Jetifier
Jetifier는 지원 라이브러리 클래스를 사용하는 라이브러리를 읽고 최신 AndroidX 클래스를 사용하는 동등한 라이브러리를 출력합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2023-12-02(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"]],["최종 업데이트: 2023-12-02(UTC)"],[],[],null,["# Command-line tools\n\nThe Android SDK is composed of multiple packages that are required for app development.\nThis page lists the most important command-line tools that are\navailable, organized by the packages in which they're delivered.\n\nYou can install and update each package using\nAndroid Studio's [SDK Manager](/studio/intro/update#sdk-manager)\nor the [`sdkmanager`](/studio/command-line/sdkmanager)\ncommand-line tool.\nAll of the packages are downloaded into your Android SDK directory, which\nyou can locate as follows:\n\n1. In Android Studio, click **File \\\u003e Project Structure**.\n2. Select **SDK Location** in the left pane. The path is shown under **Android SDK location**.\n\n### Set environment variables\n\nWe recommend setting the environment variable for\n[\u003cvar translate=\"no\"\u003eANDROID_HOME\u003c/var\u003e](/studio/command-line/variables#envar) when using\nthe command line. Also, set your command search path to include\n\u003cvar translate=\"no\"\u003eANDROID_HOME/tools\u003c/var\u003e, \u003cvar translate=\"no\"\u003eANDROID_HOME/tools/bin\u003c/var\u003e, and\n\u003cvar translate=\"no\"\u003eANDROID_HOME/platform-tools\u003c/var\u003e to find the most common tools. The steps\nvary depending on your OS, but read\n[How to set environment variables](/studio/command-line/variables#set) for general guidance.\n\nAndroid SDK Command-Line Tools\n------------------------------\n\n\nLocated in: \u003cvar translate=\"no\"\u003eandroid_sdk\u003c/var\u003e`/cmdline-tools/`\u003cvar translate=\"no\"\u003eversion\u003c/var\u003e`/bin/` \n\nNote: The Android SDK Command-Line Tools package, located in\n`cmdline-tools`, replaces the SDK Tools package, located in `tools`. With\nthe new package, you can select the version of the command line tools you want to install,\nand you can install multiple versions at a time. With the old package, you can only install the\nlatest version of the tools. Thus, the new package lets you depend on specific versions of the\ncommand-line tools without having your code break when new versions are released. For information\nabout the deprecated SDK Tools package, see the\n[SDK Tools release notes](/studio/releases/sdk-tools).\n\nIf you are not using Android Studio, you can download the command-line tools package\n[here](/studio#command-tools).\n\n[apkanalyzer](/studio/command-line/apkanalyzer)\n: Provides insight into the composition of your APK after the build process completes.\n\n[avdmanager](/studio/command-line/avdmanager)\n: Lets you create and manage Android Virtual Devices (AVDs)\n from the command line.\n\n[lint](/studio/write/lint#commandline)\n: Scans code to help you identify and correct problems\n with the structural quality of your code.\n\n[`retrace`](/studio/command-line/retrace)\n: For applications compiled by R8, `retrace` decodes an obfuscated stack trace that\n maps back to your original source code.\n\n[sdkmanager](/studio/command-line/sdkmanager)\n: Lets you view, install, update, and uninstall packages for the Android SDK\n\nAndroid SDK Build Tools\n-----------------------\n\n\nLocated in: \u003cvar translate=\"no\"\u003eandroid_sdk\u003c/var\u003e`/build-tools/`\u003cvar translate=\"no\"\u003eversion\u003c/var\u003e`/` \n\nSee [SDK Build Tools release notes](/studio/releases/build-tools) for more\ninformation.\n\nThis package is required to build Android apps. Most of the tools in this package are\ninvoked by the build tools and not intended for you. However, the following\ncommand-line tools might be useful:\n\n[`AAPT2`](/studio/command-line/aapt2)\n: Parses, indexes, and compiles Android resources into a binary format that\n is optimized for the Android platform and packages the compiled resources\n into a single output.\n\n[`apksigner`](/studio/command-line/apksigner)\n: Signs APKs and checks whether APK signatures will be verified\n successfully on all platform versions that a given APK supports.\n\n[`zipalign`](/studio/command-line/zipalign)\n: Optimizes APK files by ensuring that all uncompressed data starts with\n a particular alignment relative to the start of the file.\n\n**Note:** You can have multiple versions of the build tools\nto build your app for different Android versions.\n\nAndroid SDK Platform Tools\n--------------------------\n\n\nLocated in: \u003cvar translate=\"no\"\u003eandroid_sdk\u003c/var\u003e`/platform-tools/` \n\nSee [SDK Platform Tools release notes](/studio/releases/platform-tools) for more\ninformation.\n\nThese tools are updated for every new version of the Android platform to support new features\nand fix or improve the tools, and each update\nis backward compatible with earlier platform versions.\n\nIn addition to downloading from the SDK Manager, you can download the SDK Platform Tools\n[here](/studio/releases/platform-tools#downloads.html).\n\n[`adb`](/studio/command-line/adb)\n: Android Debug Bridge (adb) is a versatile tool that lets you manage the state of an\n emulator instance or Android-powered device. You can also use it to install an APK on a\n device.\n\n[`etc1tool`](/studio/command-line/etc1tool)\n: A command-line utility that lets you encode PNG images to the ETC1\n compression standard and decode ETC1 compressed images back to PNG.\n\n`fastboot`\n: Flashes a device with platform and other system images. For flashing instructions,\n see [Factory Images for Nexus and\n Pixel Devices](https://developers.google.com/android/images).\n\n[`logcat`](/studio/command-line/logcat)\n: Invoked by adb to view app and system logs.\n\nAndroid Emulator\n----------------\n\n\nLocated in: \u003cvar translate=\"no\"\u003eandroid_sdk\u003c/var\u003e`/emulator/` \n\nSee [Android Emulator release notes](/studio/releases/emulator) for more\ninformation.\n\nThis package is required to use the Android Emulator. It includes the following:\n\n[emulator](/studio/run/emulator-commandline)\n: A QEMU-based device-emulation tool that you can use to debug and test\n your applications in an actual Android run-time environment.\n\n[mksdcard](/studio/command-line/mksdcard)\n: Helps you create a disk image that you can use with the emulator\n to simulate the presence of an external storage card, such as an SD card.\n\n**Note:** Prior to revision 25.3.0, the emulator tools were included with the\nSDK Tools package.\n\nJetifier\n--------\n\n[Jetifier](/studio/command-line/jetifier) reads a library that uses\nSupport Library classes and outputs an equivalent library that uses the newer\nAndroidX classes."]]