跳转到相应内容

最常访问

最近访问

navigation

Command Line Tools

The Android SDK is composed of multiple packages that are required for app development. This page lists the most important command line tools that are available, organized by the packages in which they're delivered.

You can install and update each package using Android Studio's SDK Manager or the sdkmanager command line tool. All of the packages are downloaded into your Android SDK directory, which you can locate as follows:

  1. In Android Studio, click File > Project Structure.
  2. Select SDK Location in the left pane. The path is shown under Android SDK location.

Android SDK Tools

Located in: android_sdk/tools/bin/
See also: SDK Tools release notes

This package is platform independent and required no matter which Android platform you are developing on.

If you just need these tools because you're not using Android Studio, you can download the SDK Tools here.

apkanalyzer
Provides insight into the composition of your APK after the build process completes.
avdmanager
Allows you to create and manage Android Virtual Devices (AVDs) from the command line.
jobb
Allows you to build encrypted and unencrypted APK expansion files in Opaque Binary Blob (OBB) format.
lint
A code scanning tool that can help you to identify and correct problems with the structural quality of your code.
monkeyrunner
Provides the command line interface for running program that can install an Android app or test package, run it, send keystrokes to it, takes screenshots, and more.
sdkmanager
Allows you to view, install, update, and uninstall packages for the Android SDK.

This package includes other tools that you don't need to invoke from the command line (such as ProGuard for code shrinking and obfuscation).

Android SDK Build Tools

Located in: android_sdk/build-tools/version/
See also: SDK Build Tools release notes

This package is required to build Android apps. Most of the tools in here are invoked by the build tools and not intended for you. However, the following command line tools might be useful:

apksigner
Signs APKs and checks whether APK signatures will be verified successfully on all platform versions that a given APK supports.
zipalign
Optimizes APK files by ensuring that all uncompressed data starts with a particular alignment relative to the start of the file.

Note: You can have multiple versions of the build tools to build your app for different Android versions.

Android SDK Platform Tools

Located in: android_sdk/platform-tools/
See also: SDK Platform Tools release notes

These tools are updated for every new version of the Android platform to support new features (and sometimes more often to fix or improve the tools), and each update is backward compatible with older platform versions.

In addition to downloading from the SDK Manager, you can download the SDK Platform Tools here.

adb
Android Debug Bridge (adb) is a versatile tool that lets you manage the state of an emulator instance or Android-powered device. You can also use it to install an APK on a device.
etc1tool
A command line utility that lets you encode PNG images to the ETC1 compression standard and decode ETC1 compressed images back to PNG.
fastboot
Flashes a device with platform and other system images. For flashing instructions, see Factory Images for Nexus and Pixel Devices.
logcat
This is a tool invoked via adb to view app and system logs.

Android Emulator

Located in: android_sdk/emulator/
See also: Android Emulator release notes

This package is required to use the Android Emulator. It includes the following:.

emulator
A QEMU-based device-emulation tool that you can use to debug and test your applications in an actual Android run-time environment.
mksdcard
Helps you create a disk image that you can use with the emulator, to simulate the presence of an external storage card (such as an SD card).

Note: Prior to revision 25.3.0, the emulator tools were included with the SDK Tools package.

此网站会使用 Cookie 来存储您在此网站上指定的语言和显示选项偏好设置。

获取最新的 Android Developers 资讯和提示,助您在 Google Play 上取得成功。

* 必填字段

成功!

在微信上关注 Google Developers

要以浏览此网站吗?

您请求访问的是网页,但是您为此网站设置的语言偏好为

要更改您的语言偏好设置并以浏览此网站吗?如果以后您想要更改语言偏好设置,请使用每个页面底部的语言菜单。

该类需要 或更高的 API 级别

此文档已被隐藏,因为您为该文档选择的 API 级别是 。您可以使用左侧导航栏上方的选择器来更改文档的 API 级别。

要详细了解如何根据您的应用需求指定 API 级别,请参阅支持不同平台版本

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)