2018년 2월 26일 월요일

AAPT (Android aapt), android sdk 명령줄 도구 사용법

Android Asset Packaging Tool


독립적으로는 거의 사용하지 않음, SDK의 일부로 파일을 리소스를 패키징 하거나 패키징 되어 있는 내용을 꺼낼때 사용합니다.
하지만 간혹 어떤 프로그램에서 aapt 실행 파일을 필요로 하는 경우가 있습니다. 이럴때 Android Studio를  아래 링크에서 설치하면 됩니다.
https://developer.android.com/studio/
만약 설치되어 있다면 SDK가 설치되어 있는 폴더로 갑니다.
sdk 아래 build-tools 폴더 아래에 있습니다.


AAPT 툴만 필요로 하는 경우 설치 방법입니다./명령줄 도구를 이용한 설치 방법

위 링크에서 전체 android stdio를 설치하지 않고 아래쪽에 명령줄 도구만 다운로드 합니다.

명령줄 도구만 다운로드

Android Studio가 필요 없으면 아래에서 기본 Android 명령줄 도구를 다운로드할 수 있습니다. 포함되어 있는 sdkmanager를 사용하여 다른 SDK 패키지를 다운로드할 수 있습니다.
이러한 도구는 Android Studio에 포함되어 있습니다.
플랫폼SDK 도구 패키지크기SHA-256 체크섬
Windowssdk-tools-windows-3859397.zip132 MB
(138,449,982 bytes)
7f6037d3a7d6789b4fdc06ee7af041e071e9860c51f66f7a4eb5913df9871fd2
Macsdk-tools-darwin-3859397.zip82 MB
(86,182,133 bytes)
4a81754a760fce88cba74d69c364b05b31c53d57b26f9f82355c61d5fe4b9df9
Linuxsdk-tools-linux-3859397.zip130 MB
(136,964,098 bytes)
444e22ce8ca0f67353bda4b85175ed3731cae3ffa695ca18119cbacef1c1bea0
SDK 도구 릴리스 노트를 참조하세요.

각 운영체제에 맞게 압축을 풀고
tools\bin 폴더 아래 sdkmanager 를 실행시킵니다.
실행시킬때 sdkmanager --update 를 실행하면 최신 sdk 파일로 업데이트 합니다.
하지만 platform-tools는 설치되어있는데 일부 내용들이 설치 안되어있는것을 확인 할 수있습니다.
sdkmanager --list를 하면 전체 목록 획득이 가능하고 아래와 같은 형식으로 나옵니다.

  Path                                                | Version | Description                                     | Location

  -------                                             | ------- | -------                                         | -------

  build-tools;27.0.3                                  | 27.0.3  | Android SDK Build-Tools 27.0.3                  | build-tools\27.0.3\

  emulator                                            | 27.1.10 | Android Emulator                                | emulator\

  extras;intel;Hardware_Accelerated_Execution_Manager | 6.2.1   | Intel x86 Emulator Accelerator (HAXM installer) | extras\intel\Hardware_Accelerated_Execution_Manager\

  patcher;v4                                          | 1       | SDK Patch Applier v4                            | patcher\v4\

  platform-tools                                      | 27.0.1  | Android SDK Platform-Tools                      | platform-tools\

  tools                                               | 26.1.1  | Android SDK Tools                               | tools\



Available Packages:

  Path                                                                                     | Version      | Description

  -------                                                                                  | -------      | -------

  add-ons;addon-google_apis-google-15                                                      | 3            | Google APIs

  add-ons;addon-google_apis-google-16                                                      | 4            | Google APIs

  add-ons;addon-google_apis-google-17                                                      | 4            | Google APIs

  add-ons;addon-google_apis-google-18                                                      | 4            | Google APIs

  add-ons;addon-google_apis-google-19                                                      | 20           | Google APIs

  add-ons;addon-google_apis-google-21                                                      | 1            | Google APIs

  add-ons;addon-google_apis-google-22                                                      | 1            | Google APIs

  add-ons;addon-google_apis-google-23                                                      | 1            | Google APIs

  add-ons;addon-google_apis-google-24                                                      | 1            | Google APIs

  add-ons;addon-google_gdk-google-19                                                       | 11           | Glass Development Kit Preview

  build-tools;19.1.0                                                                       | 19.1.0       | Android SDK Build-Tools 19.1

  build-tools;20.0.0                                                                       | 20.0.0       | Android SDK Build-Tools 20

  build-tools;21.1.2                                                                       | 21.1.2       | Android SDK Build-Tools 21.1.2

  build-tools;22.0.1                                                                       | 22.0.1       | Android SDK Build-Tools 22.0.1

  build-tools;23.0.1                                                                       | 23.0.1       | Android SDK Build-Tools 23.0.1

  build-tools;23.0.2                                                                       | 23.0.2       | Android SDK Build-Tools 23.0.2

  build-tools;23.0.3                                                                       | 23.0.3       | Android SDK Build-Tools 23.0.3

  build-tools;24.0.0                                                                       | 24.0.0       | Android SDK Build-Tools 24

  build-tools;24.0.1                                                                       | 24.0.1       | Android SDK Build-Tools 24.0.1

  build-tools;24.0.2                                                                       | 24.0.2       | Android SDK Build-Tools 24.0.2

  build-tools;24.0.3                                                                       | 24.0.3       | Android SDK Build-Tools 24.0.3

  build-tools;25.0.0                                                                       | 25.0.0       | Android SDK Build-Tools 25

  build-tools;25.0.1                                                                       | 25.0.1       | Android SDK Build-Tools 25.0.1

  build-tools;25.0.2                                                                       | 25.0.2       | Android SDK Build-Tools 25.0.2

  build-tools;25.0.3                                                                       | 25.0.3       | Android SDK Build-Tools 25.0.3

  build-tools;26.0.0                                                                       | 26.0.0       | Android SDK Build-Tools 26

  build-tools;26.0.1                                                                       | 26.0.1       | Android SDK Build-Tools 26.0.1

  build-tools;26.0.2                                                                       | 26.0.2       | Android SDK Build-Tools 26.0.2

  build-tools;26.0.3                                                                       | 26.0.3       | Android SDK Build-Tools 26.0.3

  build-tools;27.0.0                                                                       | 27.0.0       | Android SDK Build-Tools 27

  build-tools;27.0.1                                                                       | 27.0.1       | Android SDK Build-Tools 27.0.1

  build-tools;27.0.2                                                                       | 27.0.2       | Android SDK Build-Tools 27.0.2
특정 내용만 업데이트하려면 아래와 같이 정확한 이름(목록에서 첫번째 인자인 Path명)을 넣어주면 됩니다. (build-tools 안에 aapt가 있기 때문에 아래 command line 명령을 치면 됩니다.)
sdkmanager build-tools;27.0.3

압축을 풀었던 장소에 build-tools 폴더가 생성되고 하위에 내용이 생성됨을 알 수 있습니다.
이외에 다른 adb 같은 툴도 같은 방식으로 다운로드 가능합니다.

platform-tools                                                                           | 27.0.1       | Android SDK Platform-Tools

adb는 platform-tools(Path명)에 있기 때문에 아래와같이 명령을 내리면 업데이트 됩니다.
sdkmanager platform-tools

댓글 없음:

댓글 쓰기