From 41f7ff915033ebc8b2210e306cba99c4173a2285 Mon Sep 17 00:00:00 2001
From: "smain@google.com" By default, there are two build types to build your application using the Gradle build settings:
- one for debugging your application — debug — and one for building your
- final package for release — release mode. Regardless of which build type
- your modules use, the app must be signed before it can install on an emulator or device—with
- a debug key when building in debug mode and with your own private key when building in release mode. Whether you're building with the debug or release build type, you need to run
- and build your module. This will create the .apk file that you can install on an emulator or device.
- When you build using the debug build type, the .apk file is automatically signed by the SDK tools
- with a debug key based on the It's important that you read and understand Signing Your Applications, particularly once
- you're ready to release your application and share it with end-users. That document describes the
- procedure for generating a private key and then using it to sign your APK file. If you're just
- getting started, however, you can quickly run your applications on an emulator or your own
- development device by building in debug mode. If you don't have Gradle, you can obtain it from the Gradle
- home page. Install it and make sure it is in your executable PATH. Before calling Gradle, you
- need to declare the JAVA_HOME environment variable to specify the path to where the JDK is
- installed. Note: When using The easiest solution, however, is to install JDK in a non-space directory, for example: For immediate application testing and debugging, you can build your application in debug mode
- and immediately install it on an emulator. In debug mode, the build tools automatically sign your
- application with a debug key and optimize the package with {@code zipalign}. To build in debug mode, open a command-line and navigate to the root of your project directory.
- Use Gradle to build your project in debug mode, invoke the This creates your debug On Windows platforms, type this command: On Mac OS and Linux platforms, type these commands: The first command ( After you build the project, the output APK for the app module is located in
- To see a list of all available build tasks for your project, type this command: Each time you change a source file or resource, you must run Gradle again in order to package up
- the latest version of the application. To install and run your application on an emulator, see the section about Running on the Emulator. When you're ready to release and distribute your application to end-users, you must build your
- application in release mode. Once you have built in release mode, it's a good idea to perform
- additional testing and debugging with the final .apk. Before you start building your application in release mode, be aware that you must sign the
- resulting application package with your private key, and should then align it using the {@code
- zipalign} tool. There are two approaches to building in release mode: build an unsigned package
- in release mode and then manually sign and align the package, or allow the build script to sign
- and align the package for you. If you build your application unsigned, then you will need to manually sign and align
- the package. To build an unsigned .apk in release mode, open a command-line and navigate to the
- root of your module directory. Invoke the On Windows platforms, type this command: On Mac OS and Linux platforms, type this command: This creates your Android application .apk file inside the project Note: The .apk file is unsigned at this point and can't
- be installed until signed with your private key. Once you have created the unsigned .apk, your next step is to sign the .apk with your private
- key and then align it with {@code zipalign}. To complete this procedure, read Signing Your Applications. When your If you would like, you can configure the Android build script to automatically sign and align
- your application package. To do so, you must provide the path to your keystore and the name of
- your key alias in your modules's build.gradle file. With this information provided,
- the build will prompt you for your keystore and alias password when you build using the release
- build type and produce your final application package, which will be ready for distribution. To specify your keystore and alias, open the module build.gradle file (found in
- the root of the module directory) and add entries for {@code storeFile}, {@code storePassword},
- {@code keyAlias} and {@code keyPassword}.
- For example: Save your changes. Now you can build a signed .apk in release mode:In this document
-
-
- See also
-
- debuggable true
setting in the module's build.gradle file,
- so it's instantly ready for installation onto an emulator or attached
- development device. You cannot distribute an application that is signed with a debug key.
- When you build using the release build type, the .apk file is unsigned, so you
- must manually sign it with your own private key, using Keytool and Jarsigner settings in the
- module's build.gradle
file.ant
and installing JDK on Windows,
- the default is to install in the "Program Files" directory. This location will cause
- ant
to fail, because of the space. To fix the problem, you can specify the JAVA_HOME
- variable like this:
- set JAVA_HOME=c:\Progra~1\Java\<jdkdir>
-
- c:\java\jdk1.7
-
- Building in Debug Mode
-
- assembleDebug
build task
- using the Gradle wrapper script (gradlew assembleRelease
).
-
- .apk
file inside the module build/
- directory, named <your_module_name>-debug.apk
. The file is already signed
- with the debug key and has been aligned with
- zipalign
.
-> gradlew.bat assembleDebug
-
-
-
-$ chmod +x gradlew
-$ ./gradlew assembleDebug
-
-
- chmod
) adds the execution permission to the Gradle wrapper
- script and is only necessary the first time you build this project from the command line.app/build/outputs/apk/
, and the output AAR for any lib modules is located in
- lib/build/outputs/libs/
.
-$ ./gradlew tasks
-
-
- Building in Release Mode
-
- Build unsigned
-
- assembleRelease
build task.
-
-
-> gradlew.bat assembleRelease
-
-
-
-$ ./gradlew assembleRelease
-
-
-
- bin/
- directory, named <your_module_name>-unsigned.apk
..apk
has been signed and aligned, it's ready to be distributed to end-users.
- You should test the final build on different devices or AVDs to ensure that it
- runs properly on different platforms.Build signed and aligned
-
-
-storeFile file("myreleasekey.keystore")
-keyAlias "MyReleaseKey"
-
-
-
-
-...
-android {
- ...
- defaultConfig { ... }
- signingConfigs {
- release {
- storeFile file("myreleasekey.keystore")
- storePassword "password"
- keyAlias "MyReleaseKey"
- keyPassword "password"
- }
- }
- buildTypes {
- release {
- ...
- signingConfig signingConfigs.release
- }
- }
-}
-...
-
Caution: As described above, your password will be - visible on the screen.
-This creates your Android application .apk file inside the module build/
- directory, named <your_module_name>-release.apk
. This .apk file has
- been signed with the private key specified in build.gradle file and aligned with {@code
- zipalign}. It's ready for installation and distribution.
Once you have signed your application with a private key, you can install and run it on an - emulator or device. You can - also try installing it onto a device from a web server. Simply upload the signed .apk to a web - site, then load the .apk URL in your Android web browser to download the application and begin - installation. (On your device, be sure you have enabled - Settings > Applications > Unknown sources.)
- -Before you can run your application on the Android Emulator, you must create an AVD.
- -To run your application:
- -From your SDK's platform-tools/
directory, execute the {@code android} tool
-with the avd
options:
-android avd -- -
In the Virtual Devices view, select an AVD and click Start.
-From your SDK's tools/
directory, install the {@code .apk} on the
- emulator:
-adb install <path_to_your_bin>.apk -- -
Your .apk file (signed with either a release or debug key) is in your module {@code build/} - directory after you build your application.
- -If there is more than one emulator running, you must specify the emulator upon which to
- install the application, by its serial number, with the -s
option. For
- example:
-adb -s emulator-5554 install path/to/your/app.apk -- -
To see a list of available device serial numbers, execute {@code adb devices}.
-If you don't see your application on the emulator, try closing the emulator and launching the - virtual device again from the AVD Manager. Sometimes when you install an application for the - first time, it won't show up in the application launcher or be accessible by other applications. - This is because the package manager usually examines manifests completely only on emulator - startup.
- -Be certain to create multiple AVDs upon which to test your application. You should have one - AVD for each platform and screen type with which your application is compatible. For instance, if - your application compiles against the Android 4.0 (API Level 14) platform, you should create an - AVD for each platform equal to and greater than 4.0 and an AVD for each screen type you support, then test your - application on each one.
- -Tip: If you have only one emulator running, you can
- build your application and install it on the emulator in one simple step. Navigate to the root of
- your project directory and use Ant to compile the project with install mode: ant
- install
. This will build your application, sign it with the debug key, and install it on
- the currently running emulator.
Before you can run your application on a device, you must perform some basic setup for your - device:
- -Note: On Android 4.2 and newer, Developer - options is hidden by default. To make it available, go - to Settings > About phone and tap Build number - seven times. Return to the previous screen to find Developer options.
-Read Setting up a Device for - Development for more information.
- -Once your device is set up and connected via USB, navigate to your SDK's platform-tools/
- directory and install the .apk
on the device:
-adb -d install path/to/your/app.apk -- -
The {@code -d} flag specifies that you want to use the attached device (in case you also have - an emulator running).
- -For more information on the tools used above, please see the following documents:
- -As you begin developing Android applications, understand that all Android applications must be - digitally signed before the system will install them on an emulator or device. There are two ways - to do this: with a debug key (for immediate testing on an emulator or development - device) or with a private key (for application distribution).
- -The Android build tools help you get started by automatically signing your .apk files with a - debug key at build time. This means that you can build your application and install it on the - emulator without having to generate your own private key. However, please note that if you intend - to publish your application, you must sign the application with your own private - key, rather than the debug key generated by the SDK tools.
- -Please read Signing Your - Applications, which provides a thorough guide to application signing on Android and what it - means to you as an Android application developer. The document also includes a guide to publishing - and signing your application.
- -The Android build system uses the Android plugin for Gradle to support the Gradle Domain - Specific Language (DSL) and declarative language elements. See the - Android Plug-in for Gradle section for - a description of the plugin and a link to the complete list of the supported Gradle DSL elements.
- - - diff --git a/docs/html/tools/building/building-studio.jd b/docs/html/tools/building/building-studio.jd deleted file mode 100644 index 2b18b6673885..000000000000 --- a/docs/html/tools/building/building-studio.jd +++ /dev/null @@ -1,801 +0,0 @@ -page.title=Building and Running from Android Studio -parent.title=Building and Running -parent.link=index.html -@jd:body - -- By default, Android Studio sets up new projects to deploy to the Emulator or - a physical device with just a few clicks. With Instant Run, you can push - changes to methods and existing app resources to a running app without - building a new APK, so code changes are visible almost instantly. -
- -- To build and run your app, click Run 'app' . Android Studio builds your app with - Gradle, asks you to select a deployment target (an emulator or a connected - device), and then deploys your app to it. You can customize some of this - default behavior, such as selecting an automatic deployment target, by - changing the run configuration. -
- -- If you want to use the Android - Emulator to run your app, you need to have an Android Virtual Device - (AVD) ready. If you haven't already created one, then after you click - Run 'app', click Create New Emulator in the - Select Deployment Target dialog. Follow the Virtual Device - Configuration wizard to define the type of device you want to emulate. For - more information, see Managing AVDs with the AVD - Manager. -
- -- If you're using a physical Android device, you need to enable USB debugging - on the device. For more information, see Using Hardware Devices. -
- -- Note: You can also deploy your app in debug mode by clicking - Debug 'app' . Running your app in debug mode - allows you to set breakpoints in your code, examine variables and evaluate - expressions at run time, and run debugging tools. To learn more, read about - Debugging with - Android Studio. -
- -- The run configuration specifies the module to run, package to deploy, - activity to start, target device, emulator settings, and Logcat options. The - default run configuration launches the default project activity and uses the - Device Chooser for target device selection. If the default - settings don't suit your project or module, you can customize the run - configuration, or even create a new one, at the project, default, and module - levels. To edit a run configuration: -
- -- By default, Android Studio builds the debug version of your app, which is - intended only for testing, when you click Run 'app'. You - need to build the release version when preparing your app for public - release. -
-- To change the build variant Android Studio uses, go to Build - > Select Build Variant and select a different one from - the drop-down menu. By default, new projects are set up with a debug and - release build variant. -
- -- Using product flavors, you can create additional build variants for - different versions of your app, each having different features or device - requirements. To learn more about build variants and product flavors, read - Configuring Gradle - Builds. -
- -- You can view details about the build process by clicking Gradle - Console . The console displays each - task that Gradle executes in order to build your app, as shown in figure 1. -
- - - - -- If your build variants use product flavors, Gradle also invokes tasks to - build those product flavors. To view the list of all available build tasks, - click Gradle on the right side of the IDE - window. -
- -
- If an error occurs during the build process, the Messages window
- appears to describe the issue. Gradle may recommend some command-line
- options to help you resolve the issue, such as --stacktrace
or
- --debug
. To use command-line options with your build process:
-
- Gradle will apply these command-line options the next time you try building - your app. -
- -- When you click Run 'app', Android Studio generates a debug - APK and deploys it to your target device. Before you can generate a release - version of your app for public distribution, however, you must first learn - how to sign your - app. You can then generate multiple signed APKs of your debug or release - build variants. To locate the generated APK files, click the link in the - pop-up dialog, as shown in figure 2. -
- -- -
- - - -- Introduced in Android Studio 2.0, Instant Run is a behavior for the - Run and Debug commands that significantly reduces the - time between updates to your app. Although your first build may take longer - to complete, Instant Run pushes subsequent updates to your app without - building a new APK, so changes are visible much more quickly. -
- -
- Instant Run is supported only when you deploy the debug build variant, use
- Android Plugin for Gradle version 2.0.0 or higher, and set
- minSdkVersion
to 15 or higher in your app's module-level
- build.gradle
file. For the best performance, set
- minSdkVersion
to 21 or higher.
-
- After deploying an app, a small, yellow thunderbolt icon appears within the - Run button (or Debug - button), indicating that Instant Run is - ready to push updates the next time you click the button. Instead of building - a new APK, it pushes just those new changes and, in some cases, the app - doesn't even need to restart but immediately shows the effect of those code - changes. -
- -- Instant Run pushes updated code and resources to your connected device or - emulator by performing a hot swap, warm swap, or cold - swap. It automatically determines the type of swap to perform based on - the type of change you made. The following table describes how Instant Run - behaves when you push certain code changes to a target device. -
- -- Code Change - | -- Instant Run Behavior - | -
---|---|
-
|
-
- - Supported with hot swap: This is the - fastest type of swap and makes changes visible much more quickly. Your - application keeps running and a stub method with the new implementation is used - the next time the method is called. - - -- Hot swaps do not re-initialize objects in your running app. You may need to - restart the current activity, or restart the app, before - you see certain updates. By default, Android Studio automatically restarts the - current activity after performing a hot swap. If you do not want this behavior, - you can disable automatic activity restarts. - - |
-
-
|
- - Supported with warm swap: This swap - is still very fast, but Instant Run must restart the current activity when it - pushes the changed resources to your app. Your app keeps running, but a small - flicker may appear on the screen as the activity restarts—this is normal. - | -
- Structural code changes, such as:
-
|
-
- - Supported with cold swap (API level 21 or higher): This swap - is a bit slower because, although a new APK is not required, Instant Run must - restart the whole app when it pushes structural code changes. - - -- For target devices running API level 20 or lower, Android Studio - deploys a full APK. - - |
-
-
|
-
- - When making changes to the app's manifest or resources referenced by the - manifest, Android Studio automatically deploys a new build - in order to apply these changes. This is because certain information about - the app, such as its name, app icon resources, and intent filters, are - determined from the manifest when the APK is installed on the device. - - -
- If your build process automatically updates any part of the app manifest,
- such as automatically iterating - When updating an Android widget UI element, you need to perform a Clean and Rerun to see your changes. Alternatively, because - performing clean builds may take longer while using Instant Run, you can - temporarily disable Instant Run while making - updates to your widget UI. - - |
-
- Note: If you need to restart your app after a crash, do not - launch it from your target device. Restarting your app from your target - device does not apply any of your code changes since the last cold swap or - incremental build. To launch your app with all your recent changes, - click Run (or Debug - ) from Android Studio. -
- -- When pushing code changes that affect certain initializers, such as changes - to an app's {@link android.app.Application#onCreate onCreate()} method, you - need to restart your app for the changes to take effect. To perform an - incremental build and restart the app, click Rerun - . -
- -- If you need to deploy a clean build, select Run - > Clean and Rerun 'app' from the main menu, or hold down the - Shift key while clicking Rerun . This action stops the running app, - performs a full clean build, and deploys the new APK to your target device. -
- -- When performing a hot swap, your app keeps running but Android Studio - automatically restarts the current activity. To disable this default setting: -
- -- If automatic activity restart is disabled, you can manually restart the current - activity from the menu bar by selecting Run > Restart - Activity. -
- -- Android Studio enables Instant Run by default for projects built using - Android Plugin for Gradle 2.0.0 and higher. -
- -- To update an existing project with the latest version of the plugin: -
- -- Navigate to Build, Execution, Deployment > - Instant Run and click Update Project, - as shown in figure 3. -
- -- If the option to update the project does not appear, it’s already - up-to-date with the latest Android Plugin for Gradle. -
- - - - -- You also need to change the build variant to - a debug version of your app to start using Instant Run. -
- -
- When you deploy a clean build, Android Studio instruments your app to allow
- Instant Run to push code and resource updates. Although updating the running
- app happens much more quickly, the first build may take longer to complete.
- You can improve the build process by configuring a few
- DexOptions
settings:
-
maxProcessCount
- gradlew --stop
- ./gradlew --stop
- javaMaxHeapSize
-
- The following example sets maxProcessCount
to 4 and
- javaMaxHeapSize
to "2g" in the module-level
- build.gradle
file:
-
-android { - ... - dexOptions { - maxProcessCount 4 // this is the default value - javaMaxHeapSize "2g" - } -} -- -
- You should experiment with these settings by incrementing their values and - observing the effect on your build times. You could experience a negative - impact to performance if you allocate too many resources to the dexing process. -
- -- Android - Plugin for Gradle version 2.1.0 and higher features additional build - process improvements, including incremental Java compilation and - dexing-in-process. Incremental Java compilation is enabled by default and - reduces compilation time during development by only recompiling portions of - the source that have changed or need to be recompiled. -
- -
- Dexing-in-process performs dexing within the build process rather than in a
- separate, external VM processes. This not only makes incremental builds much
- faster, but also significantly speeds up full builds. To enable this feature,
- you need to set the Gradle daemon's maximum heap size to at least 2048 MB. You
- can do this by including the following in your project's
- gradle.properties
file:
-
-
-org.gradle.jvmargs = -Xmx2048m -- - - -
- If you have defined a value for
- javaMaxHeapSize
in your module-level build.gradle
- file, you need to set the daemon's max heap size to the value of
- javaMaxHeapSize
+ 1024 MB. For example, if you have set
- javaMaxHeapSize
to "2g", you need to add the following to your
- project's gradle.properties
file:
-
-
-org.gradle.jvmargs = -Xmx3072m -- - - -
- On Windows systems, Windows Defender may cause slowdowns while using Instant - Run. If you are using Windows Defender, you should - exclude your Android Studio project folder from Windows Defender malware - scans. -
- -- Using Crashlytics is known to cause slower build times. To improve build - performance while developing your app, you can - disable Crashlytics for your debug build variant. -
- -- Instant Run is designed to speed up the build and deploy process in most - situations. However, there are some aspects to using Instant Run that might - affect its behavior and compatibility with your app. If you experience any - other issues while using Instant Run, please file a bug. -
- -- Instant Run uses different techniques to perform hot, warm, and cold swaps - that are specific to the API level of the target device. For this reason, - while deploying an app to multiple devices at once, Android Studio - temporarily turns off Instant Run. -
- -
- If your project is configured for Legacy Multidex—that
- is, when build.gradle
is configured with multiDexEnabled
- true
and minSdkVersion 20
or lower—and you deploy to
- target devices running Android 4.4 (API level 20) or lower, Android Studio
- disables Instant Run.
-
- If minSdkVersion
is set to 21 or higher, Instant Run
- automatically configures your app for multidex. Because Instant Run only
- works with the debug version of your app, you may need to configure your app for
- multidex when deploying your release build variant.
-
- Instrumented tests load both the debug APK and a test APK into the same - process on a test device, allowing control methods to override the normal - lifecycle of the app and perform tests. While running or debugging - instrumented tests, Android Studio does not inject the additional methods - required for Instant Run and turns the feature off. -
- -- While profiling an app, you should disable Instant Run. There is a small - performance impact when using Instant Run and a slightly larger impact when - overriding methods with a hot swap. This performance impact could interfere - with information provided by performance profiling tools. Additionally, the - stub methods generated with each hot swap can complicate stack traces. -
- -- Android Studio temporarily disables the Java Code Coverage Library (JaCoCo) - and ProGuard while using Instant Run. Because Instant Run only works with - debug builds, this does not affect your release build. -
- -- Certain third-party plugins that perform bytecode enhancement may cause - issues with how Instant Run instruments your app. If you experience these - issues, but want to continue using Instant Run, you should disable those - plugins for your debug build variant. You can also help improve compatibility - with third-party plugins by filing a bug. -
- -- Instant Run only instruments your app's main process in order to perform hot - swaps and warm swaps. When pushing code changes to other app processes, such - as changes to a method implementation or an existing resource, Instant Run - performs a cold swap. -
- -- To disable Instant Run: -
- -This section builds on the -Build System Overview and -Build and Running from Android Studio -to show you how to use build variants based on product flavors and build types.
- - -Android Studio projects contain a top-level build file and a build file for each module. The
-build files are called build.gradle
, and they are plain text files that use
-Groovy syntax to configure the build with the elements
-provided by the Android plugin for Gradle. In most cases, you only need to edit the build files
-at the module level. For example, the build file for the app module in the
-BuildSystemExample
project looks like this:
-apply plugin: 'com.android.application' - -android { - compileSdkVersion 19 - buildToolsVersion "19.0.0" - - defaultConfig { - minSdkVersion 8 - targetSdkVersion 19 - versionCode 1 - versionName "1.0" - } - buildTypes { - release { - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - compile project(":lib") - compile 'com.android.support:appcompat-v7:19.0.1' - compile fileTree(dir: 'libs', include: ['*.jar']) -} -- -
apply plugin: 'com.android.application'
applies the Android plugin for Gradle to this build.
-This adds Android-specific build tasks to the top-level build tasks and makes the
-android {...}
element available to specify Android-specific build options.
android {...}
configures all the Android-specific build options:
compileSdkVersion
property specifies the compilation target.The buildToolsVersion
property specifies what version of the build tools
- to use. To install several versions of the build tools, use the SDK Manager.
Note: Always use a build tools version whose major - revision number is higher or equal to that of your compilation target and target SDK.
-The defaultConfig
element configures core settings and
- entries in the manifest file (AndroidManifest.xml
) dynamically from the
- build system. The values in defaultConfig
override those in the manifest
- file.
The configuration specified in the defaultConfig
element applies
- to all build variants, unless the configuration for a build variant overrides some
- of these values.
buildTypes
element controls how to build and package your app.
- By default, the build system defines two build types: debug and
- release. The debug build type includes debugging symbols and is signed with
- the debug key. The release build type is not signed by default.
- In this example the build file configures the release version to use
- ProGuard.The dependencies
element is outside and after the android
element.
-This element declares the dependencies for this module. Dependencies are covered in the following
-sections.
Note: When you make changes to the build files in your project, -Android Studio requires a project sync to import the build configuration changes. Click -Sync Now on the yellow notification bar that appears for Android Studio -to import the changes.
- - - - -The app
module in this example declares three
-dependencies:
-... -dependencies { - // Module dependency - compile project(":lib") - - // Remote binary dependency - compile 'com.android.support:appcompat-v7:19.0.1' - - // Local binary dependency - compile fileTree(dir: 'libs', include: ['*.jar']) -} -- -
Each of these dependencies is described below. The build system adds all the
-compile
dependencies to the compilation classpath and includes them in the final
-package.
The app
module depends on the lib
module, because
-MainActivity
launches LibActivity1
as described in
-Open an Activity from a Library Module.
compile project(":lib")
declares a dependency on the lib
-module of BuildSystemExample
. When you build the app
module,
-the build system assembles and includes the lib
module.
The app
and lib
modules both use the ActionBarActivity
-class from the Android Support Library, so these modules depend on it.
compile 'com.android.support:appcompat-v7:19.0.1'
declares a dependency on
-version 19.0.1 of the Android Support Library by specifying its Maven coordinates. The Android Support
-Library is available in the Android Repository package of the Android SDK. If your
-SDK installation does not have this package, download and install it using the SDK Manager.
Some modules do not use any binary dependencies from the
-local file system. If you have modules that require local binary dependencies, copy the JAR
-files for these dependencies into <moduleName>/libs
inside your project.
compile fileTree(dir: 'libs', include: ['*.jar'])
tells the build system that any
-JAR file inside app/libs
is a dependency and should be included in the compilation
-classpath and in the final package.
For more information about dependencies in Gradle, see -Dependency -Management Basics in the Gradle User Guide.
- -The build system can run
-ProGuard to obfuscate your
-classes during the build process. In BuildSystemExample
, modify the build file for
-the app module to run ProGuard for the release build:
-... -android { - ... - buildTypes { - release { - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} -... -- -
getDefaultProguardFile('proguard-android.txt')
obtains the default ProGuard
-settings from the Android SDK installation. Android Studio adds the module-specific rules file
-proguard-rules.pro
at the root of the module, where you can add custom ProGuard
-rules.
With the Android build system, the applicationId attribute is used to
-uniquely identify application packages for publishing. The application ID is set in the
-android section of the build.gradle
file.
-
- apply plugin: 'com.android.application' - - android { - compileSdkVersion 19 - buildToolsVersion "19.1" - - defaultConfig { - applicationId "com.example.my.app" - minSdkVersion 15 - targetSdkVersion 19 - versionCode 1 - versionName "1.0" - } - ... -- -
Note: The applicationId is specified only in your -{@code build.gradle} file, and not in the AndroidManifest.xml file.
- -When using build variants, the build system enables you to uniquely identify different -packages for each product flavors and build types. The application ID in the build type is added as -a suffix to those specified for the product flavors.
- -- productFlavors { - pro { - applicationId = "com.example.my.pkg.pro" - } - free { - applicationId = "com.example.my.pkg.free" - } - } - - buildTypes { - debug { - applicationIdSuffix ".debug" - } - } - .... -- -
The package name must still be specified in the manifest file. It is used in your source code -to refer to your R class and to resolve any relative activity/service registrations.
- -- -- -package="com.example.app"> -
Note: If you have multiple manifests (for example, a product
-flavor specific manifest and a build type manifest), the package name is optional in those manifests.
-If it is specified in those manifests, the package name must be identical to the package name
-specified in the manifest in the src/main/
folder.
For more information about the build files and process, see -Build System Overview.
- - - -The debug and the release versions of the app differ on whether the application can be -debugged on secure devices and on how the APK is signed. The build system signs the debug -version with a default key and certificate using known credentials to avoid a password prompt at -build time. The build system does not sign the release version unless you explicitly define a -signing configuration for this build. If you do not have a release key, you can generate one as -described in Signing your Applications.
- - -This section describes how the build system can help you create different versions of the same -application from a single project. This is useful when you have a demo version and a paid version -of your app, or if you want to distribute multiple APKs for different device configurations on -Google Play.
- -The build system uses product flavors to create different product versions of your app. -Each product version of your app can have different features or device requirements. The build -system also uses build types to apply different build and packaging settings to each product version. -Each product flavor and build type combination forms a build variant. The build system generates a -different APK for each build variant of your app.
- -This example project consists of the two default build types (debug and release) -and two product flavors for app type (demo and full). For more information on advanced uses of -build variants, see - Build System Overview .
- - -To create different product versions of your app:
- -The rest of this section walks you through these steps in detail using a
-BuildSystemExample
project. You create two flavors of the
-BuildSystemExample
app, a demo flavor and a full flavor. Both flavors share
-MainActivity
, to which you add a new button to launch a new activity,
-SecondActivity
. This new activity is different for each flavor, so you simulate a
-situation where the new activity would have more features in the full flavor than in the demo
-flavor. At the end of the exercise, you end up with two different APKs, one for each flavor.
To define two product flavors, edit the build file for the app module to add the following -configuration:
- --... -android { - ... - defaultConfig { ... } - signingConfigs { ... } - buildTypes { ... } - productFlavors { - demo { - applicationId "com.buildsystemexample.app.demo" - versionName "1.0-demo" - } - full { - applicationId "com.buildsystemexample.app.full" - versionName "1.0-full" - } - } -} -... -- -
The product flavor definitions support the same properties as the defaultConfig
-element. The base configuration for all flavors is specified in defaultConfig
, and each
-flavor overrides any default values. The build file above uses the applicationId
-property to assign a different package name to each flavor: since each flavor definition creates a
-different app, they each need a distinct package name.
Note: To distribute your app using
-Multiple APK Support in
-Google Play, assign the same package name to all variants and give each variant a different
-versionCode
. To distribute different variants of your app as separate apps in Google
-Play, assign a different package name to each variant.
Now you create source folders and add a SecondActivity
to each flavor. To create
-the source directory structure for the demo flavor:
Similarly, create the following directories:
-app/src/demo/java
app/src/demo/res
app/src/demo/res/layout
app/src/demo/res/values
The resulting directory structure looks like figure 1.
- - - - -To add SecondActivity
to the demo
flavor:
To add the layout for SecondActivity
and a strings resource to the demo flavor:
OK
.Replace the contents of the new copy of strings.xml
with the
- following:
-<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="hello_world">Demo version only.</string> -</resources> --
Now you add source folders and SecondActivity
to the full flavor by making a copy
-of the demo
flavor:
Replace the contents of strings.xml under src/full/res/values - with the following:
--<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="hello_world">This is the full version!</string> -</resources> --
Note: From this point on, you could develop
-SecondActivity
independently inside each
-flavor. For example, you could add more features to this activity in the full
flavor.
To work on files from a particular flavor, click on Build Variants on the left -of the IDE window and select the flavor you want to modify in the Build Variants panel, -as shown in figure 2. Android Studio may show errors in source files from flavors other than the -one selected in the Build Variants panel, but this does not affect the outcome of the -build.
- - - - -Since the flavor-specific activity (SecondActivity
) has the same package name and
-activity name in both flavors, you can launch it from the main activity, which is common to all
-flavors. To modify the main activity:
Edit activity_main.xml
and add a new button to
- MainActivity
:
-<LinearLayout ...> - ... - <Button - android:id="@+id/button2" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/button2" - android:onClick="onButton2Clicked"/> -</LinearLayout> --
onButton2Clicked
method to
- MainActivity
.Add the following code to the onButton2Clicked
method of
- MainActivity
:
-public void onButton2Clicked(View view) { - Intent intent = new Intent(this, SecondActivity.class); - startActivity(intent); -} --
Edit the app's manifest to include a reference to SecondActivity
:
-<manifest ...> - <application ...> - ... - <activity - android:name="com.buildsystemexample.app.SecondActivity" - android:label="@string/title_activity_second" > - </activity> - </application> -</manifest> --
Build types represent the build packaging versions generated for each app package. By default, -the debug and release build types are provided. -
- --... -android { - ... - defaultConfig { ... } - signingConfigs { ... } - buildTypes { ... } - productFlavors {...} - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - debug { - debuggable true - } - } -} -... -- -
Note: Although only the release build type appears in -the default build.gradle file, both the release and debug build types are -applied to each build.
- -In this example, the product flavors and build types create the following build variants: -
To build this example, click the Build menu option in Android Studio or invoke
-the assemble
task from the command line.
Note: The Build > Make Project option compiles -all the source files in the entire project that have been modified since the last compilation. The -Build > Rebuild Project option recomplies all the source files in the project.
- -Separate output folders are created for each build variant.
diff --git a/docs/html/tools/building/index.jd b/docs/html/tools/building/index.jd deleted file mode 100644 index b5a56c0c9a4c..000000000000 --- a/docs/html/tools/building/index.jd +++ /dev/null @@ -1,40 +0,0 @@ -page.title=Building and Running Overview -@jd:body - -The Android build process provides project and module build settings so that
-your Android modules are compiled and packaged into .apk
files, the containers
-for your application binaries, based on your build settings. The apk file for each app contains all
-of the information necessary to run your application on a device or emulator, such as compiled
-.dex
files (.class
files converted to Dalvik byte code), a binary version
-of the AndroidManifest.xml
file, compiled resources (resources.arsc
) and
-uncompiled resource files for your application.
To run an application on an emulator or device, the application must be signed using debug or -release mode. You typically want to sign your application in debug mode when you develop and test -your application, because the build system uses a debug key with a known password so you do not have -to enter it every time you build. When you are ready to release the application to Google -Play, you must sign the application in release mode, using your own private key.
- -If you are using Android development tools, the build system can sign the application for you -when build your app for debugging. You must obtain a certificate to sign your app when you build -and app for release. For more information on signing applications, see -Signing Your Applications.
- -The following diagram depicts the components involved in building and running an application:
- - diff --git a/docs/html/tools/building/manifest-merge.jd b/docs/html/tools/building/manifest-merge.jd deleted file mode 100644 index 225358433af6..000000000000 --- a/docs/html/tools/building/manifest-merge.jd +++ /dev/null @@ -1,515 +0,0 @@ -page.title=Manifest Merging -@jd:body - -With Android Studio and Gradle-based builds, each app can
-contain manifest files in multiple locations, such as the src/main/
folder for
-the productFlavor
, libraries, Android ARchive (AAR) bundles of Android Library
-projects, and dependencies. During the build process, manifest merging combines the settings from
-the various AndroidManifest.xml
files included in your app into a single, generated APK
-manifest file for app packaging and distribution. Manifest settings are merged based on the manifest
-priority, determined by the manifest's file location. Building your app merges the
-manifest elements, attributes, and sub-elements from these manifests for the specified
-build variant.
Merge conflicts occur when merged manifests contain the same manifest element but with a
-different attribute value that does not resolve based on the default merge conflict rules.
-Conflict markers and selectors can also define custom merge rules,
-such as allowing an imported library to have a minSdkVersion
higher than the
-version defined in the other higher priority manifests.
The manifest merge priority determines which manifest settings are retained in merge conflicts, -with the settings in higher priority manifest overwriting those in lower priority manifests. -The following list details which manifest settings are are the highest priority during the merge -process:
- -buildType
manifest settings productFlavor
manifest settings src/main/
directory of an app projectManifest merge conflicts are resolved at the XML node and -attribute levels based on the following merge rules.
- -High Priority Element | -Low Priority Element | -Manifest Merge Result | -
---|---|---|
no attribute | -no attribute | -no attribute | -
attribute set to default | -default attribute | -|
attribute set to non-default | -low priority attribute | -|
attribute set to default | -no attribute | -default attribute | -
attribute set to non-default | - -high priority attribute | -|
attribute set to default | -attribute set to default | -default attribute | -
attribute set to default | -attribute set to non-default | -low priority attribute | -
attribute set to non-default | -attribute set to default | -high priority attribute | -
attribute set to non-default | -attribute set to non-default | -Merge if settings match, otherwise causes conflict error. | -
Exceptions to the manifest merge rules:
- -uses-feature android:required;
and
- uses-library android:required
elements default to true
and use
- an OR merge so that any required feature or library is included in the generated APK. <uses-sdk>
- elements, minSdkVersion
and
- targetSdkVersion
, default to a value of 1. When
- merge conflicts occur, the value in the higher priority manifest version is used.minSdkVersion
value higher than the app's
- src/main/
manifest manifest generates an error unless
- the overrideLibrary
conflict marker is used.
-
- Note: If not explicitly declared, the targetSdkVersion
- defaults to the minSdkVersion
value. When no
element is
- present in any manifest or the build.gradle
file, the
- minSdkVersion
defaults to 1.
targetSdkVersion
value lower than the app's
- src/main/
manifest, the manifest merge
- process explicitly grants permissions and ensures that the imported library functions properly. manifest
element only merges with child manifest elements. intent-filter
element is never changed and is always added to the common
- parent node in the merged manifest. Important: After the manifests are merged, the build process
-overrides the final manifest settings with any settings that are also in the
-build.gradle
file. For more details, see
-Configuring Gradle Builds.
Manifest markers and selectors override the default merge rules through
-specific conflict resolutions. For example, use a conflict marker to
-merge a library manifest with a higher minSdkVersion
value than the higher priority
-manifest, or to merge manifests with the same activity but different android:theme
-values.
A merge conflict marker is a special attribute in the Android tools namespace that defines a -specific merge conflict resolution. Create a conflict marker to avoid a merge conflict error for -conflicts not resolved by the default merge rules. Supported merge conflict markers include:
- -merge
replace
strict
merge-only
remove
remove-All
By default, the manifest merge process applies the merge
conflict marker to
-the node level. All declared manifest attributes default to a strict
-merging policy.
To set a merge conflict marker, first declare the namespace in the
-AndroidManifest.xml
file. Then, enter the merge conflict marker in the manifest to
-specify a custom merge conflict action. This example inserts the replace
marker to
-set a replace action to resolve conflicts between the android:icon
and
-android:label
manifest elements.
- -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.tests.flavorlib.app" - xmlns:tools="http://schemas.android.com/tools"> - - <application - android:icon="@drawable/icon" - android:label="@string/app_name" - tools:replace="icon, label"> - ... - - - -- - -
Conflict markers use tools:node
and tools:attr
attributes to
-restrict merge actions at the XML node or attribute level.
The tools:attr
markers use only the restrict
, remove
, and
-replace
merge actions. Multiple tools:attr
marker values can be applied
-to a specific element. For example, use tools:replace="icon, label, theme"
to replace
-lower priority icon
, label
, and theme
attributes.
The overrideLibrary
conflict marker applies to the <uses-sdk>
-manifest declaration and is used to import a library even though the library's
-<uses-sdk>
values, such as minSdkVersion
-are set to different values than those in the other higher priority manifests.
Without this marker, library manifest merge conflicts from the
-<uses-sdk>
values cause the merge process to fail.
This example applies the overrideLibrary
conflict marker to resolve the merge
-conflict between minSdkVersion
values in the src/main/
manifest and an
-imported library manifest.
-
-
-
src/main/
manifest:
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.example.app" - xmlns:tools="http://schemas.android.com/tools"> - ... - <uses-sdk android:targetSdkVersion="22" android:minSdkVersion="2" - tools:overrideLibrary="com.example.lib1, com.example.lib2"/> - ... -- -
Library manifest:
- --<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.example.lib1"> - ... - <uses-sdk android:minSdkVersion="4" /> - ... - </manifest> -- -
Note: The default merge process does not allow importing a library
-with a higher minSdkVersion
than the app's src/main/
manifest unless
-the overrideLibrary
conflict marker is used.
Marker selectors limit a merge action to a specific lower priority manifest. For example, a -marker selector can be used to remove a permission from only one library, while allowing the -same permission from other libraries.
- -This example uses the tools:node
marker to remove the permisionOne
-attribute, while the tools:selector
selector specifies the specific library as
-com.example.lib1. The permisionOne
permission is filtered from only the
-lib1
library manifests.
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.example.app" - xmlns:tools="http://schemas.android.com/tools"> - ... - <permission - android:name="permissionOne" - tools:node="remove" - tools:selector="com.example.lib1"> - ... -- - - -
Manifest merging can also be configured to use manifest placeholders to inject
-property values from the build.gradle
file into the manifest attributes.
Manifest placeholders use the syntax ${name}
for attribute values, where
-name
is the injected build.gradle
property. The build.gradle
-file uses the manifestPlaceholders
property to define the placeholder values.
Note: Unresolved placeholder names in apps cause build failures. -Unresolved placeholder names in libraries generate warnings and need to be resolved when importing -the library into an app.
- -This example shows the manifest placeholder ${applicationId}
used to inject the
-build.gradle
applicationId
property value in to android:name
-attribute value.
Note: Android Studio provides a default
-${applicationId}
placeholder for the build.gradle
-applicationId
value that is not shown in the build file.
-When building an AAR (Android ARchive) package for library modules, do not provide an
-automatic @{applicationId}
placeholder in the
-manifest merge settings.
-Instead, use a different placeholder, such as @{libApplicationId}
and
-provide a value for it if you want to include application Ids in the archive library.
Manifest entry:
- -- -<activity -android:name=".Main"> - <intent-filter> - <action android:name="${applicationId}.foo"> - </action> -</intent-filter> -</activity> - -- - -
Gradle build file:
- --android { - compileSdkVersion 22 - buildToolsVersion "22.0.1" - - productFlavors { - flavor1 { - applicationId = "com.mycompany.myapplication.productFlavor1" - } -} - -- -
Merged manifest value:
- --<action android:name="com.mycompany.myapplication.productFlavor1.foo"> -- - -
The manifest placeholder syntax and build file manifestPlaceholders
-property can be used to inject other manifest values. For properties other than the
-applicationId
, the manifestPlaceholders
property is explicitly declared
-in the build.gradle
file. This example shows the manifest placeholder for injecting
-activityLabel
values.
Gradle build file:
- --android { - defaultConfig { - manifestPlaceholders = [ activityLabel:"defaultName"] - } - productFlavors { - free { - } - pro { - manifestPlaceholders = [ activityLabel:"proName" ] - } - } - -- -
Placeholder in the manifest file:
- --<activity android:name=".MainActivity" android:label="${activityLabel}" > -- -
Note: The placeholder value supports partial value injection,
-for example android:authority="com.acme.${localApplicationId}.foo"
.
When using the GroupableProductFlavor
property, the manifest merge
-priority of any manifests in the product flavor groups follows the order in which the
-product flavor groups are listed in the build file. The manifest merge process creates a single
-merged manifest for the product flavor groups based on the configured build variant.
For example, if a build variant references the product flavors x86
,
-mdpi
, 21
, and paid
from the respective product flavor
-groups ABI
, Density
, API
, and Prod
, listed
-in this order in the build.gradle
file, then the manifest merge process merges the
-manifests in this priority order, which follows how the product flavors are listed in the build
-file.
To illustrate this example, the following table shows how the product flavors are listed for -each product flavor group. This combination of product flavors and groups defines the -build variant.
-Product Flavor Group | -Product Flavor | -
---|---|
ABI | -x86 | -
density | -mdpi | -
API | -22 | -
prod | -paid | -
Manifest merge order:
- -Importing a library that targets an Android runtime with implicitly
-granted permissions may automatically add the permissions to the resulting merged manifest.
-For example, if an application with a targetSdkVersion
of 16 imports a library with a
-targetSdkVersion
of 2, Android Studio adds the WRITE_EXTERNAL_STORAGE
-permission to ensure permission compatibility across the SDK versions.
-
-
Note: More recent Android releases replace implicit -permissions with permission declarations.
- - -This table lists the importing library versions and the declared permissions. - - -Importing this library version | -Declares this permission in the manifest | -
---|---|
targetSdkVersion < 2 |
- WRITE_EXTERNAL_STORAGE |
-
targetSdkVersion < 4 |
- WRITE_EXTERNAL_STORAGE , READ_PHONE_STATE |
-
Declared WRITE_EXTERNAL_STORAGE |
- READ_EXTERNAL_STORAGE |
-
targetSdkVersion < 16 and using the READ_CONTACTS
- permission |
- READ_CALL_LOG |
-
targetSdkVersion < 16 and using the WRITE_CONTACTS
- permission |
- WRITE_CALL_LOG |
-
During the build process, the manifest merge process stores a record of each merge transaction
-in the manifest-merger-<productFlavor>-report.txt
file in the module
-build/outputs/logs
folder. A different log file is generated for each of the
-module's build variants.
When a manifest merge build error occurs, the merge process records the error message
-describing the merge conflict in the log file. For example, the
-android:screenOrientation
merge conflict between the following manifests causes
-a build error.
Higher priority manifest declaration:
- --<activity - android:name="com.foo.bar.ActivityOne" - android:screenOrientation="portrait" - android:theme="@theme1"/> -- -
Lower priority manifest declaration:
- --<activity - android:name="com.foo.bar.ActivityOne" - android:screenOrientation="landscape"/> -- -
Error log:
- --/project/app/src/main/AndroidManifest.xml:3:9 Error: - Attribute activity@screenOrientation value=(portrait) from AndroidManifest.xml:3:9 - is also present at flavorlib:lib1:unspecified:3:18 value=(landscape) - Suggestion: add 'tools:replace="icon"' to- - diff --git a/docs/html/tools/building/multidex.jd b/docs/html/tools/building/multidex.jd deleted file mode 100644 index 7d05fb93de4a..000000000000 --- a/docs/html/tools/building/multidex.jd +++ /dev/null @@ -1,488 +0,0 @@ -page.title=Building Apps with Over 64K Methods -page.tags="65536","references","max","65k","dex","64k","multidex","multi-dex","methods" - -@jd:body - -element at AndroidManifest.xml:1:5 to override -
- As the Android platform has continued to grow, so has the size of Android apps. When your - application and the libraries it references reach a certain size, you encounter build errors that - indicate your app has reached a limit of the Android app build architecture. Earlier versions of - the build system report this error as follows: -
- --Conversion to Dalvik format failed: -Unable to execute dex: method ID not in [0, 0xffff]: 65536 -- -
- More recent versions of the Android build system display a different error, which is an - indication of the same problem: -
- --trouble writing output: -Too many field references: 131000; max is 65536. -You may try using --multi-dex option. -- -
- Both these error conditions display a common number: 65,536. This number is significant in that - it represents the total number of references that can be invoked by the code within a single - Dalvik Executable (dex) bytecode file. If you have built an Android app and received this error, - then congratulations, you have a lot of code! This document explains how to move past this - limitation and continue building your app. -
- -- Note: The guidance provided in this document supersedes the guidance given in - the Android Developers blog post Custom Class - Loading in Dalvik. -
- - -- Android application (APK) files contain executable bytecode files in the form - of Dalvik - Executable (DEX) files, which contain the compiled code used to run your app. - The Dalvik Executable specification limits the total number of methods that - can be referenced within a single DEX file to 65,536—including Android - framework methods, library methods, and methods in your own code. In the - context of computer science, the term Kilo, K, denotes 1024 (or - 2^10). Because 65,536 is equal to 64 X 1024, this limit is referred to as the - '64K reference limit'. -
- -- Getting past this limit requires that you configure your app build process to - generate more than one DEX file, known as a multidex configuration. -
- -- Versions of the platform prior to Android 5.0 (API level 21) use the Dalvik - runtime for executing app code. By default, Dalvik limits apps to a single - classes.dex bytecode file per APK. In order to get around this limitation, - you can use the multidex support - library, which becomes part of the primary DEX file of your app and then - manages access to the additional DEX files and the code they contain. -
- -
- Note: If your project is configured for multidex with
- minSdkVersion 20
or lower, and you deploy to target devices
- running Android 4.4 (API level 20) or lower, Android Studio disables Instant Run.
-
- Android 5.0 (API level 21) and higher uses a runtime called ART which - natively supports loading multiple dex files from application APK files. ART - performs pre-compilation at application install time which scans for - classes(..N).dex files and compiles them into a single .oat file for - execution by the Android device. For more information on the Android 5.0 - runtime, see Introducing - ART. -
- -
- Note: While using Instant Run,
- Android Studio automatically configures your app for multidex when your app's
- minSdkVersion
is set to 21 or higher. Because Instant Run only
- works with the debug version of your app, you still need to configure your
- release build for multidex to avoid the 64K limit.
-
- Before configuring your app to enable use of 64K or more method references, you should take steps - to reduce the total number of references called by your app code, including methods defined by - your app code or included libraries. The following strategies can help you avoid hitting the dex - reference limit: -
- -- Using these techniques can help you avoid the build configuration changes required to enable more - method references in your app. These steps can also decrease the size of your APKs, which is - particularly important for markets where bandwidth costs are high. -
- - -- The Android plugin for Gradle available in Android SDK Build Tools 21.1 and higher supports - multidex as part of your build configuration. Make sure you update the Android SDK Build Tools - tools and the Android Support Repository to the latest version using the SDK Manager before attempting to configure your app - for multidex. -
- -- Setting up your app development project to use a multidex configuration requires that you make a - few modifications to your app development project. In particular you need to perform the - following steps: -
- -
- Modify the module-level build.gradle
file configuration to
- include the support library and enable multidex output, as shown in the
- following code snippet:
-
-android { - compileSdkVersion 21 - buildToolsVersion "21.1.0" - - defaultConfig { - ... - minSdkVersion 14 - targetSdkVersion 21 - ... - - // Enabling multidex support. - multiDexEnabled true - } - ... -} - -dependencies { - compile 'com.android.support:multidex:1.0.0' -} -- -
- In your manifest add the {@link android.support.multidex.MultiDexApplication} class from the - multidex support library to the application element. -
- --<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.example.android.multidex.myapplication"> - <application - ... - android:name="android.support.multidex.MultiDexApplication"> - ... - </application> -</manifest> -- -
- When these configuration settings are added to an app, the Android build tools construct a - primary dex (classes.dex) and supporting (classes2.dex, classes3.dex) as needed. The build system - will then package them into an APK file for distribution. -
- -- Note: If your app uses extends the {@link android.app.Application} class, you - can override the attachBaseContext() method and call MultiDex.install(this) to enable multidex. - For more information, see the {@link android.support.multidex.MultiDexApplication} reference - documentation. -
- -- The multidex support library has some known limitations that you should be aware of and test for - when you incorporate it into your app build configuration: -
- -- A multidex configuration requires significantly increased build processing time because the build - system must make complex decisions about what classes must be included in the primary DEX file - and what classes can be included in secondary DEX files. This means that routine builds performed - as part of the development process with multidex typically take longer and can potentially slow - your development process. -
- -- In order to mitigate the typically longer build times for multidex output, you should create two - variations on your build output using the Android plugin for Gradle - - {@code productFlavors}: a development flavor and a production flavor. -
- -- For the development flavor, set a minimum SDK version of 21. This setting generates multidex - output much faster using the ART-supported format. For the release flavor, set a minimum SDK - version which matches your actual minimum support level. This setting generates a multidex APK - that is compatible with more devices, but takes longer to build. -
- -- The following build configuration sample demonstrates the how to set up these flavors in a Gradle - build file: -
- --android { - productFlavors { - // Define separate dev and prod product flavors. - dev { - // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin - // to pre-dex each module and produce an APK that can be tested on - // Android Lollipop without time consuming dex merging processes. - minSdkVersion 21 - } - prod { - // The actual minSdkVersion for the application. - minSdkVersion 14 - } - } - ... - buildTypes { - release { - runProguard true - proguardFiles getDefaultProguardFile('proguard-android.txt'), - 'proguard-rules.pro' - } - } -} -dependencies { - compile 'com.android.support:multidex:1.0.0' -} -- -
- After you have completed this configuration change, you can use the devDebug
variant
- of your app, which combines the attributes of the dev
productFlavor and the
- debug
buildType. Using this target creates a debug app with proguard disabled,
- multidex enabled, and minSdkVersion set to Android API level 21. These settings cause the Android
- gradle plugin to do the following:
-
- These settings result in fast, incremental builds, because only the dex files of modified modules - are recomputed and repackaged into the APK file. The APK that results from these builds can be - used to test on Android 5.0 devices only. However, by implementing the configuration as a flavor, - you preserve the ability to perform normal builds with the release-appropriate minimum SDK level - and proguard settings. -
- -
- You can also build the other variants, including a prodDebug
variant
- build, which takes longer to build, but can be used for testing outside of development.
- Within the configuration shown, the prodRelease
variant would be the final testing
- and release version. If you are executing gradle tasks from the command line, you can use
- standard commands with DevDebug
appended to the end (such as ./gradlew
- installDevDebug
). For more information about using flavors with Gradle tasks, see the
- Gradle Plugin User
- Guide.
-
- Tip: You can also provide a custom manifest, or a custom application class for each - flavor, allowing you to use the support library MultiDexApplication class, or calling - MultiDex.install() only for the variants that need it. -
- - -- Build variants can be very useful for managing the build process when using multidex. Android - Studio allows you to select these build variants in the user interface. -
- -- To have Android Studio build the "devDebug" variant of your app: -
- -- Note: The option to open this window is only available after you have - successfully synchronized Android Studio with your Gradle build file using the Tools > - Android > Sync Project with Gradle Files command. -
- - -- When using instrumentation tests with multidex apps, additional configuration is required to - enable the test instrumentation. Because the location of code for classes in multidex apps is not - within a single DEX file, instrumentation tests do not run properly unless configured for - multidex. -
- -- To test a multidex app with instrumentation tests, configure the - - MultiDexTestRunner from the multidex testing support library. The following sample - {@code build.gradle} file demonstrates how to configure your build to use this test runner: -
- --android { - defaultConfig { - ... - testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner" - } -} -- -
- Note: With Android Plugin for Gradle versions lower than 1.1, you need to add
- the following dependency for multidex-instrumentation
:
-
-dependencies { - androidTestCompile('com.android.support:multidex-instrumentation:1.0.1') { - exclude group: 'com.android.support', module: 'multidex' - } -} -- - - -
- You may use the instrumentation test runner class directly or extend it to fit your testing - needs. Alternatively, you can override onCreate in existing instrumentations like this: -
- --public void onCreate(Bundle arguments) { - MultiDex.install(getTargetContext()); - super.onCreate(arguments); - ... -} -- -
- Note: Use of multidex for creating a test APK is not currently supported. -
diff --git a/docs/html/tools/building/plugin-for-gradle.jd b/docs/html/tools/building/plugin-for-gradle.jd deleted file mode 100644 index aed1af2d61b8..000000000000 --- a/docs/html/tools/building/plugin-for-gradle.jd +++ /dev/null @@ -1,450 +0,0 @@ -page.title=Android Plugin for Gradle - -@jd:body - -The Android build system consists of an Android plugin for Gradle. -Gradle is an advanced build toolkit that manages -dependencies and allows you to define custom build logic. Android Studio uses a Gradle wrapper -to fully integrate the Android plugin for Gradle. The Android plugin for Gradle also runs -independent of Android Studio. This means that you can build your Android apps from within Android -Studio and from the command line on your machine or on machines where Android Studio is not installed -(such as continuous integration servers).
- -The output of the build is the same whether you are building a project from the command line, -on a remote machine, or using Android Studio.
- -The build configuration for your project is defined inside build.gradle
files,
-which are plain text files that use the syntax and options from Gradle and the Android plugin
-to configure the following aspects of your build:
apk
files has a different
- application name, minimum SDK version, or target SDK version. When multiple manifests are
- present, manifest settings are merged in priority of buildType and productFlavor,
- /main
manifest, and the library manifests.Gradle build files use Domain Specific Language (DSL) to describe and manipulate the build logic -through Groovy syntax. Groovy is a dynamic -language that you can use to define custom build logic and to interact with the Android-specific -elements provided by the Android plugin for Gradle.
- -The Android Studio build system assumes sensible defaults for the project structure -and other build options. If your project adheres to these conventions, your Gradle build files are -very simple. When some of these conventions do not apply to your project, the flexibility of the -build system allows you to configure almost every aspect of the build process. For example, if -you need to replace the default source folders in your module directories, you can configure a new -directory structure in the module's build file.
- -A project in Android Studio represents the top-level Android development structure. -Android Studio projects contain project files and one or more application modules. A -module is a component of your app that you can build, test, or debug independently. -Modules contain the source code and resources for your apps. Android Studio projects can contain -several kinds of modules:
- -Android Studio projects contain a top-level project Gradle build file that allows you to add the -configuration options common to all application modules in the project. Each application module -also has its own build.gradle file for build settings specific to that module.
- -By default, the project-level Gradle file uses buildscript to define the Gradle -repositories and dependencies. This allows different projects to use different -Gradle versions. Supported repositories include JCenter, Maven Central, or Ivy. This example -declares that the build script uses the JCenter repository and a classpath dependency artifact -that contains the Android plugin for Gradle version 1.0.1. -
--
-buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:1.0.1' - - // NOTE: Do not place your application dependencies here: they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - jcenter() - } -} -- -
Note: The SDK location for the Android Studio project is defined in
-the local.properties file in the sdk.dir
setting or through an
-ANDROID_HOME
environment variable.
The application module Gradle build file allows you to configure module build settings,
-including overriding the src/main
manifest settings and setting custom packaging
-options.
This example applies the Android plugin, uses the default configuration to override several -manifest properties, creates two build types: release and debug, and declares several dependencies. -
- --apply plugin: 'com.android.application' - -android { - compileSdkVersion 20 - buildToolsVersion "20.0.0" - - defaultConfig { - applicationId "com.mycompany.myapplication" - minSdkVersion 13 - targetSdkVersion 20 - versionCode 1 - versionName "1.0" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - debug { - debuggable true - } - } -} - -dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:20.0.0' - compile project(path: ':app2, configuration: 'android-endpoints') -} -- - -
Note: You can inject custom build logic for property values defined -by a function that gets called by the property, for example: -
-def computeVersionName() { - ... -} - -android { - defaultConfig { - versionName computeVersionName() - ... - } -} -- - - - -
The Android Studio build system manages project dependencies and supports module dependencies, -local binary dependencies, and remote binary dependencies.
- -An application module can include in its build file a list of other modules it depends on. - When you build this module, the build system assembles and includes the required - modules.
If you have binary archives in your local filesystem that a module depends on, such as - JAR files, you can declare these dependencies in the build file for that module.
When some of your dependencies are available in a remote repository, you do not have - to download them and copy them into your project. The Android Studio build system supports - remote dependencies from repositories, such as Maven, - and dependency managers, such as Ivy.
-Many popular software libraries and tools are available in public Maven repositories.
- For these dependencies you only have to specify their Maven coordinates, which uniquely
- identify each element in a remote repository. The format for Maven coordinates used in the
- build system is group:name:version
. For example, the Maven coordinates for
- version 16.0.1 of the Google Guava libraries are
- com.google.guava:guava:16.0.1
.
The Maven Central Repository is widely used to - distribute many libraries and tools.
-The Android Studio build system defines a hierarchical set of build tasks: the top-level or -anchor tasks invoke dependent tasks to produce their collective build outcomes. The top-level build -tasks are:
- -Builds the project output.
Runs checks and tests.
Runs both assemble and check.
Performs the clean.
The Android plugin provides the connectedCheck and deviceCheck tasks -for checks run on connected, emulated, and remote devices. Gradle tasks can be viewed by clicking -the Gradle tab in the right margin.
- -You can view the list of available tasks and invoke any task from Android Studio and from -the command line, as described in -Building and Running from Android Studio -and Build the project from -the command line.
- -Android Studio projects contain the Gradle wrapper, which consists of:
- -Note: You should submit all of these files to your source -control system.
- -Using the Gradle wrapper (instead of the local Gradle installation) ensures that -you always run the version of Gradle defined in the local.properties file. To configure your -project to use a newer version of Gradle, edit the properties file and specify the new version there. -
- -Android Studio reads the properties file from the Gradle wrapper directory inside your project -and runs the wrapper from this directory, so you can seamlessly work with multiple projects -that require different versions of Gradle.
- -Note: Android Studio does not use the shell scripts, so any -changes you make to them won't work when building from the IDE. You should define your custom -logic inside Gradle build files instead.
- -You can run the shell scripts to build your project from the command line on your development -machine and on other machines where Android Studio is not installed.
- -Caution: When you create a project, only use the Gradle wrapper -scripts and JAR from a trusted source, such as those generated by Android Studio.
- - -Each version of your app is represented in the build system by a build variant. -Build variants are combinations of product flavors and build types. Product flavors represent -product build versions of an app, such as free and paid. Build types represent the build -packaging versions generated for each app package, such as debug and release. The build system -generates APKs for each combination of product flavor and build type.
- -By default, Android Studio defines default configuration settings, defaultConfig
in
-the build.gradle file, and two build types (debug and release). This creates two
-build variants, debug and release, and the build system generates an
-APK for each variant.
Adding two product flavors, demo and full along -with the default build types debug and release generates four build variants, -each with its own customized configuration:
- -The priority of the merge order from lowest to highest is libraries/dependencies -> main src -> -productFlavor -> buildType.
- - -Some projects have complex combinations of features along more than one dimension, but they -still represent the same app. For example, in addition to having a demo and a full version of the -app, some games may contain binaries specific to a particular CPU/ABI. The flexibility of -the build system makes it possible to generate the following build variants for such a project:
- -This project would consist of two build types (debug and release) -and two dimensions of product flavors, one for app type (demo or full) and one for -CPU/ABI (x86, ARM, or MIPS).
- - -To build each version of your app, the build system combines source code and -resources from:
- -src/main/
- the main source directory (the default configuration common to all
- variants)src/<buildType>/
- the src/<productFlavor>/
- the Note: The build type and product flavor source directories are optional, -as Android Studio does not create these directories for you. You should create these directories -as you add build types and product flavors to the build configuration files. The build system does not -use these directories if they are not present.
- -For projects that do not define any flavors, the build system uses the defaultConfig -settings, the main app directory and the default build type directories. For example, to generate -the default debug and release build variants in projects with no product flavors, -the build system uses:
-src/main/
(default configuration)src/release/
(build type)src/debug/
(build type)For projects that define a set of product flavors, the build system merges the build type, product -flavor and main source directories. For example, to generate the full-debug build variant, -the build system merges the build type, product flavor and main directories:
-src/main/
(default configuration)src/debug/
(build type)src/full/
(flavor)For projects that use flavor dimensions, the build system merges one flavor source directory per -dimension. For example, to generate the arm-demo-release build variant, the build system -merges:
-src/main/
(default configuration)src/release/
(build type)src/demo/
(flavor - app type dimension)src/arm/
(flavor - ABI dimension)The source code from these directories is used together to generate the output for a build -variant. You can have classes with the same name in different directories as long as those -directories are not used together in the same variant.
- -The build system also merges all the manifests into a single manifest, so each build variant -can define different components or permissions in the final manifest. The manifest merge priority -from lowest to highest is libraries/dependencies -> main src -> productFlavor -> buildType.
- -The build system merges all the resources from the all the source directories. If different -folders contain resources with the same name for a build variant, the priority order is the -following: build type resources override those from the product flavor, which override the -resources in the main source directory, which override those in any libraries.
- -Note: Build variants enable you to reuse common activities, -application logic, and resources across different versions of your app.
- - diff --git a/docs/html/tools/debugging/annotations.jd b/docs/html/tools/debugging/annotations.jd deleted file mode 100644 index fbdb9e4bbfd5..000000000000 --- a/docs/html/tools/debugging/annotations.jd +++ /dev/null @@ -1,377 +0,0 @@ -page.title=Improving Code Inspection with Annotations -@jd:body - -Using code inspections tools such as lint can help -you find problems and improve your code, but inspection tools can only infer so much. Android -resource ids, for example, use an {@code int} to identify strings, graphics, colors and other -resource types, so inspection tools cannot tell when you have specified a string resource where -you should have specified a color. This situation means that your app may render incorrectly or -fail to run at all, even if you use code inspection.
- -Annotations allow you to provide hints to code inspections tools like {@code lint}, to help -detect these, more subtle code problems. They are added as metadata tags that you attach to -variables, parameters, and return values to inspect method return values, passed parameters, and -local variables and fields. When used with code inspections tools, annotations can help you detect -problems, such as null pointer exceptions and resource type -conflicts.
- -For more information on enabling lint inspections -and running lint, -see Improving Your Code with lint.
- -Android supports a variety of annotations for insertion in the methods, parameters, and return -values in your code, for example:
- -R.string
- resource.Drawable
- resource. Color
- resource. Interpolator
- resource. R.
- resource. @UiThread
For a complete list of the supported annotations, either examine the contents of the
-{@link android.support.annotation Support-Annotations} library or use the
-auto-complete feature to display the available options for the import
-android.support.annotation.
statement. The
- SDK Manager packages the
-{@link android.support.annotation Support-Annotations} library in the Android Support Repository
-for use with Android Studio and in the Android
-Support Library for use with other Android
-development tools.
To add annotations to your code, first add a dependency to the
-{@link android.support.annotation Support-Annotations} library. In Android Studio,
-add the dependency using the File > Project Structure > Dependencies menu
-option or your build.gradle
file. The following example shows how to add the
-{@link android.support.annotation Support-Annotations} library dependency in the
-build.gradle
file:
-dependencies { - compile 'com.android.support:support-annotations:22.2.0' -} -- - -
The {@link android.support.annotation Support-Annotations} library is decorated with the -supported annotations so using this library's methods and resources automatically checks the code -for potential problems.
- -If you include annotations in a library and use the
-Android Plugin for Gradle
-to build an Android ARchive (AAR) artifact of that library, the annotations are included as part
-of the artifact in XML format in the annotations.zip
file.
To start a code inspection from Android Studio, which includes validating annotations and -automatic lint checking, select -Analyze > Inspect Code from the menu options. Android Studio displays conflict -messages throughout the code to indication annotation conflicts and suggest possible -resolutions.
- - -Add {@link android.support.annotation.Nullable @Nullable} and -{@link android.support.annotation.NonNull @NonNull} annotations to check -the nullness of a given variable, parameter, or return value. For example, if a local variable -that contains a null value is passed as a parameter to a method with the -{@link android.support.annotation.NonNull @NonNull} annotation -attached to that parameter, building the code generates a warning indicating a non-null conflict.
- -This example attaches the {@link android.support.annotation.NonNull @NonNull} annotation to
-the context
and attrs
parameters to check that the passed parameter
-values are not null.
-import android.support.annotation.NonNull; -... - - /** Add support for inflating the <fragment> tag. */ - @NonNull - @Override - public View onCreateView(String name, @NonNull Context context, - @NonNull AttributeSet attrs) { - ... - } -... -- -
Note: Android Studio supports running a nullability analysis to -automatically infer and insert nullness annotations in your code. For more information about -inferring nullability in Android Studio, see -Annotations in Android Studio.
- - -Validating resource types can be useful as Android references to resources, such as
-Drawables
and
-R.string
resources, are
-passed as integers. Code that expects a parameter to reference a specific type of resource, for
-example Drawables
,
-can be passed the expected reference type of int
, but actually reference a different
-type of resource, such as a R.string
resource.
For example, add {@link android.support.annotation.StringRes @StringRes} annotations to check
-that a resource parameter contains a
-R.string
-reference. During code inspection, the annotation generates a warning if a R.string
-reference is not passed in the parameter.
This example attaches the {@link android.support.annotation.StringRes @StringRes}
-annotation to the resId
parameter to validate that it is really a string resource.
-import android.support.annotation.StringRes; -... - public abstract void setTitle(@StringRes int resId); - ... -- - -
Annotations for the other resource types, such as -{@link android.support.annotation.DrawableRes @DrawableRes}, -{@link android.support.annotation.DimenRes @DimenRes}, -{@link android.support.annotation.ColorRes @ColorRes}, and -{@link android.support.annotation.InterpolatorRes @InterpolatorRes} can be added using -the same annotation format and run during the code inspection.
- - - - -Thread annotations check if a method is called from a specific type of -thread. The following thread -annotations are supported:
-@UiThread
@MainThread
@WorkerThread
@BinderThread
-Note: The @MainThread
-and the @UiThread
annotations are interchangeable so
-methods calls from either thread type are allowed for these annotations.
If all methods in a class share the same threading requirement, you can add a single -thread -annotation to the class to verify that all methods in the class are called from the same type of -thread.
- -A common use of the thread -annotation is to validate method overrides in the -AsyncTask class as this class performs -background operations and publishes results only on the UI -thread.
- - - -Use the @IntRange
,
-@FloatRange
, and
-@Size
annotations to validate the values of passed
-parameters.
The @IntRange
annotation validates that the parameter
-value is within a specified range. The following example ensures that the alpha
-parameter contains an integer value from 0 to 255:
-public void setAlpha(@IntRange(from=0,to=255) int alpha) { … } -- -
The @FloatRange
annotation checks that the parameter
-value is within a specified range of floating point values. The following example ensures that the
-alpha
parameter contains a float value from 0.0 to 1.0:
-public void setAlpha(@FloatRange(from=0.0, to=1.0) float alpha) {...} -- -
The @Size
annotation checks the size of a collection or
-array, as well as the length of a string. For example, use the @Size(min=1)
-annotation to check if a collection is not empty, and the @Size(2)
annotation to
-validate that an array contains exactly two values. The following example ensures that the
-location
array contains at least one element:
-int[] location = new int[3]; -button.getLocationOnScreen(@Size(min=1) location); -- - -
Use the @RequiresPermission
annotation to
-validate the permissions of the caller of a method. To check for a single permission from a
-list the valid permissions, use the anyOf
attribute. To check for a set of
-permissions, use the allOf
attribute. The following example annotates the
-setWallpaper
method to ensure that the caller of the method has the
-permission.SET_WALLPAPERS
permission.
-@RequiresPermission(Manifest.permission.SET_WALLPAPER) -public abstract void setWallpaper(Bitmap bitmap) throws IOException; -- -
This example requires the caller of the {@code copyFile()} method to have both read and write -permissions to external storage:
--@RequiresPermission(allOf = { - Manifest.permission.READ_EXTERNAL_STORAGE, - Manifest.permission.WRITE_EXTERNAL_STORAGE}) -public static final void copyFile(String dest, String source) { - ... -} -- -
Use the @CheckResults
annotation to
-validate that a method's result or return value is actually used. The following example annotates
-the checkPermissions
method to ensure the return value of the method is actually
-referenced. It also names the
-enforcePermission
-method as a method to be suggested to the developer as a replacement.
-@CheckResult(suggest="#enforcePermission(String,int,int,String)") -public abstract int checkPermission(@NonNull String permission, int pid, int uid); -- -{@link android.support.annotation.StringDef @StringDef} - - -
Use the @CallSuper
annotation to validate that an
-overriding method calls the super implementation of the method. The following example annotates
-the onCreate
method to ensure that any overriding method implementations call
-super.onCreate()
.
-@CallSuper -protected void onCreate(Bundle savedInstanceState) { -} -- - - -
Use the {@link android.support.annotation.IntDef @IntDef} and -{@link android.support.annotation.StringDef @StringDef} annotations -so you can create enumerated annotations of integer and string sets to validate other types of code -references, such as passing references to a set of constants.
- -The following example illustrates the steps to create an enumerated annotation that ensures -a value passed as a method parameter references one of the defined constants.
- --import android.support.annotation.IntDef; -... -public abstract class ActionBar { - ... - //Define the list of accepted constants - @IntDef({NAVIGATION_MODE_STANDARD, NAVIGATION_MODE_LIST, NAVIGATION_MODE_TABS}) - - //Tell the compiler not to store annotation data in the- -.class
file - @Retention(RetentionPolicy.SOURCE) - - //Declare theNavigationMode
annotation - public @interface NavigationMode {} - - //Declare the constants - public static final int NAVIGATION_MODE_STANDARD = 0; - public static final int NAVIGATION_MODE_LIST = 1; - public static final int NAVIGATION_MODE_TABS = 2; - - //Decorate the target methods with the annotation - @NavigationMode - public abstract int getNavigationMode(); - - //Attach the annotation - public abstract void setNavigationMode(@NavigationMode int mode); - -
When you build this code, a warning is generated if the mode
parameter does
-not reference one of the defined constants (NAVIGATION_MODE_STANDARD
,
-NAVIGATION_MODE_LIST
, or NAVIGATION_MODE_TABS
).
You can also define an annotation with a flag
to check if a parameter
-or return value references a valid pattern. This example creates the
-DisplayOptions
annotation with a list of valid DISPLAY_
constants.
-import android.support.annotation.IntDef; -... - -@IntDef(flag=true, value={ - DISPLAY_USE_LOGO, - DISPLAY_SHOW_HOME, - DISPLAY_HOME_AS_UP, - DISPLAY_SHOW_TITLE, - DISPLAY_SHOW_CUSTOM -}) -@Retention(RetentionPolicy.SOURCE) -public @interface DisplayOptions {} - -... -- -
When you build code with an annotation flag, a warning is generated if the decorated parameter -or return value does not reference a valid pattern.
- - diff --git a/docs/html/tools/debugging/ddms.jd b/docs/html/tools/debugging/ddms.jd deleted file mode 100644 index 9ff71222c820..000000000000 --- a/docs/html/tools/debugging/ddms.jd +++ /dev/null @@ -1,312 +0,0 @@ -page.title=Using DDMS -parent.title=Debugging -parent.link=index.html -@jd:body - -Android Studio includes a debugging tool called the Dalvik Debug Monitor Server (DDMS), which - provides port-forwarding services, screen capture on the device, thread and heap information on - the device, logcat, process, and radio state information, incoming call and SMS spoofing, - location data spoofing, and more. This page provides a modest discussion of DDMS features; it is - not an exhaustive exploration of all the features and capabilities.
- -DDMS is integrated into Android Studio. To use it, launch the - Android Device Monitor, and click the - DDMS menu button. DDMS works with both the emulator and a - connected device. If both are connected and running simultaneously, DDMS defaults to the emulator.
- - -On Android, every application runs in its own process, each of which runs in its own virtual machine - (VM). Each VM exposes a unique port that a debugger can attach to.
- -When DDMS starts, it connects to adb.
- When a device is connected, a VM monitoring service is created between
- adb
and DDMS, which notifies DDMS when a VM on the device is started or terminated. Once a VM
- is running, DDMS retrieves the VM's process ID (pid), via adb
, and opens a connection to the
- VM's debugger, through the adb daemon (adbd) on the device. DDMS can now talk to the VM using a
- custom wire protocol.
DDMS assigns a debugging port to each VM on the device. Typically, - DDMS assigns port 8600 for the first debuggable VM, the next on 8601, and so on. When a debugger - connects to one of these ports, all traffic is forwarded to the debugger from the associated - VM. You can only attach a single debugger to a single port, but DDMS can handle multiple, attached - debuggers.
- -By default, DDMS also listens on another debugging port, the DDMS "base port" (8700, by default). - The base port is a port forwarder, which can accept VM traffic from any debugging port and forward - it to the debugger on port 8700. This allows you to attach one debugger to port 8700, and debug - all the VMs on a device. The traffic that is forwarded is determined by the currently selected process - in the DDMS Devices view.
- -The following screenshot shows a typical DDMS screen. If you are starting DDMS from
- the command line, the screen is slightly different, but much of the functionality is identical.
- Notice that the highlighted process, com.android.email
, that is running in the emulator
- has the debugging port 8700 assigned to it as well as 8606. This signifies that DDMS is currently
- forwarding port 8606 to the static debugging port of 8700.
If you are using the command line, read Configuring - your IDE to attach to the debugging port, for more information on attaching your - debugger.
- -Tip: You can set a number of DDMS preferences in
- File > Preferences. Preferences are saved to
- $HOME/.android/ddms.cfg
.
Known debugging issues with Dalvik
- Debugging an application in the Dalvik VM should work the same as it does in other VMs. However,
- when single-stepping out of synchronized code, the "current line" cursor may jump to the last
- line in the method for one step.
DDMS allows you to view how much heap memory a process is using. This information is useful in - tracking heap usage at a certain point of time during the execution of your application.
-To view heap usage for a process:
-DDMS provides a feature to track objects that are being allocated to memory and to see which - classes and threads are allocating the objects. This allows you to track, in real time, where - objects are being allocated when you perform certain actions in your application. This - information is valuable for assessing memory usage that can affect application performance. -
- -To track memory allocation of objects:
-DDMS provides a File Explorer tab that allows you to view, copy, and delete files on the - device. This feature is useful in examining files that are created by your application or if you - want to transfer files to and from the device.
- -To work with an emulator or device's file system:
-The Threads tab in DDMS shows you the currently running threads for a selected process.
- -Method profiling is a means to track certain metrics about a method, such as number of calls, - execution time, and time spent executing the method. If you want more granular control over - where profiling data is collected, use the {@link android.os.Debug#startMethodTracing()} and - {@link android.os.Debug#stopMethodTracing()} methods. For more information about generating trace logs, see - Profiling and Debugging UIs.
- -Before you start method profiling in DDMS, be aware of the following restrictions:
-To start method profiling:
-In Android 4.0, the DDMS (Dalvik Debug Monitor Server) includes a Detailed -Network Usage tab that makes it possible to track when your application is -making network requests. Using this tool, you can monitor how and when your app -transfers data and optimize the underlying code appropriately. You can also -distinguish between different traffic types by applying a “tag” to network -sockets before use.
- -These tags are shown in a stack area chart in DDMS, as shown in figure 2:
- - - - -By monitoring the frequency of your data transfers, and the amount of data -transferred during each connection, you can identify areas of your application -that can be made more battery-efficient. Generally, you should look for -short spikes that can be delayed, or that should cause a later transfer to be -pre-empted.
- -To better identify the cause of transfer spikes, the -{@link android.net.TrafficStats} API allows you -to tag the data transfers occurring within a thread using {@link -android.net.TrafficStats#setThreadStatsTag setThreadStatsTag()}, followed -by manually tagging (and untagging) individual sockets using {@link -android.net.TrafficStats#tagSocket tagSocket()} and {@link -android.net.TrafficStats#untagSocket untagSocket()}. For example:
- -TrafficStats.setThreadStatsTag(0xF00D); -TrafficStats.tagSocket(outputSocket); -// Transfer data using socket -TrafficStats.untagSocket(outputSocket);- -
Alternatively, the {@link java.net.URLConnection} APIs included in the platform -automatically tag sockets internally based on the active tag (as identified by -{@link android.net.TrafficStats#getThreadStatsTag getThreadStatsTag()}). -These APIs correctly tag/untag sockets when recycled through -keep-alive pools. In the following example, -{@link android.net.TrafficStats#setThreadStatsTag setThreadStatsTag()} -sets the active tag to be {@code 0xF00D}. -There can only be one active tag per thread. -That is the value that will -be returned by {@link android.net.TrafficStats#getThreadStatsTag getThreadStatsTag()} -and thus used by the HTTP client to tag sockets. The {@code finally} statement -invokes -{@link android.net.TrafficStats#clearThreadStatsTag clearThreadStatsTag()} -to clear the tag.
- -TrafficStats.setThreadStatsTag(0xF00D); - try { - // Make network request using your http client. - } finally { - TrafficStats.clearThreadStatsTag(); -}- -
Socket tagging is supported in Android 4.0, but real-time stats will only be -displayed on devices running Android 4.0.3 or higher.
- -LogCat is integrated into DDMS, and outputs the messages that you print out using the {@link android.util.Log} - class along with other system messages such as stack traces when exceptions are thrown. View the - Reading and - Writing Log Messages. topic for more information on how to log messages to the LogCat.
- -When you have set up your logging, you can use the LogCat feature of DDMS to filter certain - messages with the following buttons:
- -You can also setup your own custom filter to specify more details such as filtering messages - with the log tags or with the process id that generated the log message. The add filter, - edit filter, and delete filter buttons let you manage your custom filters.
- -The Emulator Control tab, shown in Figure 1, is no longer - supported. Use the - Android Emulator - for these features.
- - diff --git a/docs/html/tools/debugging/debugging-log.jd b/docs/html/tools/debugging/debugging-log.jd deleted file mode 100644 index a49e8c54422c..000000000000 --- a/docs/html/tools/debugging/debugging-log.jd +++ /dev/null @@ -1,307 +0,0 @@ -page.title=Reading and Writing Logs - -@jd:body - -The Android logging system provides a mechanism for collecting and viewing system debug - output. Logcat dumps a log of system messages, which include things such as stack traces when the - emulator throws an error and messages that you have written from your application by using the - {@link android.util.Log} class. You can run LogCat through ADB or from DDMS, which allows you to - read the messages in real time.
- -You can use LogCat from within DDMS or call it on an ADB shell. For more information on how to - use LogCat within DDMS, see Using - DDMS. To run LogCat, through the ADB shell, the general usage is:
--[adb] logcat [<option>] ... [<filter-spec>] ... -- -
You can use the logcat
command from your development computer or from a remote
- adb shell in an emulator/device instance. To view log output in your development computer, you
- use
-$ adb logcat -- -
and from a remote adb shell you use
--# logcat -- -
The following table describes the logcat
command line options:
-c |
-
- Clears (flushes) the entire log and exits. | -
-d |
-
- Dumps the log to the screen and exits. | -
-f <filename> |
-
- Writes log message output to <filename> . The default is
- stdout . |
-
-g |
- Prints the size of the specified log buffer and exits. | -
-n <count> |
-
- Sets the maximum number of rotated logs to <count> . The default value
- is 4. Requires the -r option. |
-
-r <kbytes> |
-
- Rotates the log file every <kbytes> of output. The default value is
- 16. Requires the -f option. |
-
-s |
-
- Sets the default filter spec to silent. | -
-v <format> |
-
- Sets the output format for log messages. The default is brief format. For a
- list of supported formats, see Controlling Log Output
- Format. |
-
Every Android log message has a tag and a priority associated with it.
- -V
— Verbose (lowest priority)D
— DebugI
— InfoW
— WarningE
— ErrorF
— FatalS
— Silent (highest priority, on which nothing is ever printed)You can obtain a list of tags used in the system, together with priorities, by running
- LogCat and observing the first two columns of each message, given as
- <priority>/<tag>
.
Here's an example of logcat output that shows that the message relates to priority level "I" - and tag "ActivityManager":
--I/ActivityManager( 585): Starting activity: Intent { action=android.intent.action...} -- -
To reduce the log output to a manageable level, you can restrict log output using filter - expressions. Filter expressions let you indicate to the system the tags-priority - combinations that you are interested in — the system suppresses other messages for the - specified tags.
- -A filter expression follows this format tag:priority ...
, where tag
- indicates the tag of interest and priority
indicates the minimum level of
- priority to report for that tag. Messages for that tag at or above the specified priority are
- written to the log. You can supply any number of tag:priority
specifications in a
- single filter expression. The series of specifications is whitespace-delimited.
Here's an example of a filter expression that suppresses all log messages except those with - the tag "ActivityManager", at priority "Info" or above, and all log messages with tag "MyApp", - with priority "Debug" or above:
--adb logcat ActivityManager:I MyApp:D *:S -- -
The final element in the above expression, *:S
, sets the priority level for all
- tags to "silent", thus ensuring only log messages with "ActivityManager" and "MyApp" are displayed. Using
- *:S
is an excellent way to ensure that log output is restricted to the filters that
- you have explicitly specified — it lets your filters serve as a "whitelist" for log
- output.
The following filter expression displays all log messages with priority level "warning" and higher, on all tags:
--adb logcat *:W -- -
If you're running LogCat from your development computer (versus running it on a
- remote adb shell), you can also set a default filter expression by exporting a value for the
- environment variable ANDROID_LOG_TAGS
:
-export ANDROID_LOG_TAGS="ActivityManager:I MyApp:D *:S" -- -
Note that ANDROID_LOG_TAGS
filter is not exported to the emulator/device
- instance, if you are running LogCat from a remote shell or using adb shell
- logcat
.
Log messages contain a number of metadata fields, in addition to the tag and priority. You can
- modify the output format for messages so that they display a specific metadata field. To do so,
- you use the -v
option and specify one of the supported output formats listed
- below.
brief
— Display priority/tag and PID of the process issuing the
- message (the default format).process
— Display PID only.tag
— Display the priority/tag only.raw
— Display the raw log message, with no other metadata fields.time
— Display the date, invocation time, priority/tag, and PID of the
- process issuing the message.threadtime
— Display the date, invocation time, priority, tag, and
- the PID and TID of the thread issuing the message.long
— Display all metadata fields and separate messages with blank
- lines.When starting LogCat, you can specify the output format you want by using the
- -v
option:
-[adb] logcat [-v <format>] -- -
Here's an example that shows how to generate messages in thread
output
- format:
-adb logcat -v thread -- -
Note that you can only specify one output format with the -v
option.
The Android logging system keeps multiple circular buffers for log messages, and not all of
- the log messages are sent to the default circular buffer. To see additional log messages, you can
- run the logcat
command with the -b
option, to request viewing of an alternate
- circular buffer. You can view any of these alternate buffers:
radio
— View the buffer that contains radio/telephony related
- messages.events
— View the buffer containing events-related messages.main
— View the main log buffer (default)The usage of the -b
option is:
-[adb] logcat [-b <buffer>] -- -
Here's an example of how to view a log buffer containing radio and telephony messages:
--adb logcat -b radio -- -
By default, the Android system sends stdout
and stderr
- (System.out
and System.err
) output to /dev/null
. In
- processes that run the Dalvik VM, you can have the system write a copy of the output to the log
- file. In this case, the system writes the messages to the log using the log tags
- stdout
and stderr
, both with priority I
.
To route the output in this way, you stop a running emulator/device instance and then use the
- shell command setprop
to enable the redirection of output. Here's how you do it:
-$ adb shell stop -$ adb shell setprop log.redirect-stdio true -$ adb shell start -- -
The system retains this setting until you terminate the emulator/device instance. To use the
- setting as a default on the emulator/device instance, you can add an entry to
- /data/local.prop
on the device.
The {@link android.util.Log} class allows you to create log entries in your code that display - in the LogCat tool. Common logging methods include:
- -For example, using the following call:
- --Log.i("MyActivity", "MyClass.getView() — get item number " + position); -- -
The LogCat outputs something like:
--I/MyActivity( 1557): MyClass.getView() — get item number 1 -diff --git a/docs/html/tools/debugging/debugging-memory.jd b/docs/html/tools/debugging/debugging-memory.jd deleted file mode 100755 index 4e2e5193c9ba..000000000000 --- a/docs/html/tools/debugging/debugging-memory.jd +++ /dev/null @@ -1,708 +0,0 @@ -page.title=Investigating Your RAM Usage -page.tags=memory,OutOfMemoryError -@jd:body - -
Because Android is designed for mobile devices, you should always be careful about how much -random-access memory (RAM) your app uses. Although Dalvik and ART perform -routine garbage collection (GC), this doesn’t mean you can ignore when and where your app allocates and -releases memory. In order to provide a stable user experience that allows the system to quickly -switch between apps, it is important that your app does not needlessly consume memory when the user -is not interacting with it.
- -Even if you follow all the best practices for Managing Your App Memory during -development (which you should), you still might leak objects or introduce other memory bugs. The -only way to be certain your app is using as little memory as possible is to analyze your app’s -memory usage with tools. This guide shows you how to do that.
- - -The simplest place to begin investigating your app’s memory usage is the runtime log messages. -Sometimes when a GC occurs, a message is printed to -logcat. The logcat output is also available in the -Device Monitor or directly in an IDE such as Android Studio.
- -In Dalvik (but not ART), every GC prints the following information to logcat:
- --D/dalvikvm: <GC_Reason> <Amount_freed>, <Heap_stats>, <External_memory_stats>, <Pause_time> -- -
Example:
- --D/dalvikvm( 9050): GC_CONCURRENT freed 2049K, 65% free 3571K/9991K, external 4703K/5261K, paused 2ms+2ms -- -
GC_CONCURRENT
GC_FOR_MALLOC
GC_HPROF_DUMP_HEAP
GC_EXPLICIT
-GC_EXTERNAL_ALLOC
As these log messages accumulate, look out for increases in the heap stats (the -{@code 3571K/9991K} value in the above example). If this value continues to increase, you may have -a memory leak.
- - -Unlike Dalvik, ART doesn't log messages for GCs that were not explicitly requested. GCs are only -printed when they are they are deemed slow. More precisely, if the GC pause exceeds than 5ms or -the GC duration exceeds 100ms. If the app is not in a pause perceptible process state, -then none of its GCs are deemed slow. Explicit GCs are always logged.
- -ART includes the following information in its garbage collection log messages:
- --I/art: <GC_Reason> <GC_Name> <Objects_freed>(<Size_freed>) AllocSpace Objects, <Large_objects_freed>(<Large_object_size_freed>) <Heap_stats> LOS objects, <Pause_time(s)> -- -
Example:
- --I/art : Explicit concurrent mark sweep GC freed 104710(7MB) AllocSpace objects, 21(416KB) LOS objects, 33% free, 25MB/38MB, paused 1.230ms total 67.216ms -- -
Concurrent
Alloc
Explicit
-NativeAlloc
CollectorTransition
HomogeneousSpaceCompact
DisableMovingGc
HeapTrim
Concurrent mark sweep (CMS)
Concurrent partial mark sweep
Concurrent sticky mark sweep
Marksweep + semispace
If you are seeing a large amount of GCs in logcat, look for increases in the heap stats (the -{@code 25MB/38MB} value in the above example). If this value continues to increase and doesn't -ever seem to get smaller, you could have a memory leak. Alternatively, if you are seeing GC which -are for the reason "Alloc", then you are already operating near your heap capacity and can expect -OOM exceptions in the near future.
- -To get a little information about what kind of memory your app is using and when, you -can view real-time updates to your app's heap in Android Studio's -HPROF viewer or in the Device Monitor:
- -Use Android Studio to view your app's memory use:
-Android Studio creates the heap snapshot file with the filename
- Snapshot-yyyy.mm.dd-hh.mm.ss.hprof
in the Captures tab.
Note: To convert a heap dump to standard HPROF format in - Android Studio, right-click a heap snapshot in the Captures view and select - Export to standard .hprof.
From your <sdk>/tools/
directory, launch the monitor
tool.
The Heap view shows some basic stats about your heap memory usage, updated after every -GC. To see the first update, click the Cause GC button.
- - - - - -Continue interacting with your app to watch your heap allocation update with each garbage -collection. This can help you identify which actions in your app are likely causing too much -allocation and where you should try to reduce allocations and release -resources.
- - - -As you start narrowing down memory issues, you should also use the Allocation Tracker to -get a better understanding of where your memory-hogging objects are allocated. The Allocation -Tracker can be useful not only for looking at specific uses of memory, but also to analyze critical -code paths in an app such as scrolling.
- -For example, tracking allocations when flinging a list in your app allows you to see all the -allocations that need to be done for that behavior, what thread they are on, and where they came -from. This is extremely valuable for tightening up these paths to reduce the work they need and -improve the overall smoothness of the UI.
- -To use the Allocation Tracker, open the Memory Monitor in Android Studio and click the - -Allocation Tracker icon. You can also track allocations in the Android Device Monitor:
- - -To use the Allocation Tracker in -Android Studio:
- -Android Studio creates the allocation file with the filename
- Allocations-yyyy.mm.dd-hh.mm.ss.alloc
in the Captures tab.
From your <sdk>/tools/
directory, launch the monitor
tool.
The list shows all recent allocations, -currently limited by a 512-entry ring buffer. Click on a line to see the stack trace that led to -the allocation. The trace shows you not only what type of object was allocated, but also in which -thread, in which class, in which file and at which line.
- - - - - -Note: You will always see some allocations from {@code -DdmVmInternal} and elsewhere that come from the allocation tracker itself.
- -Although it's not necessary (nor possible) to remove all allocations from your performance -critical code paths, the allocation tracker can help you identify important issues in your code. -For instance, some apps might create a new {@link android.graphics.Paint} object on every draw. -Moving that object into a global member is a simple fix that helps improve performance.
- - - - - - -For further analysis, you may want to observe how your app's memory is -divided between different types of RAM allocation with the -following adb command:
- --adb shell dumpsys meminfo <package_name|pid> [-d] -- -
The -d flag prints more info related to Dalvik and ART memory usage.
- -The output lists all of your app's current allocations, measured in kilobytes.
- -When inspecting this information, you should be familiar with the -following types of allocation:
- -A nice characteristic of the PSS measurement is that you can add up the PSS across all processes to -determine the actual memory being used by all processes. This means PSS is a good measure for the -actual RAM weight of a process and for comparison against the RAM use of other processes and the -total available RAM.
- - -For example, below is the the output for Map’s process on a Nexus 5 device. There is a lot of -information here, but key points for discussion are listed below.
-adb shell dumpsys meminfo com.google.android.apps.maps -d
-
-Note: The information you see may vary slightly from what is shown -here, as some details of the output differ across platform versions.
- --** MEMINFO in pid 18227 [com.google.android.apps.maps] ** - Pss Private Private Swapped Heap Heap Heap - Total Dirty Clean Dirty Size Alloc Free - ------ ------ ------ ------ ------ ------ ------ - Native Heap 10468 10408 0 0 20480 14462 6017 - Dalvik Heap 34340 33816 0 0 62436 53883 8553 - Dalvik Other 972 972 0 0 - Stack 1144 1144 0 0 - Gfx dev 35300 35300 0 0 - Other dev 5 0 4 0 - .so mmap 1943 504 188 0 - .apk mmap 598 0 136 0 - .ttf mmap 134 0 68 0 - .dex mmap 3908 0 3904 0 - .oat mmap 1344 0 56 0 - .art mmap 2037 1784 28 0 - Other mmap 30 4 0 0 - EGL mtrack 73072 73072 0 0 - GL mtrack 51044 51044 0 0 - Unknown 185 184 0 0 - TOTAL 216524 208232 4384 0 82916 68345 14570 - - Dalvik Details - .Heap 6568 6568 0 0 - .LOS 24771 24404 0 0 - .GC 500 500 0 0 - .JITCache 428 428 0 0 - .Zygote 1093 936 0 0 - .NonMoving 1908 1908 0 0 - .IndirectRef 44 44 0 0 - - Objects - Views: 90 ViewRootImpl: 1 - AppContexts: 4 Activities: 1 - Assets: 2 AssetManagers: 2 - Local Binders: 21 Proxy Binders: 28 - Parcel memory: 18 Parcel count: 74 - Death Recipients: 2 OpenSSL Sockets: 2 -- -
Here is an older dumpsys on Dalvik of the gmail app:
- --** MEMINFO in pid 9953 [com.google.android.gm] ** - Pss Pss Shared Private Shared Private Heap Heap Heap - Total Clean Dirty Dirty Clean Clean Size Alloc Free - ------ ------ ------ ------ ------ ------ ------ ------ ------ - Native Heap 0 0 0 0 0 0 7800 7637(6) 126 - Dalvik Heap 5110(3) 0 4136 4988(3) 0 0 9168 8958(6) 210 - Dalvik Other 2850 0 2684 2772 0 0 - Stack 36 0 8 36 0 0 - Cursor 136 0 0 136 0 0 - Ashmem 12 0 28 0 0 0 - Other dev 380 0 24 376 0 4 - .so mmap 5443(5) 1996 2584 2664(5) 5788 1996(5) - .apk mmap 235 32 0 0 1252 32 - .ttf mmap 36 12 0 0 88 12 - .dex mmap 3019(5) 2148 0 0 8936 2148(5) - Other mmap 107 0 8 8 324 68 - Unknown 6994(4) 0 252 6992(4) 0 0 - TOTAL 24358(1) 4188 9724 17972(2)16388 4260(2)16968 16595 336 - - Objects - Views: 426 ViewRootImpl: 3(8) - AppContexts: 6(7) Activities: 2(7) - Assets: 2 AssetManagers: 2 - Local Binders: 64 Proxy Binders: 34 - Death Recipients: 0 - OpenSSL Sockets: 1 - - SQL - MEMORY_USED: 1739 - PAGECACHE_OVERFLOW: 1164 MALLOC_SIZE: 62 -- -
Generally, you should be concerned with only the Pss Total
and Private Dirty
-columns. In some cases, the Private Clean
and Heap Alloc
columns also offer
-interesting data. Here is some more information about the different memory allocations (the rows)
-you should observe:
-
-
Dalvik Heap
Pss Total
includes all Zygote
-allocations (weighted by their sharing across processes, as described in the PSS definition above).
-The Private Dirty
number is the actual RAM committed to only your app’s heap, composed of
-your own allocations and any Zygote allocation pages that have been modified since forking your
-app’s process from Zygote.
-
-Note: On newer platform versions that have the Dalvik
-Other
section, the Pss Total
and Private Dirty
numbers for Dalvik Heap do
-not include Dalvik overhead such as the just-in-time compilation (JIT) and GC
-bookkeeping, whereas older versions list it all combined under Dalvik
.
The Heap Alloc
is the amount of memory that the Dalvik and native heap allocators keep
-track of for your app. This value is larger than Pss Total
and Private Dirty
-because your process was forked from Zygote and it includes allocations that your process shares
-with all the others.
.so mmap
and .dex mmap
.so
(native) and .dex
(Dalvik or ART)
-code. The Pss Total
number includes platform code shared across apps; the
-Private Clean
is your app’s own code. Generally, the actual mapped size will be much
-larger—the RAM here is only what currently needs to be in RAM for code that has been executed by
-the app. However, the .so mmap has a large private dirty, which is due to fix-ups to the native
-code when it was loaded into its final address.
-.oat mmap
.art mmap
.Heap
(only with -d flag).LOS
(only with -d flag).GC
(only with -d flag).JITCache
(only with -d flag).Zygote
(only with -d flag).NonMoving
(only with -d flag).IndirectRef
(only with -d flag)Unknown
Pss Total
for Unknown takes into account sharing with Zygote, and Private Dirty
-is unknown RAM dedicated to only your app.
-TOTAL
The Private Dirty
and Private Clean
are the total allocations within your
-process, which are not shared with other processes. Together (especially Private Dirty
),
-this is the amount of RAM that will be released back to the system when your process is destroyed.
-Dirty RAM is pages that have been modified and so must stay committed to RAM (because there is no
-swap); clean RAM is pages that have been mapped from a persistent file (such as code being
-executed) and so can be paged out if not used for a while.
ViewRootImpl
AppContexts
and Activities
Note: A {@link android.view.View} or {@link -android.graphics.drawable.Drawable} object also holds a reference to the {@link -android.app.Activity} that it's from, so holding a {@link android.view.View} or {@link -android.graphics.drawable.Drawable} object can also lead to your app leaking an {@link -android.app.Activity}.
- - -A heap dump is a snapshot of all the objects in your app's heap, stored in a binary format called -HPROF. Your app's heap dump provides information about the overall state of your app's heap so you -can track down problems you might have identified while viewing heap updates.
- - -To retrieve your heap dump from within Android Studio, use the -Memory Monitor and -HPROF viewer. - -
You can also still perform these procedures in the Android monitor:
-From your <sdk>/tools/
directory, launch the monitor
tool.
If you need to be more precise about when the dump is created, you can also create a heap dump -at the critical point in your app code by calling {@link android.os.Debug#dumpHprofData -dumpHprofData()}.
- -The heap dump is provided in a format that's similar to, but not identical to one from the Java -HPROF tool. The major difference in an Android heap dump is due to the fact that there are a large -number of allocations in the Zygote process. But because the Zygote allocations are shared across -all app processes, they don’t matter very much to your own heap analysis.
- -To analyze your heap dump, you can use Memory Monitor in Android Studio.
-You can also use a standard tool like jhat. However, first
-you'll need to convert the HPROF file from Android's format to the J2SE HPROF format. You can do
-this using the hprof-conv
tool provided in the
-<sdk>/platform-tools/
-directory. Simply run the hprof-conv
command with two arguments: the original HPROF
-file and the location to write the converted HPROF file. For example:
-hprof-conv heap-original.hprof heap-converted.hprof -- - - -
You can now load the converted file into a heap analysis tool that understands -the J2SE HPROF format.
- -When analyzing your heap, you should look for memory leaks caused by:
-While using the tools described above, you should aggressively stress your app code and try -forcing memory leaks. One way to provoke memory leaks in your app is to let it -run for a while before inspecting the heap. Leaks will trickle up to the top of the allocations in -the heap. However, the smaller the leak, the longer you need to run the app in order to see it.
- -You can also trigger a memory leak in one of the following ways:
-Tip: You can also perform the above steps by using the "monkey" -test framework. For more information on running the monkey test framework, read the monkeyrunner -documentation.
diff --git a/docs/html/tools/debugging/debugging-studio.jd b/docs/html/tools/debugging/debugging-studio.jd deleted file mode 100644 index 7e54634278fb..000000000000 --- a/docs/html/tools/debugging/debugging-studio.jd +++ /dev/null @@ -1,421 +0,0 @@ -page.title=Debugging with Android Studio - -@jd:body - -Android Studio enables you to debug apps running on the emulator or on an Android device. -With Android Studio, you can:
- -To debug your app, Android Studio builds a debuggable version of your app, connects -to a device or to the emulator, installs the app and runs it. The IDE shows the system log -while your app is running and provides debugging tools to filter log messages, work with -breakpoints, and control the execution flow.
- - -To run your app in debug mode, you build an APK signed with a debug key and install it on a -physical Android device or on the Android emulator. -To set up an Android device for development, see Using -Hardware Devices. For more information about the emulator provided by the Android SDK, see -Using the Emulator.
- -To debug your app in Android Studio:
- -Figure 1 shows the Choose Device window. The list shows all the Android devices -connected to your computer. Select Launch Emulator to use an Android virtual device -instead. Click the ellipsis to open the -Android Virtual Device Manager.
- -Android Studio opens the Debug tool window when you debug your app. To open the -Debug window manually, click Debug -. -This window shows threads and variables in the Debugger tab, the device status in the -Console tab, and the system log in the Logcat tab. The Debug tool -window also provides other debugging tools covered in the following sections.
- - - - -You don't always have to restart your app to debug it. To debug an app that -you're already running:
- -By default, the debugger shows the device and app process for the current -project, as well as any connected hardware devices or virtual devices on your -computer. Select Show all processes to show all processes on -all devices; the display includes any services that your app created as well as -system processes, for example.
-From the Debugger menu, you can select Java, -Native, or Hybrid. The latter two options are -available only if your project contains some native C or C++ source code.
-The Debug window appears. In this case, notice the two tabs to the -right of the Debug window title: one tab is for debugging native code and the -other for Java code, as indicated by -java.
- -Separate debugging sessions have separate tabs and different port numbers, -which are displayed in parentheses in the tab.
-The system log shows system messages while you debug your app. These messages include -information from apps running on the device. If you want to use the -system log to debug your app, make sure your code writes log messages and prints the stack -trace for exceptions while your app is in the development phase.
- -To write log messages in your code, use the {@link android.util.Log} class. Log messages -help you understand the execution flow by collecting the system debug output while you interact -with your app. Log messages can tell you what part of your application failed. For more -information about logging, see -Reading and Writing Logs.
- -The following example shows how you might add log messages to determine if previous state -information is available when your activity starts:
- --import android.util.Log; -... -public class MyActivity extends Activity { - private static final String TAG = MyActivity.class.getSimpleName(); - ... - @Override - public void onCreate(Bundle savedInstanceState) { - if (savedInstanceState != null) { - Log.d(TAG, "onCreate() Restoring previous state"); - /* restore state */ - } else { - Log.d(TAG, "onCreate() No saved state available"); - /* initialize app */ - } - } -} -- -
During development, your code can also catch exceptions and write the stack trace to the system -log:
- --void someOtherMethod() { - try { - ... - } catch (SomeException e) { - Log.d(TAG, "someOtherMethod()", e); - } -} -- -
Note: Remove debug log messages and stack trace print calls from
-your code when you are ready to publish your app. You could do this by setting a DEBUG
-flag and placing debug log messages inside conditional statements.
Both the Android DDMS (Dalvik Debug Monitor Server) and the Debug tool windows -show the system log; however, the Android DDMS tool window lets you view only log messages -for a particular process. To view the system log on the Android DDMS tool window:
- -The Android DDMS tool window gives you access to some DDMS features from Android Studio. -For more information about DDMS, see Using DDMS. -
- -The system log shows messages from Android services and other Android apps. To filter the log -messages to view only the ones you are interested in, use the tools in the Android DDMS -window:
- -Breakpoints enable you to pause the execution of your app at a particular line of code, examine -variables, evaluate expressions, and continue the execution line by line. Use breakpoints to -determine the causes of run-time errors that you can't fix by looking at your code only. To debug -your app using breakpoints:
- -Android Studio pauses the execution of your app when it reaches the breakpoint. You can then -use the tools in the Debug tool window to identify the cause of the error.
- - - - -To view all the breakpoints and configure breakpoint settings, click View -Breakpoints on the left side of the Debug tool -window. The Breakpoints window appears, as shown in figure 6.
- - - - -The Breakpoints window lets you enable or disable each breakpoint from the -list on the left. If a breakpoint is disabled, Android Studio does not pause your app when -it hits that breakpoint. Select a breakpoint from the list to configure its settings. -You can configure a breakpoint to be disabled at first and have the system enable it after a -different breakpoint is hit. You can also configure whether a breakpoint should be disabled after -it is hit. To set a breakpoint for any exception, select Exception Breakpoints -in the list of breakpoints.
- -After you set breakpoints in your code, click Rerun - to start the app again. When a breakpoint is -hit, Android Studio pauses the app and highlights the breakpoint in the source code. The -Debug tool window lets you examine variables and control the execution step by -step:
- -To examine the object tree for a variable, expand it in the Variables view. If - the Variables view is not visible, click Restore Variables View - .
-To evaluate an expression at the current execution point, click Evaluate - Expression .
-To advance to the next line in the code (without entering a method), click Step - Over .
-To advance to the first line inside a method call, click Step - Into .
-To advance to the next line outside the current method, click Step - Out .
-To continue running the app normally, click Resume Program - .
-Android Studio lets you track objects that are being allocated on the Java heap and see which -classes and threads are allocating these objects. This allows you to see the list of objects -allocated during a period of interest. This information is valuable for assessing memory usage -that can affect application performance.
- -To track memory allocation of objects:
- -Android Studio shows the objects that the system allocated with the following information:
- -Even if your application does not generate runtime errors, this does not mean it is free of -problems. You should also consider the following issues:
- -The Android Device Monitor is a stand-alone tool with a graphical user interface for serveral -Android application debugging and analysis tools, including the Dalvik Debug Monitor Server (DDMS). -You can use the Android Device Monitor to analyze memory usage, profile methods, -monitor network traffic and simulate incoming calls and messages.
- -To open the Android Device Monitor from Android Studio, click -Monitor on the toolbar. The Android Device Monitor -opens in a new window.
- -For more information about the Android Device Monitor and DDMS, see -Device Monitor and -Using DDMS.
- - -Android Studio enables you to capture a screenshot or a short video of the device screen -while your app is running. Screenshots and videos are useful as promotional materials for your -app, and you can also attach them to bug reports that you send to your development team.
- -To take a screenshot of your app:
- -To take a video recording of your app:
- -Traceview is a graphical viewer for execution logs that you create by using the {@link - android.os.Debug} class to log tracing information in your code. Traceview can help you debug - your application and profile its performance.
- -When you have a trace log file (generated by adding tracing code to your application or by DDMS), - you can load the log files in Traceview, which displays the log data in two panels:
- -The sections below provide addition information about the traceview output panes.
- -Figure 1 shows a close up of the timeline panel. Each thread’s execution is shown - in its own row, with time increasing to the right. Each method is shown in another color (colors - are reused in a round-robin fashion starting with the methods that have the most inclusive time). - The thin lines underneath the first row show the extent (entry to exit) of all the calls to the - selected method.
- - - - -Figure 2 shows the profile pane, a summary of all the time spent
- in a method. The table shows both the inclusive and exclusive times (as well as the percentage of
- the total time). Exclusive time is the time spent in the method. Inclusive time is the time spent
- in the method plus the time spent in any called functions. We refer to calling methods as
- "parents" and called methods as "children." When a method is selected (by clicking on it), it
- expands to show the parents and children. Parents are shown with a purple background and children
- with a yellow background. The last column in the table shows the number of calls to this method
- plus the number of recursive calls. The last column shows the number of calls out of the total
- number of calls made to that method. In this view, we can see that there were 14 calls to
- LoadListener.nativeFinished();
looking at the timeline panel shows that one of those calls took
- an unusually long time.
To use Traceview, you need to generate log files containing the trace information you want to - analyze.
- -There are two ways to generate trace logs:
-Before you start generating trace logs, be aware of the following restrictions:
-This document focuses on using the {@link android.os.Debug} class to generate trace data. For more information on using DDMS - to generate trace data, see Using the Dalvik Debug Monitor Server. -
- -To create the trace files, include the {@link android.os.Debug} class and call one of the - {@link android.os.Debug#startMethodTracing() startMethodTracing()} methods. In the call, you - specify a base name for the trace files that the system generates. To stop tracing, call {@link - android.os.Debug#stopMethodTracing() stopMethodTracing()}. These methods start and stop method - tracing across the entire virtual machine. For example, you could call - {@link android.os.Debug#startMethodTracing() startMethodTracing()} in - your activity's {@link android.app.Activity#onCreate onCreate()} method, and call - {@link android.os.Debug#stopMethodTracing() stopMethodTracing()} in that activity's - {@link android.app.Activity#onDestroy()} method.
-- // start tracing to "/sdcard/calc.trace" - Debug.startMethodTracing("calc"); - // ... - // stop tracing - Debug.stopMethodTracing(); -- -
When your application calls {@link android.os.Debug#startMethodTracing() startMethodTracing()},
- the system creates a file called
- <trace-base-name>.trace
. This contains the binary method trace data and a
- mapping table with thread and method names.
The system then begins buffering the generated trace data, until your application calls - {@link android.os.Debug#stopMethodTracing() stopMethodTracing()}, at which time it writes - the buffered data to the output file. If the system - reaches the maximum buffer size before you call {@link android.os.Debug#stopMethodTracing() - stopMethodTracing()}, the system stops tracing - and sends a notification to the console.
- -Interpreted code runs more slowly when profiling is enabled. Don't try to generate - absolute timings from the profiler results (such as, "function X takes 2.5 seconds to run"). The - times are only useful in relation to other profile output, so you can see if changes have made - the code faster or slower relative to a previous profiling run.
- -In Android 4.4 and later, you can use sample-based profiling to profile with less runtime - performance impact. To enable sample profiling, call {@link - android.os.Debug#startMethodTracingSampling(java.lang.String, int, int) - startMethodTracingSampling()} with a specified sampling interval. The system will then gather - samples periodically until tracing is stopped via {@link android.os.Debug#stopMethodTracing() - stopMethodTracing()}.
- -After your application has run and the system has created your trace files
- <trace-base-name>.trace
on a device or emulator, you must copy those files to
- your development computer. You can use adb pull
to copy the files. Here's an example
- that shows how to copy an example file, calc.trace, from the default location on the emulator to
- the /tmp directory on the emulator host machine:
-adb pull /sdcard/calc.trace /tmp -- -
To run Traceview and view the trace files:
-Note: If you are trying to view the trace logs of an application
- that is built with ProGuard enabled (release mode build), some method and member names might be obfuscated.
- You can use the Proguard mapping.txt
file to figure out the original unobfuscated names. For more information
- on this file, see the Proguard documentation.
dmtracedump
is a tool that gives you an alternate way of generating
- graphical call-stack diagrams from trace log files. The tool uses the Graphviz Dot utility to
- create the graphical output, so you need to install Graphviz before running dmtracedump.
The dmtracedump tool generates the call stack data as a tree diagram, with each call - represented as a node. It shows call flow (from parent node to child nodes) using arrows. The - diagram below shows an example of dmtracedump output.
- - - -For each node, dmtracedump shows <ref>
- callname (<inc-ms>, <exc-ms>,<numcalls>)
, where
<ref>
-- Call reference number, as used in trace logs<inc-ms>
-- Inclusive elapsed time (milliseconds spent in method,
- including all child methods)<exc-ms>
-- Exclusive elapsed time (milliseconds spent in method,
- not including any child methods)<numcalls>
-- Number of callsThe usage for dmtracedump is:
--dmtracedump [-ho] [-s sortable] [-d trace-base-name] [-g outfile] <trace-base-name> -- -
The tool then loads trace log data from <trace-base-name>.data
and
- <trace-base-name>.key
. The table below lists the options for dmtracedump.
Option | - -Description | -
---|---|
-d <trace-base-name> |
-
- Diff with this trace name | -
-g <outfile> |
-
- Generate output to <outfile> | -
-h |
-
- Turn on HTML output | -
-o |
-
- Dump the trace file instead of profiling | -
-d <trace-base-name> |
-
- URL base to the location of the sortable javascript file | -
-t <percent> |
-
- Minimum threshold for including child nodes in the graph (child's inclusive time as a - percentage of parent inclusive time). If this option is not used, the default threshold - is 20%. | -
Sometimes your application's layout can slow down your application.
-To help debug issues in your layout, the Android SDK provides the Hierarchy Viewer and
-lint
tools.
The Hierarchy Viewer application allows you to debug and optimize your user interface. It - provides a visual representation of the layout's View hierarchy (the View Hierarchy window) - with performance information for each node in the layout, - and a magnified view of the display (the Pixel Perfect window) to closely examine the pixels - in your layout.
- -Android lint
is a static code
- scanning tool that helps you optimize the layouts and layout
- hierarchies of your applications, as well as detect other common coding problems. You can run it
- against your layout files or resource
- directories to quickly check for inefficiencies or other types of problems that could be
- affecting the performance of your application.
- To run Hierarchy Viewer, follow these steps:
-- To preserve security, Hierarchy Viewer can only connect to devices running a - developer version of the Android system. -
-hierarchyviewer
from the
- <sdk>/tools/
- directory.
- - To learn how to use the View Hierarchy window, go to - About the View Hierarchy window. To learn how to use the - Pixel Perfect window, go to About the Pixel Perfect window. -
- - -- The View Hierarchy window displays the View objects that form the UI of the - Activity that is running on your device or emulator. You use it to look at individual - View objects within the context of the entire View tree. For each View object, the View - Hierarchy window also displays rendering performance data. -
-- To see the View Hierarchy window, run Hierarchy Viewer as described in - the section Running Hierarchy Viewer and choosing a window. Next, click - View Hierarchy at the top of the device window. -
-- You should see four panes: -
-- To zoom in on the pane, use the slider at the bottom of the pane, or use your mouse - scroll wheel. To move around in the pane or reveal View objects that are not currently - visible, click and drag the pane. -
-- To highlight the nodes in the tree whose class or ID match a search string, enter the - string in the Filter by class or id: edit box at the bottom of the - window. The background of nodes that match the search string will change from gray to - bright blue. -
-- To save a screenshot of Tree View to a PNG file, click Save As PNG at - the top of the View Hierarchy window. This displays a dialog in which you can choose - a directory and file name. -
-- To save a layered screenshot of your device or emulator to an Adobe Photoshop (PSD) - file, click Capture Layers at the top of the View Hierarchy window. - This displays a dialog in which you can choose a directory or file name. - Each View in the UI is saved as a separate Photoshop layer. -
-- In Photoshop (or similar program that accepts .psd files), you can hide, show or edit a - layer independently of others. When you save a layered screenshot, you can examine and - modify the image of an individual View object. This helps you experiment with design - changes. -
-- You can also use Tree Overview to move around in the Tree View pane. Click and drag - the shaded rectangle over an area to reveal it in Tree View. -
-- The properties are organized by category. To find an individual property, expand - a category name by clicking the arrow on its left. This reveals all the properties - in that category. -
-- The outline colors of blocks in Layout View provide additional information: -
-- When the UI of the current Activity changes, the View Hierarchy window is not automatically - updated. To update it, click Load View Hierarchy at the top of the window. -
-- Also, the window is not updated if you switch to a new Activity. To update it, start by - clicking the window selection icon in the bottom left-hand corner of the window. This - navigates back to the Window Selection window. From this window, click the Android - component name of the new Activity and then click Load View Hierarchy - at the top of the window. -
-- A screenshot of the View Hierarchy window appears in figure 2. -
- - -- Each node in Tree View represents a single View. Some information is always visible. Starting - at the top of the node, you see the following: -
-android:id
-
attribute.
- - The colors indicate the following relative performance: -
-- When you select a node, additional information for the View appears in a small window above - the node. When you click one of the nodes, you see the following: -
-- An annotated screenshot of an individual node in the Tree View window appears in figure 3. -
- - -- The View Hierarchy window helps you debug an application by providing a static display - of the UI. The display starts with your application's opening screen. As you step through - your application, the display remains unchanged until you redraw it by invalidating and - then requesting layout for a View. -
-- To redraw a View in the display: -
-- Manually redrawing a View allows you to watch the View object tree and examine the properties of - individual View objects one step at a time as you go through breakpoints in your code. -
-- View Hierarchy also helps you identify slow render performance. You start by looking at the - View nodes with red or yellow performance indicators to identify the slower View objects. As you - step through your application, you can judge if a View is consistently slow or slow only in - certain circumstances. -
-- Remember that slow performance is not necessarily evidence of a problem, especially for - ViewGroup objects. View objects that have more children and more complex View objects render - more slowly. -
-- The View Hierarchy window also helps you find performance issues. Just by looking at the - performance indicators (the dots) for each View node, you can see which View objects are the - slowest to measure, layout, and draw. From that, you can quickly identify the problems you - should look at first. -
-- Pixel Perfect is a tool for examining pixel properties and laying out UIs from a design drawing. -
-- The Pixel Perfect window displays a magnified image of the screen that is currently - visible on the emulator or device. In it, you can examine the properties - of individual pixels in the screen image. You can also use the Pixel Perfect window - to help you lay out your application UI based on a bitmap design. -
-- To see the Pixel Perfect window, run Hierarchy Viewer, as described in - the section Running Hierarchy Viewer and choosing a window. Next, click - Inspect Screenshot at the top of the device window. The Pixel Perfect window - appears. -
-- In it, you see three panes: -
-- The magenta crosshair in the pane corresponds to the positioning - crosshair in the next pane. It only moves when you move the crosshair in the next pane. -
-- To zoom in or out on the image, use the Zoom slider at the bottom of - the pane, or use your mouse's scroll wheel. -
-- When you select a pixel in the Loupe pane, you see the following information at the - bottom of the pane: -
-- You use the cyan crosshair to do coarse positioning. Drag the crosshair in the image, - and the Loupe crosshair will move accordingly. You can also click on a point in the - Pixel Perfect pane, and the crosshair will move to that point. -
-- The image corresponding to the View object selected in the View Object pane is - outlined in a box that indicates the View object's position on the screen. For the - selected object, the box is bold red. Sibling and parent View objects have a light - red box. View objects that are neither parents nor siblings are in white. -
-- The layout box may have other rectangles either inside or outside it, each of which - indicates part of the View. A purple or green rectangle indicates the View bounding box. - A white or black box inside the layout box represents the padding, the - defined distance between the View object's content and its bounding box. An outer white - or black rectangle represents the margins, the distance between the - View bounding box and adjacent View objects. The padding and margin boxes are white if - the layout background is black, and vice versa. -
-- You can save the screen image being displayed in the Pixel Perfect pane as a PNG file. - This produces a screenshot of the current screen. To do this, click - Save as PNG at the top of the window. This displays a dialog, - in which you can choose a directory and filename for the file. -
-- The panes are not automatically refreshed when you change one of the View objects or go to - another Activity. To refresh the Pixel Perfect pane and the Loupe pane, click - Refresh Screenshot at the top of the window. This will change the panes - to reflect the current screen image. You still may need to refresh the View Object pane; - to do this, click Refresh Tree at the top of the window. -
-- To automatically refresh the panes while you are debugging, set - Auto Refresh at the top of the window, and then set a refresh rate - with the Refresh Rate slider at the bottom of the Loupe pane. -
-- You often construct a UI based on a design done as a bitmap image. The Pixel Perfect window - helps you match up your View layout to a bitmap image by allowing you to load the bitmap as an - overlay on the screen image. -
-- To use a bitmap image as an overlay: -
-- By default, the overlay has a 50% transparency, which allows you to see the screen - image underneath. You can adjust this with the Overlay: slider at the - bottom of the Loupe pane. -
-- Also by default, the overlay is not displayed in the Loupe pane. To display it, - set Show in Loupe at the top of the window. -
-- The overlay is not saved as part of the screenshot when you save the screen image as a PNG - file. -
-- A screenshot of the Pixel Perfect window appears in figure 4. -
- - - - -The Android lint tool lets you analyze the XML -files that define your application's UI to find inefficiencies in the view hierarchy.
-Note: The Android layoutopt
tool has been replaced by the {@code lint} tool beginning in SDK Tools revision 16. The {@code lint} tool reports UI layout performance issues in a similar way as layoutopt
, and detects additional problems.
For more information about using {@code lint}, see Improving Your Code with lint and the lint tools help.
diff --git a/docs/html/tools/debugging/improving-w-lint.jd b/docs/html/tools/debugging/improving-w-lint.jd deleted file mode 100644 index 2f5e50d5a5ef..000000000000 --- a/docs/html/tools/debugging/improving-w-lint.jd +++ /dev/null @@ -1,343 +0,0 @@ -page.title=Improving Your Code with lint -parent.title=Debugging -parent.link=index.html -@jd:body - --In addition to testing that your Android application meets its functional requirements, it's -important to ensure that your code has no structural problems. Poorly structured code can impact the -reliability and efficiency of your Android apps and make your code harder to maintain. For example, -if your XML resource files contain unused namespaces, this takes up space and incurs unnecessary -processing. Other structural issues, such as use of deprecated elements or API calls that are not -supported by the target API versions, might lead to code failing to run correctly.
- -The Android SDK provides a code scanning tool called lint
-that can help you to easily identify and correct problems with the structural quality of your code,
-without having to execute the app or write any test cases. Each problem detected by the tool is
-reported with a description message and a severity level, so that you can quickly prioritize the
-critical improvements that need to be made. You can also configure a problem's severity level to
-ignore issues that are not relevant for your project, or raise the severity level. The tool has a
-command-line interface, so you can easily integrate it into your automated testing process.
The {@code lint} tool checks your Android project source files for potential bugs and -optimization improvements for correctness, security, performance, usability, accessibility, and -internationalization. You can run {@code lint} from the command-line or from Android Studio.
- -Note: In Android Studio, additional -IntelliJ code inspections run when your code is compiled in Android Studio to -streamline code review.
- -Figure 1 shows how the {@code lint} tool processes the application source files.
- - -lint.xml
fileThe {@code lint} tool is automatically installed as part of the Android SDK Tools revision 16 or -higher.
- - -In Android Studio, the configured lint
and
-IDE inspections run automatically whenever you build your app. The IDE inspections are
-configured along with the {@code lint} checks to run
-IntelliJ code inspections to streamline code review.
Note: To view and modify inspection severity -levels, use the File > Settings > Project Settings menu to open the -Inspection Configuration page with a list of the supported inspections.
- - -With Android Studio, you can also run {@code lint} inspections for a specific build variant,
-or for all build variants from the build.gradle
file. Add the
-lintOptions
property to the android
settings in the build file.
-This code snippet from a Gradle build file shows how to set the quiet
option to
-true
and the abortOnError
option to false
.
-android { - lintOptions { - // set to true to turn off analysis progress reporting by lint - quiet true - // if true, stop the gradle build if errors are found - abortOnError false - // if true, only report errors - ignoreWarnings true - } - ... - } -- - -
To manually run inspections in Android Studio, from the application or right-click menu, -choose Analyze > Inspect Code. The Specify Inspections Scope dialog -appears so you can specify the desired inspection scope and profile.
- - - - --To run {@code lint} against a list of files in a project directory: -
lint [flags] <project directory>-
For example, you can issue the following command to scan the files under the {@code myproject}
-directory and its subdirectories. The issue ID MissingPrefix
tells {@code lint} to
-only scan for XML attributes that are missing the Android namespace prefix.
lint --check MissingPrefix myproject-
To see the full list of flags and command-line arguments supported by the tool:
-lint --help- - -
The following example shows the console output when the {@code lint} command is run against a -project called Earthquake.
--$ lint Earthquake - -Scanning Earthquake: ............................................................................................................................... -Scanning Earthquake (Phase 2): ....... -AndroidManifest.xml:23: Warning: <uses-sdk> tag appears after <application> tag [ManifestOrder] - <uses-sdk android:minSdkVersion="7" /> - ^ -AndroidManifest.xml:23: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes] - <uses-sdk android:minSdkVersion="7" /> - ^ -res/layout/preferences.xml: Warning: The resource R.layout.preferences appears to be unused [UnusedResources] -res: Warning: Missing density variation folders in res: drawable-xhdpi [IconMissingDensityFolder] -0 errors, 4 warnings --
The output above lists four warnings and no errors in this project. Three warnings
-({@code ManifestOrder}, {@code UsesMinSdkAttributes}, and {@code UnusedResources}) were found in
-the project's AndroidManifest.xml
file. The remaining warning
-({@code IconMissingDensityFolder}) was found in the Preferences.xml
layout file.
By default, when you run a {@code lint} scan, the tool checks for all issues that are supported -by {@code lint}. You can also restrict the issues for {@code lint} to check and assign the severity -level for those issues. For example, you can disable {@code lint} checking for specific issues that -are not relevant to your project and configure {@code lint} to report non-critical issues at a lower -severity level.
-You can configure {@code lint} checking at different levels:
-The built-in Lint tool checks your code while you're using -Android Studio. You can view warnings and errors in two ways:
-To set default Lint checks:
-You can select individual checks, or entire categories.
- -To produce a list of Lint checks displayed in the Inspection Results -window:
-The scope specifies the files you want to analyze, and the profile specifies -the Lint checks you’d like to perform.
-In the Inspections dialog, you can search for a string -to find Lint checks. Note that changing Lint settings for a -profile in the Inspections dialog doesn’t change the default settings, -as described in the previous procedure. It does change the settings for profiles -displayed in the Inspections dialog, however.
-The results appear in the Inspection Results window, organized by -category.
- -You can specify your {@code lint} checking preferences in the lint.xml
file. If you
-are creating this file manually, place it in the root directory of your Android project. If you are
-configuring {@code lint} preferences in Android Studio, the lint.xml
file is
-automatically created and added to your Android project for you.
The lint.xml
file consists of an enclosing <lint>
parent tag that
-contains one or more children <issue>
elements. Each <issue>
-is identified by a unique id
attribute value, which is defined by {@code lint}.
-<?xml version="1.0" encoding="UTF-8"?> - <lint> - <!-- list of issues to configure --> -</lint> --
By setting the severity attribute value in the <issue>
tag, you can disable
-{@code lint} checking for an issue or change the severity level for an issue.
Tip: To see the full list of issues supported by the {@code lint}
-tool and their corresponding issue IDs, run the lint --list
command.
The following example shows the contents of a lint.xml
file.
-<?xml version="1.0" encoding="UTF-8"?> -<lint> - <!-- Disable the given check in this project --> - <issue id="IconMissingDensityFolder" severity="ignore" /> - - <!-- Ignore the ObsoleteLayoutParam issue in the specified files --> - <issue id="ObsoleteLayoutParam"> - <ignore path="res/layout/activation.xml" /> - <ignore path="res/layout-xlarge/activation.xml" /> - </issue> - - <!-- Ignore the UselessLeaf issue in the specified file --> - <issue id="UselessLeaf"> - <ignore path="res/layout/main.xml" /> - </issue> - - <!-- Change the severity of hardcoded strings to "error" --> - <issue id="HardcodedText" severity="error" /> -</lint> -- -
You can disable {@code lint} checking from your Java and XML source files.
- -Tip: If you are using Android Studio, you can use the -File > Settings > Project Settings > Inspections feature to manage the -{@code lint} checking to your Java or XML source files. -
- -To disable {@code lint} checking specifically for a Java class or method in your Android project,
-add the @SuppressLint
annotation to that Java code.
The following example shows how you can turn off {@code lint} checking for the {@code NewApi}
-issue in the onCreate
method. The {@code lint} tool continues to check for the
-{@code NewApi} issue in other methods of this class.
-@SuppressLint("NewApi") -@Override -public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.main); --
The following example shows how to turn off {@code lint} checking for the {@code ParserError}
-issue in the FeedProvider
class:
-@SuppressLint("ParserError") -public class FeedProvider extends ContentProvider { --
To suppress checking for all {@code lint} issues in the Java file, use the {@code all} keyword, -like this:
--@SuppressLint("all") -- -
You can use the tools:ignore
attribute to disable {@code lint} checking for specific
-sections of your XML files. In order for this attribute to be recognized by the {@code lint} tool,
-the following namespace value must be included in your XML file:
-namespace xmlns:tools="http://schemas.android.com/tools" --
The following example shows how you can turn off {@code lint} checking for the
-{@code UnusedResources} issue for the <LinearLayout>
element of an XML layout
-file. The ignore
attribute is inherited by the children elements of the parent element
-in which the attribute is declared. In this example, the {@code lint} check is also disabled for the
-child <TextView>
element.
-<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - tools:ignore="UnusedResources" > - - <TextView - android:text="@string/auto_update_prompt" /> -</LinearLayout> --
To disable more than one issue, list the issues to disable in a comma-separated string. For -example:
--tools:ignore="NewApi,StringFormatInvalid" --
To suppress checking for all {@code lint} issues in the XML element, use the {@code all} keyword, -like this:
--tools:ignore="all" -diff --git a/docs/html/tools/debugging/index.jd b/docs/html/tools/debugging/index.jd deleted file mode 100644 index 97179169f972..000000000000 --- a/docs/html/tools/debugging/index.jd +++ /dev/null @@ -1,185 +0,0 @@ -page.title=Debugging -@jd:body - - -
The Android SDK provides most of the tools that you need to debug your applications. You need - a JDWP-compliant debugger if you want to be able to do things such as step through code, - view variable values, and pause execution of an application. If you are using Android Studio, a - JDWP-compliant debugger is already included and there is no setup required. If you are using - another IDE, you can use the debugger that comes with it and attach the debugger to a special - port so it can communicate with the application VMs on your devices. The main components that - comprise a typical Android debugging environment are:
- -adb
acts as a middleman between a device and your development system. It
- provides various
- device management capabilities, including moving and syncing files to the emulator, running a
- UNIX shell on the device or emulator, and providing a general means to communicate with
- connected emulators and devices.adb
. DDMS can
- capture screenshots, gather thread and stack information, spoof incoming calls and SMS
- messages, and has many other features.adb
device daemon runs on the device or emulator and provides a means for the
- adb
host daemon to communicate with the device or emulator.jdb
.Figure 1 shows how the various debugging tools work together in a typical - debugging environment.
- -In addition to the main debugging tools, the Android SDK provides additional tools to help you - debug and profile your applications:
- -While debugging, keep these helpful tips in mind to help you figure out common problems with your -applications:
- -adb shell
, use ps
to find the process you
-want, and then kill -3
. The stack trace appears in the log file.
-adb shell
commands. See
-dumpsys and
-dumpstate on the adb topic page.-adb shell -logcat -b radio --
While developing your application, you should check that user interactions are buttery smooth, -running at a consistent 60 frames per second. If something goes wrong, and a frame gets dropped, the -first step in fixing the problem is understanding what the system is doing.
- -The Systrace tool allows you to collect and inspect timing information across an entire Android -device, which is called a trace. It shows where time and CPU cycles are being spent, -displaying what each thread and process is doing at any given time. It also inpects the captured -tracing information to highlight problems that it observes, from list item recycling to rendering -content, and provide recommendations about how to fix them. This document explains how to navigate -the trace files produced by the tool, and use them to analyze the performance of an application's -user interface (UI).
- -Systrace helps you analyze how the execution of your application fits into the many running -systems on an Android device. It puts together system and application thread execution on a common -timeline. In order to analyze your app with Systrace, you first collect a trace log of your app, and -the system activity. The generated trace allows you to view highly detailed, interactive reports -showing everything happening in the system for the traced duration.
- - - - -Figure 1. shows a trace captured while scrolling an app that is not rendering smoothly. By -default, a zoomed out view of the traced duration is shown. The horizontal axis is time, and trace -events are grouped by process, and then by thread on the vertical axis.
- -The groupings are in the order Kernel, SurfaceFlinger (the android compositor process), followed -by apps, each labeled by package name. Each app process contains all of the tracing signals from -each thread it contains, including a hierarchy of high level tracing events based on the enabled -tracing categories.
- - -In order to create a trace of your application, you must perform a few setup steps. First, you -must have a device running Android 4.1 (API 16) or higher. Set up the device -for debugging, connect it to your development -system, and install your application. Some types of trace information, specifically disk activity -and kernel work queues, require that you have root access to the device. However, most Systrace log -data only requires that the device be enabled for developer debugging.
- -Systrace traces can be run either from -a command line or from a -graphical user interface. This guide focuses on -using the command line options.
- -To run a trace on Android 4.3 and higher devices:
- --$ cd android-sdk/platform-tools/systrace -$ python systrace.py --time=10 -o mynewtrace.html sched gfx view wm --
For more information on the available options for running Systrace, see the -Systrace help page.
- - -To use Systrace effectively with devices running Android 4.2 and lower, - you must configure the types of processes you want to trace before running a trace. - The tool can gather the following types of process information:
- -To set trace tags for Systrace using the command-line:
- --$ cd android-sdk/platform-tools/systrace -$ python systrace.py --set-tags=gfx,view,wm --
-$ adb shell stop -$ adb shell start -
To set trace tags for Systrace using the device user interface:
- -- Note: The {@code adb} shell does not have to be stopped and restarted when - selecting trace tags using this method. -
- -After you have configured the category tags for your trace, you can start collecting - information for analysis.
- -To run a trace using the current trace tag settings:
- --$ python systrace.py --cpu-freq --cpu-load --time=10 -o mytracefile.html --
For more information on the available options for running Systrace, see the -Systrace help page.
- - -After you have generated a trace, open the output html file using a web browser. This section -explains how to analyze and interpret the information that the tool produces to find and fix UI -performance problems.
- -Each app that is rendering frames shows a row of frame circles, which are typically colored -green. Circles that are colored yellow or red, exceeding the 16.6 millisecond run time limit -required to maintain a stable 60 frames per second. Zoom in using the 'w' key to see the frames of -your application, and look for long-running frames getting in the way of smoothness.
- -- Note: Hit the '?' key, or the button in the top right for help navigating the - trace. -
- - - - -Clicking on one such frame highlights it, focusing only on the work done by the system for that -frame. On devices running Android 5.0 (API level 21) or higher, this work is split between the UI -Thread and RenderThread. On prior versions, all work in creating a frame is done on the UI -Thread.
- -Click on individual components of the frame to see how long they took to run. Some events, such -as performTraversals, describe what the system is doing in that method when you select -it. Selecting a frame displays any alerts present in that frame.
- -Systrace does automatic analysis of the events in the trace, and highlights many performance -problems as alerts, suggesting what to do next.
- - - - -After you select a slow frame such as the one shown in Figure 3, an alert may be displayed. In -the case above, it calls out that the primary problem with the frame is too much work being done -inside {@link android.widget.ListView} recycling and rebinding. There are links to the relevant -events in the trace, which can be followed to explain more about what the system is doing during -this time.
- -If you see too much work being done on the UI thread, as in this case with this -{@link android.widget.ListView} work, you can -use Traceview, the app code profiling -tool, to investigate exactly what is taking so much time.
- -Note that you can also find about every alert in the trace by clicking the Alerts tab to -the far right of the window. Doing so expands the Alerts panel, where you can see every alert that -the tool discovered in your trace, along with an occurrence count.
- - - - -The Alerts panel helps you see which problems occur in the trace, and how often they contribute -to jank. Think of the alerts panel as a list of bugs to be fixed, often a tiny change or improvement -in one area can eliminate an entire class of alerts from your application!
- - -The tracing signals defined by the framework do not have visibility into everything your -application is doing, so you may want to add your own. In Android 4.3 (API level 18) and higher, you -can use the methods of the {@link android.os.Trace} class to add signals to your code. This -technique can help you see what work your application's threads are doing at any given time. Tracing -begin and end events do add overhead while a trace is being captured, a few microseconds each, but -sprinkling in a few per frame, or per worker thread task can go a long way to adding context to a -trace of your app.
- -The following code example shows how to use the {@link android.os.Trace} class to track -execution of an application method, including two nested code blocks within that method.
- --public void ProcessPeople() { - Trace.beginSection("ProcessPeople"); - try { - Trace.beginSection("Processing Jane"); - try { - // code for Jane task... - } finally { - Trace.endSection(); // ends "Processing Jane" - } - - Trace.beginSection("Processing John"); - try { - // code for John task... - } finally { - Trace.endSection(); // ends "Processing John" - } - } finally { - Trace.endSection(); // ends "ProcessPeople" - } -} -- - -
- Note: When you nest trace calls within each other, the - {@link android.os.Trace#endSection} method ends the most recently called - {@link android.os.Trace#beginSection} method. This means that a trace started within another - trace cannot extend beyond the end of the enclosing trace, so make sure your beginning and - ending method calls are properly matched to measure your applications processing. -
- -- Note: Traces must begin and end on the same thread. Do not call - {@link android.os.Trace#beginSection} on one thread of execution and then attempt to end the - trace with a call to {@link android.os.Trace#endSection} on another thread. -
- -When using application-level tracing with Systrace, you must specify the package name of your -application in the user interface or specify the {@code -a} or {@code --app=} options on the -command line. For more information, see the -Systrace usage guide.
- -You should enable app level tracing when profiling your app, even if you have not added signals -yourself. Library code can include very useful tracing signals when you enable application-level -tracing. The {@link android.support.v7.widget.RecyclerView} class is a great example of this, -providing information about several important stages of work it executes.
- diff --git a/docs/html/tools/device.jd b/docs/html/tools/device.jd deleted file mode 100644 index 2f39402db064..000000000000 --- a/docs/html/tools/device.jd +++ /dev/null @@ -1,329 +0,0 @@ -page.title=Using Hardware Devices -@jd:body - -When building a mobile application, it's important that you always test your application on a -real device before releasing it to users. This page describes how to set up your development -environment and Android-powered device for testing and debugging on the device.
- -You can use any Android-powered device as an environment for running, -debugging, and testing your applications. The tools included in the SDK make it easy to install and -run your application on the device each time you compile. You can install your application on the -device directly from Android Studio or from the command line with ADB. If -you don't yet have a device, check with the service providers in your area to determine which -Android-powered devices are available.
- -If you want a SIM-unlocked phone, then you might consider a Nexus phone. To purchase a -Nexus phone, visit the Google Play store.
- -Note: When developing on a device, keep in mind that you should -still use the Android emulator to test your -application -on configurations that are not equivalent to those of your real device. Although the emulator -does not allow you to test every device feature (such as the accelerometer), it does -allow you to verify that your application functions properly on different versions of the Android -platform, in different screen sizes and orientations, and more.
- - -Android-powered devices have a host of developer options that you can -access on the phone, which let you:
-To access these settings, open the Developer options in the -system Settings. On Android 4.2 and higher, the Developer options screen is -hidden by default. To make it visible, go to -Settings > About phone and tap Build number seven times. Return to the previous -screen to find Developer options at the bottom.
- - - - -With an Android-powered device, you can develop and debug your Android applications just as you -would on the emulator. Before you can start, there are just a few things to do:
- -In the build file, make sure the debuggable property in the debug build - type is set to true. The build type property overrides the manifest setting.
--android { - buildTypes { - debug { - debuggable true - } -- -
In the AndroidManifest.xml
file, add android:debuggable="true"
to
-the <application>
element.
Note: If you manually enable debugging in the manifest - file, be sure to disable it in your release build (your published application -should usually not be debuggable).
Note: On Android 4.2 and newer, Developer - options is hidden by default. To make it available, go - to Settings > About phone and tap Build number - seven times. Return to the previous screen to find Developer options.
-udev
rules file that contains a USB configuration for each type of device
-you want to use for development. In the rules file, each device manufacturer
-is identified by a unique vendor ID, as specified by the
-ATTR{idVendor}
property. For a list of vendor IDs, see USB Vendor IDs, below. To set up device detection on
-Ubuntu Linux:
-
- /etc/udev/rules.d/51-android.rules
.
- Use this format to add each vendor to the file:
- SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
-
-
- In this example, the vendor ID is for HTC. The MODE
-assignment specifies read/write permissions, and GROUP
defines
-which Unix group owns the device node.
Note: The rule syntax
-may vary slightly depending on your environment. Consult the udev
-documentation for your system as needed. For an overview of rule syntax, see
-this guide to writing udev
-rules.
chmod a+r /etc/udev/rules.d/51-android.rules
- Note: When you connect a device running Android 4.2.2 or higher -to your computer, the system shows a dialog asking whether to accept an RSA key that allows -debugging through this computer. This security mechanism protects user devices because it ensures -that USB debugging and other adb commands cannot be executed unless you're able to unlock the -device and acknowledge the dialog. This requires that you have adb version 1.0.31 (available with -SDK Platform-tools r16.0.1 and higher) in order to debug on a device running Android 4.2.2 or -higher.
- - -When plugged in over USB, you can verify that your device is connected by executing adb
-devices
from your SDK {@code platform-tools/} directory. If connected,
-you'll see the device name listed as a "device."
If using Android Studio, run or debug your application as usual. You will be -presented with a Device Chooser dialog that lists the available -emulator(s) and connected device(s). Select the device upon which you want to -install and run the application.
- -If using the Android
-Debug Bridge (adb), you can issue commands with the -d
flag to
-target your connected device.
This table provides a reference to the vendor IDs needed in order to add USB
-device support on Linux. The USB Vendor ID is the value given to the
-ATTR{idVendor}
property in the rules file, as described
-above.
Company | USB Vendor ID |
---|---|
Acer | -0502 |
-
ASUS | -0b05 |
-
Dell | -413c |
-
Foxconn | -0489 |
-
Fujitsu | -04c5 |
-
Fujitsu Toshiba | -04c5 |
-
Garmin-Asus | -091e |
-
18d1 |
- |
Haier | -201E |
-
Hisense | -109b |
-
HP | -03f0 |
-
HTC | -0bb4 |
-
Huawei | -12d1 |
-
Intel | -8087 |
-
K-Touch | -24e3 |
-
KT Tech | -2116 |
-
Kyocera | -0482 |
-
Lenovo | -17ef |
-
LG | -1004 |
-
Motorola | -22b8 |
-
MTK | -0e8d |
-
NEC | -0409 |
-
Nook | -2080 |
-
Nvidia | -0955 |
-
OTGV | -2257 |
-
Pantech | -10a9 |
-
Pegatron | -1d4d |
-
Philips | -0471 |
-
PMC-Sierra | -04da |
-
Qualcomm | -05c6 |
-
SK Telesys | -1f53 |
-
Samsung | -04e8 |
-
Sharp | -04dd |
-
Sony | -054c |
-
Sony Ericsson | -0fce |
-
Sony Mobile Communications | -0fce |
-
Teleepoch | -2340 |
-
Toshiba | -0930 |
-
ZTE | -19d2 |
-
The Android Emulator simulates a device and displays it on your development -computer. It lets you prototype, develop, and test -Android apps without using a hardware device. The emulator supports Android -phone, tablet, Android Wear, and Android TV devices. It comes with predefined -device types -so you can get started quickly, and you can create your own device definitions -and emulator skins.
- -The Android Emulator is fast, -powerful, and feature-rich. It can transfer information faster than using -a connected hardware device, speeding up the development process. The -multi-core feature lets the emulator take advantage of multiple core -processors on your development computer to improve emulator performance even -more.
- - - -You can launch an app on the emulator when you run your project, or you can -drag an APK file onto the emulator to install it. As with a hardware device, -after you install an app -on a virual device, it remains until you uninstall or replace it. If needed, you -can test how multiple apps, such as your own or system apps, work with each -other.
- -You interact with the emulator just as you would with a hardware device, but -using your mouse and keyboard, and emulator buttons and controls. -The emulator supports virtual hardware buttons and touchscreens, including -two-finger operations, -as well as directional pads (D-pads), trackballs, wheels, and various -sensors. You can dynamically resize the emulator window as needed, zoom in and -out, change the orientation, and even take a screenshot.
- -When your app is running on -the emulator, it can use the services of the Android platform to invoke other -apps, access the network, play audio and video, accept audio input, -store and retrieve data, notify the user, and render graphical transitions and -themes. The emulator has controls that let -you easily send incoming phone calls and text messages, specify -the location of the device, simulate fingerprint scans, specify network -speed and status, and simulate battery properties. The emulator can -simulate an SD card and internal data storage; you can drag a file, such as a -graphics or data file, onto the emulator to store it.
- -The emulator uses an Android Virtual Device (AVD) configuration to determine -the look, functionality, and system image of the simulated device. AVDs let you -define certain hardware aspects of your emulated devices and allow you to create -many configurations to test different Android platforms and hardware -permutations.
- -Each AVD functions as an independent device, with its own private storage for -user data, SD card, and so on. When you launch the emulator with an AVD -configuration, it automatically loads the user data and SD card data from the -AVD directory. By default, the emulator stores the user data, SD card data, and -cache in the AVD directory.
- -To create and manage AVDs, use the -AVD Manager. -For more information, see -Managing Virtual Devices.
- -The Android Emulator runs a full -Android system stack, down to the kernel level, that includes a set of -preinstalled apps (such as the dialer) that you can access from your -apps. You can choose which version of the Android system you want to -run in the emulator when creating AVDs. -
- -The Android system images available through the AVD Manager contain -code for the Android Linux kernel, the native libraries, the VM, and the -various Android packages (such as the Android framework and preinstalled -apps).
- -The Android Emulator has the following requirements:
-The Android Emulator supports most features of a device, but doesn't -include virtual hardware for:
-The watch emulator for Android Wear doesn't support the Overview -(Recent Apps) button, D-pad, and fingerprint sensor.
- -While most end users of phones and tablets tend to use earlier API levels, -Android Wear and Android TV users tend to use the latest releases. Using recent -releases can give you a better experience using the emulator. -
- -You can run an app from an Android Studio project. Or, you can run an app -that's been installed on the emulator as you would run any app on a device.
- -To start the emulator and run an app in your project:
-The Select Deployment Target dialog appears.
- -The No USB devices or running emulators detected warning -means that you don’t currently have any emulators running, or any detected -hardware devices connected to your computer. If you -don’t have hardware devices connected to your computer, or any emulators -running, you can ignore it.
-Some errors you must fix before you can continue, such as certain Hardware -Accelerated Execution Manager (Intel® HAXM) errors.
-If you don’t see a definition you want to use, click Create New -Emulator to launch the AVD Manager. After you define a new AVD, in -the Select Deployment -Target dialog, click OK.
-If you want to use this emulator definition as the default for your project, -select Use same selection for future launches.
-The emulator launches and displays your app.
-You can use the features described in the following sections:
-The emulator device stores the installed app so you can run it again, if - needed. You need to uninstall an app to remove it. If you run the project - again on the same emulator, it replaces the app with the new version.
-To start the emulator:
-The Android Emulator appears.
-While the emulator is running, you can run Android Studio projects and - choose the - emulator as the target device. You can also drag one or more APKs onto the - emulator to install them, and then run them.
-Use your computer mouse pointer to mimic your finger on the touchscreen; -select menu items and input fields; and click buttons and controls. -Use your computer keyboard to type characters and enter emulator shortcuts.
-Feature | -Description | -
---|---|
Swipe the screen | -Point to the screen, press and hold the primary mouse button, swipe - across the screen, and then release. | -
Drag an item | -Point to an item on the screen, press and hold the primary mouse - button, move the item, and then release. | -
Tap (touch) |
- Point to the screen, press the primary mouse button, and then release. - For example, you could click a text field to start typing in it, select an - app, or press a button. | -
Double tap | -Point to the screen, press the primary mouse button quickly twice, - and then release. | -
Touch and hold | -Point to an item on the screen, press the primary mouse button, hold, - and then release. For example, you could open options for an item. | -
Type | -You can type in the emulator by using your computer keyboard, or using - a keyboard that pops up on the emulator screen. For example, you could - type in a text field after you selected it. | -
Pressing Ctrl or Command (⌘) brings up a pinch gesture multi-touch
- interface. The mouse acts as the first finger, and across the anchor point
- is the second finger. Drag the cursor to move the first point.
- Clicking the left mouse button acts like touching down both points, and
- releasing acts like picking both up. |
-
The panel on the right side of the emulator lets you perform various tasks. -You can also drag files onto the emulator to install apps and download files. -
-Feature | -Description | -Keyboard Shortcut | -
---|---|---|
Close |
- Close the emulator. | -- |
Minimize |
- Minimize the emulator window. | -- |
Resize | -Resize the emulator as you would any other operating system window. The -emulator maintains an aspect ratio appropriate for your device. | -⌘↑ and ⌘↓ | -
Power |
- Click to turn the screen on or off. Click and hold to turn the device - on or off. |
- Ctrl+P ⌘P |
-
Volume Up |
- Click to view a slider control and turn the volume up. Click again to - turn it up more, or use the slider control to change the volume. | -Ctrl+= ⌘= |
-
Volume Down |
- Click to view a slider control and turn the volume down. Click again to - turn it down more, or use the slider control to change the volume. | -Ctrl+- ⌘- |
-
Rotate Left |
- Rotate the phone 90 degrees counterclockwise. | -Ctrl+Left ⌘← |
-
Rotate Right |
- Rotate the phone 90 degrees clockwise. | -Ctrl+Right ⌘→ |
-
Take Screenshot - |
- Click to take a screenshot of the device. The default save location is
- your computer desktop. To change the save location, select
- … > Settings. The emulator creates a
- file with the name Screenshot_yyyymmdd-hhmmss.png
- using the year, month, day, hour, minute, and second of the capture, for
- example, Screenshot_20160219-145848.png . |
- Ctrl+S ⌘S |
-
- |
- Click so the cursor changes to the zoom icon: -
Click Enter Zoom Mode again to return to normal screen size. |
- Ctrl+Z ⌘Z
- While in zoom mode:
- Ctrl+Up Ctrl+Down
- Ctrl+Shift+Up Ctrl+Shift+Down
- Ctrl+Shift+Left Ctrl+Shift+Right
- ⌘↑ and ⌘↓
- ⇧⌘↑ and ⇧⌘↓
- ⇧⌘← and ⇧⌘→ |
-
Back |
- Return to the previous screen, or close a dialog box, an options menu, - the Notifications panel, or the onscreen keyboard. | -Ctrl+Backspace
- ⌘⌫ |
-
Home |
- Return to the Home screen. Press and hold to open the item specific to - your API level. | -Ctrl+H ⌘⇧H |
-
Overview
- (Recent Apps) |
- Tap to open a list of thumbnail images of apps you’ve worked with - recently. To open an app, tap it. To remove a thumbnail from the list, - swipe it left or right. This button isn't supported for Android Wear. | -Ctrl+O ⌘O |
-
Menu | -Type the keyboard shortcut to simulate the Menu button, for example, - to open the menu for the selected app. | -Ctrl+M ⌘M |
-
More |
- Click to access other features and settings, described in the next - table. | -- |
Install an APK | -Drag an APK file onto the emulator screen. An APK Installer dialog - appears. When the installation completes, you can view the app in your - apps list.The app didn’t install if a dialog appears that says “APK failed - to install.” | -- |
Add a file | -Drag any file onto the emulator screen. It’s placed in the
- /sdcard/Download directory. Navigate to the file using the
- method for the API level. For example, for API 22, this is the navigation
- path: Settings > Device: Storage & USB
- > Internal Storage > Explore
- (Virtual SD Card). |
- - |
Toggle trackball mode | -- | F6 | -
The extended controls let you send data, change device properties, control -apps, and more. To access the controls, select … in the -emulator panel and then select the option you want in the left panel of the -Extended Controls dialog.
- -Feature | -Description | -Keyboard Shortcuts | -
---|---|---|
Location | -
- The emulator lets you simulate “my location” information: the location where -the emulated device is currently located. For example, if you click My Location - - in Google Maps and then send a location, the map shows it. -To send a GPS location: -
In decimal mode, enter a Latitude value in the range -90.0 -to +90.0 degrees and a Longitude value in the range -180.0 to -+180.0 degrees. -In sexigesimal mode, enter a three-part Latitude value in -the range -90 to +90 degrees, 0 to 59 minutes, and 0.0 to 60.0 -seconds. Enter a Longitude value in the range -180 to +180 -degrees, 0 to 59 minutes, and 0.0 to 60.0 seconds. -For the latitude, - indicates south and + indicates north; for the longitude, -- indicates west and + indicates east. The + is optional. -Optionally specify an Altitude value in the range --1,000.0 to +10,000.0 meters. - -To use geographic data from a GPS exchange format (GPX) or Keyhole Markup -Language (KML) file: -
The speed defaults to the Delay value (Speed -1X). You can increase the speed by double (Speed -2X), triple (Speed 3X), and so on. - - |
- Ctrl+Shift+L ⇧⌘L |
-
Cellular | -The emulator lets you simulate various network conditions. You can - approximate the network speed for different network protocols, or you can - specify Full, which transfers data as quickly as your - computer allows. Specifying a network protocol is always slower than - Full. You can also specify the voice and data network - status, such as roaming. The defaults are set in the AVD. -Select a Network type: -
Select a Voice status, Data status, or -both: -
|
- Ctrl+Shift+C ⇧⌘C |
-
Battery | -You can simulate the battery properties of a device to see how your - app performs under different conditions. To select a Charge - level, use the slider control. -Select a Charger connection value: -
Select a Battery health value: -
Select a Battery status value: -
|
- Ctrl+Shift+B ⇧⌘B |
-
Phone | -The emulator lets you simulate incoming phone calls and text - messages. Note that the information flow is one way, from the control to - the emulator. For example, the control doesn’t change its state if the - emulator hangs up; you need to end the call in the control. -To initiate a call to the emulator: -
To send a text message to the emulator: -
|
- Ctrl+Shift+P ⇧⌘P |
-
Directional Pad | -If the AVD has the directional pad enabled in the hardware profile, - you can use the directional pad controls with the emulator. However, not - all devices can support the directional pad; for example, an Android watch. - The buttons simulate the following actions: - - |
- Ctrl+Shift+D ⇧⌘D |
-
Fingerprint | -This control can simulate 10 different fingerprint scans. You can - use it to test fingerprint integration in your app. This feature isn't - supported for Android Wear. -To simulate a fingerprint scan on the virtual device: -
|
- Ctrl+Shift+F ⇧⌘F |
-
Settings | -You can specify the following settings: -
|
- Ctrl+Shift+S ⇧⌘S |
-
Help > Keyboard Shortcuts | -See the keyboard shortcuts that the emulator accepts. For the - shortcuts to work, you need to: -
|
- F1 ⌘/ |
-
Help > Emulator Help | -To go to the online documentation for the emulator, click - Documentation. -To file a bug against the emulator, click File a Bug. - -To make suggestions, click Send Feedback. -All of these links require an internet connection and a browser. |
- F1 ⌘/ |
-
Help > About | -See which adb port the emulator uses, as well as the Android and - emulator version numbers. Compare the latest available emulator version - with your version to determine if you have the latest software installed. - -The emulator serial number is emulator-adb_port, - which you can specify as an adb command line option, for example. |
- F1 ⌘/ |
-
An Android Virtual Device (AVD) is an emulator configuration that lets you model an actual - device by defining hardware and software options to be emulated by the Android Emulator.
- -The easiest way to create an AVD is to use the graphical
- AVD Manager, which you launch
- from Android Studio by clicking Tools > Android > AVD Manager. You can
- also start the AVD Manager from the command line by calling the android
tool with
- the avd
options, from the <sdk>/tools/ directory.
You can also create AVDs on the command line by passing the android
tool options.
- For more information on how to create AVDs in this manner, see
- Managing Virtual Devices from the
- Command Line.
An AVD consists of:
- -You can create as many AVDs as you need, based on the types of device you want to model. - To thoroughly test your application, you should create an AVD for each general device configuration - (for example, different screen sizes and platform versions) with which your application is compatible - and test your application on each one.
- -Keep these points in mind when you are selecting a system image target for your AVD:
- -minSdkVersion
attribute of the application's manifest file. For more
- information about the relationship between system API Level and application
- minSdkVersion
, see Specifying Minimum System API Version.uses-library
- element in its manifest file, the application can only run on a system image in which that external
- library is present. If you want to run your application on an emulator, create an AVD that
- includes the required library. Usually, you must create such an AVD using an Add-on component for the
- AVD's platform (for example, the Google APIs Add-on contains the Google Maps library).To learn how to manage AVDs using a graphical tool, read Managing AVDs with AVD Manager. To - learn how to manage AVDs on the command line, read - Managing AVDs - from the Command Line.
- - - - - - diff --git a/docs/html/tools/devices/managing-avds-cmdline.jd b/docs/html/tools/devices/managing-avds-cmdline.jd deleted file mode 100644 index c16b1f85e6a2..000000000000 --- a/docs/html/tools/devices/managing-avds-cmdline.jd +++ /dev/null @@ -1,369 +0,0 @@ -page.title=Managing AVDs from the Command Line -parent.title=Managing Virtual Devices -parent.link=index.html -@jd:body - -The android
tool lets you manage AVDs on the command line. For a complete reference
-of the command line options that you can use, see the reference for the
-android
tool.
To generate a list of system image targets, use this command:
- -android list targets- -
The android
tool scans the <sdk>/platforms/
and
-<sdk>/add-ons/
directories looking for valid system images and
-then generates the list of targets. Here's an example of the command output:
-
Available Android targets: -id: 1 or "android-3" - Name: Android 1.5 - Type: Platform - API level: 3 - Revision: 4 - Skins: QVGA-L, HVGA-L, HVGA (default), HVGA-P, QVGA-P -id: 2 or "android-4" - Name: Android 1.6 - Type: Platform - API level: 4 - Revision: 3 - Skins: QVGA, HVGA (default), WVGA800, WVGA854 -id: 3 or "android-7" - Name: Android 2.1-update1 - Type: Platform - API level: 7 - Revision: 2 - Skins: QVGA, WQVGA400, HVGA (default), WVGA854, WQVGA432, WVGA800 -id: 4 or "android-8" - Name: Android 2.2 - Type: Platform - API level: 8 - Revision: 2 - Skins: WQVGA400, QVGA, WVGA854, HVGA (default), WVGA800, WQVGA432 -id: 5 or "android-9" - Name: Android 2.3 - Type: Platform - API level: 9 - Revision: 1 - Skins: HVGA (default), WVGA800, WQVGA432, QVGA, WVGA854, WQVGA400 -- - - -
In addition to creating AVDs with the
-AVD Manager user interface,
-you can also create them by passing in command line arguments to the android
tool.
-
Open a terminal window and change to
-the <sdk>/tools/
directory, if needed.
To create each AVD, you issue the command android create avd
,
-with options that specify a name for the new AVD and the system image you want
-to run on the emulator when the AVD is invoked. You can specify other options on
-the command line also, such as the emulated SD card size, the emulator skin, or a custom
-location for the user data files.
Here's the command-line usage for creating an AVD:
- -android create avd -n <name> -t <targetID> [-<option> <value>] ...- -
You can use any name you want for the AVD, but since you are likely to be
-creating multiple AVDs, you should choose a name that lets you recognize the
-general characteristics offered by the AVD. The target ID is an integer assigned by the
-android
tool. The target ID is not derived from the system image name,
-version, or API Level, or other attribute, so you need to run the android list targets
-command to list the target ID of each system image. You should do this before you run
-the android create avd
command. See the android
-tool documentation for more information on the command line options.
When you've selected the target you want to use and made a note of its ID,
-use the android create avd
command to create the AVD, supplying the
-target ID as the -t
argument. Here's an example that creates an
-AVD with name "my_android1.5" and target ID "2" (the standard Android 1.5
-system image in the list above):
android create avd -n my_android1.5 -t 2- -
If the target you selected was a standard Android system image ("Type:
-platform"), the android
tool next asks you whether you want to
-create a custom hardware profile.
Android 1.5 is a basic Android platform. -Do you wish to create a custom hardware profile [no]- -
If you want to set custom hardware emulation options for the AVD, enter
-"yes" and set values as needed. If you want to use the default hardware
-emulation options for the AVD, just press the return key (the default is "no").
-The android
tool creates the AVD with name and system image mapping you
-requested, with the options you specified. For more information, see
-Setting Hardware Emulation Options.
-
-
Note: If you are creating an AVD whose target is an SDK add-on, the
-android
tool does not allow you to set hardware emulation options.
-It assumes that the provider of the add-on has set emulation options
-appropriately for the device that the add-on is modeling, and so prevents you
-from resetting the options.
When testing your application, we recommend that you test your application in several different -AVDs, using different screen configurations (different combinations of size and density). In -addition, you should set up the AVDs to run at a physical size that closely matches an actual -device.
- -To set up your AVDs for a specific resolution or density, follow these steps:
- -create avd
command to create a new AVD, specifying
-the --skin
option with a value that references either a default
-skin name (such as "WVGA800") or a custom skin resolution (such as 240x432).
-Here's an example:
- android create avd -n <name> -t <targetID> --skin WVGA800-
In the example above (WVGA medium density), the new AVD will emulate a 5.8" -WVGA screen.
- -As an alternative to adjusting the emulator skin configuration, you can use
-the emulator skin's default density and add the -dpi-device
option
-to the emulator command line when
-starting the AVD. For example:
emulator -avd WVGA800 -scale 96dpi -dpi-device 160- - - -
When you create an AVD, the android
tool creates a dedicated directory for it
-on your development computer. The directory contains the AVD configuration file,
-the user data image and SD card image (if available), and any other files
-associated with the device. Note that the directory does not contain a system
-image — instead, the AVD configuration file contains a mapping to the
-system image, which it loads when the AVD is launched.
The android
tool also creates an <AVD_name>.ini
file for the AVD at the
-root of the .android/avd/
directory on your computer. The file specifies the
-location of the AVD directory and always remains at the root the .android
-directory.
By default, the android
tool creates the AVD directory inside
-~/.android/avd/
(on Linux/Mac), C:\Documents and
-Settings\<user>\.android\
on Windows XP, and
-C:\Users\<user>\.android\
on Windows 7 and Vista.
-If you want to use a custom location for the AVD directory, you
-can do so by using the -p <path>
option when
-you create the AVD:
android create avd -n my_android1.5 -t 2 -p path/to/my/avd- -
If the .android directory is hosted on a network drive, we recommend using
-the -p
option to place the AVD directory in another location.
-The AVD's .ini file remains in the .android directory on the network
-drive, regardless of the location of the AVD directory.
-
-
-
When you are creating a new AVD that uses a standard Android system image ("Type:
-platform"), the android
tool lets you set hardware emulation
-options for virtual device. The table below lists the options available and the
-default values, as well as the names of properties that store the emulated
-hardware options in the AVD's configuration file (the config.ini file in the
-AVD's local directory).
Characteristic | -Description | -Property | -
---|---|---|
Device ram size | -The amount of physical RAM on the device, in megabytes. Default value is "96". - | hw.ramSize | -
Touch-screen support | -Whether there is a touch screen or not on the device. Default value is "yes". | -hw.touchScreen - - |
Trackball support | -Whether there is a trackball on the device. Default value is "yes". | -hw.trackBall | -
Keyboard support | -Whether the device has a QWERTY keyboard. Default value is "yes". | -hw.keyboard | -
DPad support | -Whether the device has DPad keys. Default value is "yes". | -hw.dPad | -
GSM modem support | -Whether there is a GSM modem in the device. Default value is "yes". | -hw.gsmModem | -
Camera support | -Whether the device has a camera. Default value is "no". | -hw.camera | -
Maximum horizontal camera pixels | -Default value is "640". | -hw.camera.maxHorizontalPixels | -
Maximum vertical camera pixels | -Default value is "480". | -hw.camera.maxVerticalPixels | -
GPS support | -Whether there is a GPS in the device. Default value is "yes". | -hw.gps | -
Battery support | -Whether the device can run on a battery. Default value is "yes". | -hw.battery | -
Accelerometer | -Whether there is an accelerometer in the device. Default value is "yes". | -hw.accelerometer | -
Audio recording support | -Whether the device can record audio. Default value is "yes". | -hw.audioInput | -
Audio playback support | -Whether the device can play audio. Default value is "yes". | -hw.audioOutput | -
SD Card support | -Whether the device supports insertion/removal of virtual SD Cards. Default value is "yes". | -hw.sdCard | -
Cache partition support | -Whether we use a /cache partition on the device. Default value is "yes". | -disk.cachePartition | -
Cache partition size | -Default value is "66MB". | -disk.cachePartition.size | -
Abstracted LCD density | -Sets the generalized density characteristic used by the AVD's screen. Default value is "160". | -hw.lcd.density | -
Trackball support | -Whether there is a trackball present. | -hw.trackBall | -
If you want to move or rename an AVD, you can do so using this command:
- -android move avd -n <name> [-<option> <value>] ...- -
If, for any reason, the platform/add-on root folder has its name changed (maybe because the user has installed an update of the platform/add-on) then the AVD will not be able to load the system image that it is mapped to. In this case, the android list targets
command will produce this output:
-
-
The following Android Virtual Devices could not be loaded: -Name: foo -Path: <path>/.android/avd/foo.avd -Error: Invalid value in image.sysdir. Run 'android update avd -n foo'- -
To fix this error, use the android update avd
command to recompute the path to the system images.
You can use the android
tool to delete an AVD. Here is the command usage:
android delete avd -n <name>- -
When you issue the command, the android
tool looks for an AVD matching the
-specified name deletes the AVD's directory and files.
An Android Virtual Device (AVD) definition lets you define the - characteristics of an Android phone, tablet, Android Wear, or Android TV - device that you want to simulate in the - Android Emulator. - The AVD Manager helps you easily create and manage AVDs.
- -To effectively test your app, you should create an AVD that models each - device type that your app is designed to support. For example, we recommend - that you create an AVD for each API level that's equal to and higher than the - minimum version you've specified in your manifest - {@code <uses-sdk>} tag.
- -An AVD contains a hardware profile, system image, skin, and other - properties.
- -The hardware profile defines the characteristics of a device as - shipped from the factory. The AVD Manager comes preloaded with certain - hardware profiles, such as Nexus phone devices, and you can define and import - hardware profiles as needed. You can override some of the settings in your - AVD, if needed.
- -The AVD Manager helps you choose a system image for your AVD by providing - recommendations. It also lets - you download system images, some with add-on libraries, like Google APIs, - which your app might require. x86 system images run the fastest in the - emulator. Android Wear and Android TV devices tend to run best (and have - the largest installed base) on recent releases, while users of Android phones - and tablets tend to use slightly older releases, as shown in the - API level - dashboards.
- -An emulator skin specifies the appearance of a device. The AVD Manager - provides some predefined skins. You can also define your own, or use skins - provided by third parties.
- -Just as with a real device, for apps to use certains features defined in an
- AVD, such as the camera, it must have the corresponding
- <uses-feature>
- setting in the app manifest.
The AVD Manager lets you manage your AVDs all in one place.
- -To run the AVD Manager:
- -The AVD Manager appears.
- - - -It displays any AVDs you’ve already defined. When you first install -Android Studio, it creates one AVD. If you defined AVDs for Android Emulator -24.0.x or lower, you need to recreate them.
- -From this page you can:
- -.ini
and
- .img
files on disk.You can create a new AVD from the beginning, or - duplicate an AVD and change some properties.
- -To create a new AVD:
- -Alternatively, - run your - app from within Android Studio. In the Select Deployment Target - dialog, click Create New Emulator.
- -The Select Hardware page appears.
- - -If you don't see the hardware profile you want, you can - create - or import a hardware profile.
- -The System Image page appears.
- - - -The Recommended tab lists recommended system images. The - other tabs include a more complete list. The right pane describes the - selected system image. x86 images run the fastest in the emulator.
-If you see Download next to the system image, you need - to click it to download the system image. You must be connected to the - internet to download it.
- -The Verify Configuration page appears.
- - -Click Show Advanced Settings to show more - settings, such as the skin.
-The new AVD appears in the Your Virtual Devices page or the - Select Deployment Target dialog.
-To create an AVD starting with a copy:
- -Or click Menu - - and select Duplicate.
- -The Verify Configuration - page appears.
- -The AVD appears in the Your Virtual Devices page. - -
The AVD Manager provides predefined hardware profiles for common devices so -you can easily add them to your AVD definitions. If -you need to define a different device, you can create a new hardware profile. -You can define a new hardware profile from the beginning, -or copy a hardware profile as a start. The preloaded -hardware profiles aren't editable.
- -To create a new hardware profile from the beginning:
-Your new hardware profile appears in the Select Hardware page. - You can optionally create an AVD - that uses the hardware profile - by clicking Next. Or, click Cancel to return - to the Your Virtual Devices page or Select Deployment Target - dialog.
-To create a hardware profile starting with a copy:
- -Or right-click a hardware profile and select Clone. - -
Your new hardware profile appears in the Select Hardware page. - You can optionally create an AVD - that uses the hardware profile - by clicking Next. Or, click Cancel to return - to the Your Virtual Devices page or Select Deployment Target - dialog.
-From the Your Virtual Devices page, you can - perform the following operations on an existing AVD:
-.ini
and
- .img
files on disk, right-click an AVD and select
- Show on Disk. Or click Menu
-
- and select Show on Disk.From the Select Hardware page, -you can - perform the following operations on an existing hardware profile:
-You can't edit or delete the predefined hardware profiles.
- -From the Your Virtual Devices page, you can - perform the following operations on an emulator:
-From the Select Hardware page, -you can import and export hardware profiles:
-You can specify the following properties of hardware profiles in the -Configure Hardware Profile page. AVD -configuration properties override hardware profile properties, and emulator -properties that you set while the emulator is running override them both.
- -The predefined hardware profiles included with the AVD Manager aren't -editable. However, you can copy them and edit the copies.
- - -Hardware Profile Property | -Description | -
---|---|
Device Name | -Name of the hardware profile. The name can contain uppercase or - lowercase letters, - numbers from 0 to 9, periods (.), underscores (_), and parentheses ( () ). - The name of the file storing the hardware profile is derived from the - hardware profile name. - | -
Device Type | -Select one of the following:
-
|
-
Screen Size | -The physical size of the screen, in inches, measured at the diagonal. - If the size is larger than your computer screen, it’s reduced in size at - launch. | -
Screen Resolution | -Type a width and height in pixels to specify the total number of pixels - on the simulated screen. | - -
Round | -Select this option if the device has a round screen, such as an - Android Wear device. | -
Memory: RAM | -Type a RAM size for the device and select the units, one of B (byte), - KB (kilobyte), MB (megabyte), GB (gigabyte), or TB (terabyte). | -
Input: Has Hardware Buttons (Back/Home/Menu) | -Select this option if your device has hardware navigation buttons. - Deselect it if these buttons are implemented in software only. If you - select this option, the buttons won’t appear on the screen. You can use the - emulator side panel to “press” the buttons, in either case. | -
Input: Has Hardware Keyboard | -Select this option if your device has a hardware keyboard. Deselect it - if it doesn’t. If you select this option, a keyboard won’t appear on the - screen. You can use your computer keyboard to send keystrokes to the - emulator, in either case. | -
Navigation Style | -Select one of the following: -
These options are for actual hardware controls on the device itself. - However, - the events sent to the device by an external controller are the same. - |
-
Supported Device States | -Select one or both options: -
If you select both, you can switch between orientations in the emulator. -You must select at least one option to continue. |
-
Cameras | -Select one or both options: -
Later, you can use a webcam or a photo provided by the emulator to simulate -taking a photo with the camera. |
-
Sensors: Accelerometer | -Select if the device has hardware that helps the device determine - its orientation. | -
Sensors: Gyroscope | -Select if the device has hardware that detects rotation or twist. - In combination with an - accelerometer, it can provide smoother orientation detection and support - a six-axis orientation system. | -
Sensors: GPS | -Select if the device has hardware that supports the Global Positioning - System (GPS) - satellite-based navigation system. | -
Sensors: Proximity Sensor | -Select if the device has hardware that detects if the device is close - to your face during a - phone call to disable input from the screen. | -
Default Skin | -Select a skin that controls what the device looks like when displayed - in the - emulator. Remember that specifying a screen size that's too small for the - resolution can mean that the screen is cut off, so you can't see the whole - screen. See - Creating Emulator Skins - for more information. | -
You can specify the following properties for AVD configurations -in the Verify Configuration page. -The AVD configuration specifies the interaction between the development -computer and the emulator, as well as properties you want to override in the -hardware profile.
- -AVD configuration properties override hardware profile properties, -and emulator -properties that you set while the emulator is running override them both.
- -AVD Property | -Description | -
---|---|
AVD Name | -Name of the AVD. The name can contain uppercase or - lowercase letters, - numbers from 0 to 9, periods (.), underscores (_), and parentheses ( () ). - The name of the file storing the AVD configuration is derived from the AVD - name. - | -
AVD ID (Advanced) | -The AVD filename is derived from the ID, and you can use the ID to - refer to the AVD from the command line. | -
Hardware Profile | -Click Change to select a different hardware profile in - the Select Hardware page. | -
System Image | -Click Change to select a different system image in the - System Image page. - An active internet connection is required to download a new image. | -
Startup: Scale | -Select the initial size you want to use when the emulator launches. - This size might be adjusted to a smaller size if it’s larger than the - computer screen. The default is Auto (automatic). | -
Startup: Orientation | -Select one option for the initial emulator orientation: -
An option is enabled only if it’s selected in the hardware profile. When -running the AVD in the emulator, you can change the orientation if portrait and -landscape are supported in the hardware profile. |
-
Camera (Advanced) | -Select one or both options: -
This option is available only if it's selected in the hardware profile; it's -not available for Android Wear and Android TV. |
-
Network: Speed (Advanced) | -Select a network protocol to determine the speed of data transfer: - -
|
-
Network: Latency (Advanced) | -Select a network protocol to set how much time (delay) it takes for the - protocol to transfer a data packet from one point to another point. | -
Emulated Performance: Graphics | -Select how graphics are rendered in the emulator: -
|
-
Multi-Core CPU (Advanced) | -Select the number of processor cores on your computer that you’d like - to use for the emulator. Using more processor cores speeds up the emulator. - | -
Memory and Storage: RAM | -The amount of RAM on the device. This value is set by the hardware - manufacturer, but you can override it, if needed, such as for faster - emulator operation. Increasing the size uses more resources on your - computer. Type a RAM size and select the - units, one of B (byte), KB (kilobyte), MB (megabyte), GB (gigabyte), or - TB (terabyte). | -
Memory and Storage: VM Heap | -The VM heap size. This value is set by the hardware - manufacturer, but you can override it, if needed. Type a heap size and - select the - units, one of B (byte), KB (kilobyte), MB (megabyte), GB (gigabyte), or - TB (terabyte). For more information on Android VMs, see - Memory Management for - Different Virtual Machines. | -
Memory and Storage: Internal Storage | -The amount of nonremovable memory space available on the device. This - value is set by the hardware - manufacturer, but you can override it, if needed. Type a size and select the - units, one of B (byte), KB (kilobyte), MB (megabyte), GB (gigabyte), or - TB (terabyte). | -
Memory and Storage: SD Card | -The amount of removable memory space available to store data on the - device. To use a virtual SD card managed by Android Studio, select - Studio, type a size, and select the - units, one of B (byte), KB (kilobyte), MB (megabyte), GB (gigabyte), or - TB (terabyte). A minimum of 100 MB is recommended to use the camera. To - manage the space in a file, select External File and - click ... to specify the file and location. For more - information, see mksdcard. - | -
Device Frame: Enable Device Frame | -Select to enable a frame around the emulator window that mimics the - look of a real device. | -
Custom Skin Definition (Advanced) | -Select a skin that controls what the device looks like when displayed in - the emulator. Remember that specifying a screen size that's too small for - the resolution can mean that the screen is cut off, so you can't see the - whole screen. See - Creating Emulator Skins - for more information. | -
Keyboard: Enable Keyboard Input (Advanced) | -Select this option if you want to use your hardware keyboard to interact - with the emulator. It's disabled for Android Wear and Android TV. | -
An Android emulator skin is a collection of files that define the visual -and control elements of -an emulator display. If the skin definitions available in the AVD settings -don't meet your requirements, -you can create your own custom skin definition, and then apply it to your AVD. -
- -Each emulator skin contains:
-hardware.ini
fileTo create and use a custom skin:
-layout
. This file defines many characteristics of the skin,
- such as the
- size and image assets for specific buttons. For example:
--parts { - device { - display { - width 320 - height 480 - x 0 - y 0 - } - } - - portrait { - background { - image background_port.png - } - - buttons { - power { - image button_vertical.png - x 1229 - y 616 - } - } - } - ... -} -
hardware.ini
- file for the device settings, such as hw.keyboard
and
- hw.lcd.density
.For more detailed information about creating emulator skins, see the -Android Emulator Skin File Specification in the tools source code.
- - - diff --git a/docs/html/tools/extras/index.jd b/docs/html/tools/extras/index.jd deleted file mode 100644 index 8da26dcdab12..000000000000 --- a/docs/html/tools/extras/index.jd +++ /dev/null @@ -1,5 +0,0 @@ -page.title=Extras -page.noplus=1 -@jd:body - -SDK extras add functionality to your development environment. You can download all of the SDK extras into your development environment using the SDK Manager.
diff --git a/docs/html/tools/extras/oem-usb.jd b/docs/html/tools/extras/oem-usb.jd deleted file mode 100644 index cf15048135da..000000000000 --- a/docs/html/tools/extras/oem-usb.jd +++ /dev/null @@ -1,405 +0,0 @@ -page.title=OEM USB Drivers -@jd:body - -If you are developing on Windows and would like to connect an Android-powered device -to test your applications, then you need to install the appropriate USB driver. This document -provides links to the web sites for several original equipment manufacturers (OEMs), -where you can download the appropriate USB driver for your device. However, this list is -not exhaustive for all available Android-powered devices.
- -If you're developing on Mac OS X or Linux, then you probably don't need to install a USB driver. -To start developing with your device, read Using Hardware Devices.
- -The Google USB Driver is required for Windows only in order to perform -adb debugging with any of -the Google Nexus devices. The one exception is the -Galaxy Nexus: the driver for Galaxy Nexus is distributed by Samsung -(listed as model GT-I9250TSGGEN).
- - - -First, find the appropriate driver for your device from the OEM drivers -table below.
- -Once you've downloaded your USB driver, follow the instructions below to install or upgrade the -driver, based on your version of Windows and whether you're installing for the first time -or upgrading an existing driver.
- -Tip: When you finish the USB driver installation, -see Using Hardware Devices for -other important information about using an Android-powered device for -development.
- -Caution:
-You may make changes to android_winusb.inf
file found inside
-usb_driver\
(for example, to add support for other devices),
-however, this will lead to security warnings when you install or upgrade the
-driver. Making any other changes to the driver files may break the installation
-process.
To install the Android USB driver on Windows 7 for the first time:
-Or, to upgrade an existing Android USB driver on Windows 7 with the new -driver:
- -To install the Android USB driver on Windows Vista for the first time:
- -Or, to upgrade an existing Android USB driver on Windows Vista with the new -driver:
- -
- A monkeyrunner class that represents a device or emulator accessible by the workstation running
-monkeyrunner
.
-
- This class is used to control an Android device or emulator. The methods send UI events, - retrieve information, install and remove applications, and run applications. -
-
- You normally do not have to create an instance of MonkeyDevice
. Instead, you
- use
-
-MonkeyRunner.waitForConnection()
to create a new object from a connection to a device or
-emulator. For example, instead of
-using:
-newdevice = MonkeyDevice() --
- you would use: -
--newdevice = MonkeyRunner.waitForConnection() --
Constants | -|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
string | -DOWN | -
- Use this with the type argument of
- press() or touch()
-
- to send a DOWN event.
- |
- |||||||||
string | -UP | -
- Use this with the type argument of
- press() or touch()
-
- to send an UP event.
- |
- |||||||||
string | -DOWN_AND_UP | -
- Use this with the type argument of
- press() or touch()
-
- to send a DOWN event immediately followed by an UP event.
- |
-
Methods | -|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
- |
-
-
- Broadcasts an Intent to this device, as if the Intent were coming from an
- application.
-
- |
- ||||||||||
- |
-
-
- Simulates a drag gesture (touch, hold, and move) on this device's screen.
-
- |
- ||||||||||
- |
-
-
- Given the name of a system environment variable, returns its value for this device.
- The available variable names are listed in the
- detailed description of this method.
-
- |
- ||||||||||
- |
-
-
-. The API equivalent of
- adb shell getprop <key>. This is provided for use
- by platform developers.
- |
- ||||||||||
- |
-
-
- Installs the Android application or test package contained in packageFile onto this
- device. If the application or test package is already installed, it is replaced.
-
- |
- ||||||||||
- |
-
-
- Runs the specified component under Android instrumentation, and returns the results
- in a dictionary whose exact format is dictated by the component being run. The
- component must already be present on this device.
-
- |
- ||||||||||
- |
-
-
- Sends the key event specified by type to the key specified by
- keycode.
-
- |
- ||||||||||
- |
-
-
- Reboots this device into the bootloader specified by bootloadType.
-
- |
- ||||||||||
- |
-
-
- Deletes the specified package from this device, including its data and cache.
-
- |
- ||||||||||
- |
-
-
- Executes an
- adb shell command and returns the result, if any.
- |
- ||||||||||
- |
-
-
- Starts an Activity on this device by sending an Intent constructed from the
- supplied arguments.
-
- |
- ||||||||||
-
-
- MonkeyImage
-
-
- |
-
-
- Captures the entire screen buffer of this device, yielding a
-
-
-
- MonkeyImage
-
- object containing a screen capture of the current display.
- |
- ||||||||||
- |
-
-
- Sends a touch event specified by type to the screen location specified
- by x and y.
-
- |
- ||||||||||
- |
-
-
- Sends the characters contained in message to this device, as if they
- had been typed on the device's keyboard. This is equivalent to calling
-
- press() for each keycode in message
- using the key event type DOWN_AND_UP .
- |
- ||||||||||
- |
-
-
- Wakes the screen of this device.
-
- |
-
- Broadcasts an Intent to this device, as if the Intent were coming from an - application. See {@link android.content.Intent Intent} for more information about the - arguments. -
-uri | -- The URI for the Intent. - (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}). - | -
---|---|
action | -- The action for this Intent - (see {@link android.content.Intent#setAction(java.lang.String) Intent.setAction()}). - | -
data | -- The data URI for this Intent - (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}). - | -
mimetype | -- The MIME type for the Intent - (see {@link android.content.Intent#setType(java.lang.String) Intent.setType()}). - | -
categories | -- An iterable data structure containing strings that define categories for this - Intent - (see - {@link android.content.Intent#addCategory(java.lang.String) Intent.addCategory()}). - | -
extras | -
- A dictionary of extra data for this Intent
- (see {@link android.content.Intent#putExtra(java.lang.String,java.lang.String)
- Intent.putExtra()}
- for an example).
- - The key for each dictionary item should be a string. The item's value - can be any simple or structured data type. - - |
-
component | -- The component for this Intent (see {@link android.content.ComponentName}). - Using this argument will direct the Intent to a specific class within a specific - Android package. - | -
flags | -- An iterable data structure containing flags that control how the Intent is handled - (see {@link android.content.Intent#setFlags(int) Intent.setFlags()}). - | -
- Simulates a drag gesture (touch, hold, and move) on this device's screen. -
-start | -- The starting point of the drag gesture, in the form of a tuple - (x,y) where x and y are integers. - | -
---|---|
end | -- The end point of the drag gesture, in the form of a tuple (x,y) - where x and y are integers. - | -
duration | -The duration of the drag gesture in seconds. The default is 1.0 seconds. | -
steps | -The number of steps to take when interpolating points. The default is 10. | -
- Given the name of a system environment variable, returns its value for this device. -
-key | -- The name of the system environment variable. The available variable names are listed in - Table 1. Property variable names at the end of this topic. - | -
---|
- Synonym for getProperty()
.
-
key | -- The name of the system environment variable. The available variable names are listed in - Table 1. Property Variable Names. - | -
---|
- Installs the Android application or test package contained in packageFile - onto this device. If the application or test package is already installed, it is - replaced. -
-path | -
- The fully-qualified path and filename of the .apk file to install.
- |
-
---|
- Runs the specified component with Android instrumentation, and returns the results - in a dictionary whose exact format is dictated by the component being run. The - component must already be present on this device. -
-- Use this method to start a test case that uses one of Android's test case classes. - See Testing - Fundamentals to learn more about unit testing with the Android testing - framework. -
-className | -
- The name of an Android component that is already installed on this device, in the
- standard form packagename/classname, where packagename is the
- Android package name of a .apk file on this device, and
- classname is the class name of an Android component (Activity,
- ContentProvider, Service, or BroadcastReceiver) in that file. Both
- packagename and classname must be fully qualified. See
- {@link android.content.ComponentName} for more details.
- |
-
---|---|
args | -- A dictionary containing flags and their values. These are passed to the component as it - is started. If the flag does not take a value, set its dictionary value to an empty - string. - | -
- A dictionary containing the component's output. The contents of the dictionary - are defined by the component itself. -
-
- If you use {@link android.test.InstrumentationTestRunner} as the class name in
- the componentName argument, then the result dictionary contains
- the single key "stream". The value of "stream" is a string containing
- the test output, as if InstrumentationTestRunner
was run from the
- command line. The format of this output is described in
-
- Testing in Other IDEs.
-
- Sends the key event specified by type
to the key specified by
- keycode
.
-
name | -- The name of the keycode to send. See {@link android.view.KeyEvent} for a list of - keycode names. Use the keycode name, not its integer value. - | -
---|---|
type | -
- The type of key event to send. The allowed values are
- DOWN , UP , and
- DOWN_AND_UP .
- |
-
- Reboots this device into the bootloader specified by bootloadType
.
-
into | -- The type of bootloader to reboot into. The allowed values are - "bootloader", "recovery", or "None". - | -
---|
- Deletes the specified package from this device, including its data and cache. -
-package | -
- The Android package name of an .apk file on this device.
- |
-
---|
- Executes an adb
shell command and returns the result, if any.
-
cmd | -
- The command to execute in the adb shell. The form of these commands is
- described in the topic Android
- Debug Bridge.
- |
-
---|
- Starts an Activity on this device by sending an Intent constructed from the - supplied arguments. -
-uri | -- The URI for the Intent. - (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}). - | -
---|---|
action | -- The action for the Intent - (see {@link android.content.Intent#setAction(java.lang.String) Intent.setAction()}). - | -
data | -- The data URI for the Intent - (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}). - | -
mimetype | -- The MIME type for the Intent - (see {@link android.content.Intent#setType(java.lang.String) Intent.setType()}). - | -
categories | -- An iterable data structure containing strings that define categories for the - Intent - (see - {@link android.content.Intent#addCategory(java.lang.String) Intent.addCategory()}). - | -
extras | -
- A dictionary of extra data for the Intent
- (see
- {@link android.content.Intent#putExtra(java.lang.String,java.lang.String)
- Intent.putExtra()}
- for an example).
- - The key for each dictionary item should be a string. The item's value - can be any simple or structured data type. - - |
-
component | -- The component for the Intent - (see {@link android.content.ComponentName}). Using this argument will direct the - Intent to a specific class within a specific Android package. - | -
flags | -- An iterable data structure containing flags that control how the Intent is handled - (see {@link android.content.Intent#setFlags(int) Intent.setFlags()}). - | -
-
- MonkeyImage
-
-
-
- takeSnapshot
-
- ()
-
- - Captures the entire screen buffer of this device, yielding a - screen capture of the current display. -
-- Sends a touch event specified by type to the screen location specified - by x and y. -
-x | -- The horizontal position of the touch in actual device pixels, starting from the left of - the screen in its current orientation. - | -
---|---|
y | -- The vertical position of the touch in actual device pixels, starting from the top of - the screen in its current orientation. - | -
type | -
- The type of key event to send. The allowed values are
- DOWN , UP , and
- DOWN_AND_UP .
- |
-
- Sends the characters contained in message to this device, as if they
- had been typed on the device's keyboard. This is equivalent to calling
- press()
for each keycode in message
- using the key event type DOWN_AND_UP
.
-
message | -- A string containing the characters to send. - | -
---|
- Wakes the screen of this device. -
-- Property Group - | -- Property - | -- Description - | -- Notes - | -
---|---|---|---|
build |
- board |
- Code name for the device's system board | -- See {@link android.os.Build} - | -
brand |
- The carrier or provider for which the OS is customized. | -||
device |
- The device design name. | -||
fingerprint |
- A unique identifier for the currently-running build. | -||
host |
- - | ||
ID |
- A changelist number or label. | -||
model |
- The end-user-visible name for the device. | -||
product |
- The overall product name. | -||
tags |
- Comma-separated tags that describe the build, such as "unsigned" and "debug". | -||
type |
- The build type, such as "user" or "eng". | -||
user |
- - | ||
CPU_ABI |
- - The name of the native code instruction set, in the form CPU type plus - ABI convention. - | -||
manufacturer |
- The product/hardware manufacturer. | -||
version.incremental |
- - The internal code used by the source control system to represent this version - of the software. - | -||
version.release |
- The user-visible name of this version of the software. | -||
version.sdk |
- The user-visible SDK version associated with this version of the OS. | -||
version.codename |
- - The current development codename, or "REL" if this version of the software has been - released. - | -||
display |
- width |
- The device's display width in pixels. | -- See - {@link android.util.DisplayMetrics} for details. - | -
height |
- The device's display height in pixels. | -||
density |
-
- The logical density of the display. This is a factor that scales
- DIP (Density-Independent Pixel) units to the device's resolution. DIP is adjusted so
- that 1 DIP is equivalent to one pixel on a 160 pixel-per-inch display. For example,
- on a 160-dpi screen, density = 1.0, while on a 120-dpi screen, density = .75.
- - The value does not exactly follow the real screen size, but is adjusted to - conform to large changes in the display DPI. See - {@link android.util.DisplayMetrics#density} for more details. - - |
- ||
am.current |
- package |
- The Android package name of the currently running package. | -
- The am.current keys return information about the currently-running
- Activity.
- |
-
action |
-
- The current activity's action. This has the same format as the name
- attribute of the action element in a package manifest.
- |
- ||
comp.class |
-
- The class name of the component that started the current Activity. See
- comp.package for more details. |
- ||
comp.package |
- - The package name of the component that started the current Activity. A component - is specified by a package name and the name of class that the package contains. - | -||
data |
- The data (if any) contained in the Intent that started the current Activity. | -||
categories |
- The categories specified by the Intent that started the current Activity. | -||
clock |
- realtime |
- - The number of milliseconds since the device rebooted, including deep-sleep - time. - | -- See {@link android.os.SystemClock} for more information. - | -
uptime |
- - The number of milliseconds since the device rebooted, not including - deep-sleep time - | -||
millis |
- current time since the UNIX epoch, in milliseconds. | -
- A monkeyrunner class to hold an image of the device or emulator's screen. The image is
- copied from the screen buffer during a screenshot. This object's methods allow you to
- convert the image into various storage formats, write the image to a file, copy parts of
- the image, and compare this object to other MonkeyImage
objects.
-
- You do not need to create new instances of MonkeyImage
. Instead, use
-
-MonkeyDevice.takeSnapshot()
to create a new instance from a screenshot. For example, use:
-
-newimage = MonkeyDevice.takeSnapshot() --
Methods | -|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
- |
-
-
- Converts the current image to a particular format and returns it as a
- string that you can then access as an iterable of binary bytes.
-
- |
- ||||||||||
- |
-
-
- Returns the single pixel at the image location (x,y), as an
- a tuple of integer, in the form (a,r,g,b).
-
- |
- ||||||||||
- |
-
-
- Returns the single pixel at the image location (x,y), as
- a 32-bit integer.
-
- |
- ||||||||||
-
- MonkeyImage
-
- |
-
-
- Creates a new
- MonkeyImage object from a rectangular selection of the
- current image.
- |
- ||||||||||
- |
-
- MonkeyImage
- other,
- float percent)
-
- Compares this
- MonkeyImage object to another and returns the result of
- the comparison. The percent argument specifies the percentage
- difference that is allowed for the two images to be "equal".
- |
- ||||||||||
- |
-
-
- Writes the current image to the file specified by
- filename , in the
- format specified by format .
- |
-
- Converts the current image to a particular format and returns it as a string - that you can then access as an iterable of binary bytes. -
-format | -- The desired output format. All of the common raster output formats are supported. - The default value is "png" (Portable Network Graphics). - | -
---|
- Returns the single pixel at the image location (x,y), as an - a tuple of integer, in the form (a,r,g,b). -
-x | -- The horizontal position of the pixel, starting with 0 at the left of the screen in the - orientation it had when the screenshot was taken. - | -
---|---|
y | -- The vertical position of the pixel, starting with 0 at the top of the screen in the - orientation it had when the screenshot was taken. - | -
- Returns the single pixel at the image location (x,y), as an - an integer. Use this method to economize on memory. -
-x | -- The horizontal position of the pixel, starting with 0 at the left of the screen in the - orientation it had when the screenshot was taken. - | -
---|---|
y | -- The vertical position of the pixel, starting with 0 at the top of the screen in the - orientation it had when the screenshot was taken. - | -
- MonkeyImage
-
-
- getSubImage
-
- (tuple rect)
-
-
- Creates a new MonkeyImage
object from a rectangular selection of the
- current image.
-
rect | -
- A tuple (x, y, w, h) specifying the selection. x and y specify the 0-based pixel
- position of the upper left-hand corner of the selection. w specifies the width of the
- region, and h specifies its height, both in units of pixels.
- - The image's orientation is the same as the screen orientation at the time the - screenshot was made. - - |
-
---|
MonkeyImage
object containing the selection.
-
- MonkeyImage
-
otherImage,
- float percent
- )
-
-
- Compares this MonkeyImage
object to another and returns the result of
- the comparison. The percent
argument specifies the percentage
- difference that is allowed for the two images to be "equal".
-
other | -
- Another MonkeyImage object to compare to this one.
- |
-
---|---|
- percent - | -
- A float in the range 0.0 to 1.0, inclusive, indicating
- the percentage of pixels that need to be the same for the method to return
- true . The default is 1.0, indicating that all the pixels
- must match.
- |
-
true
if the images match, or boolean false
otherwise.
-
- Writes the current image to the file specified by filename
, in the
- format specified by format
.
-
path | -- The fully-qualified filename and extension of the output file. - | -
---|---|
- format - | -- The output format to use for the file. If no format is provided, then the - method tries to guess the format from the filename's extension. If no - extension is provided and no format is specified, then the default format of - "png" (Portable Network Graphics) is used. - | -
- A monkeyrunner class that contains static utility methods. -
-Methods | -|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
- |
-
-
- Displays an alert dialog to the process running the current
- program.
-
- |
- ||||||||||
- |
-
-
- Displays a dialog with a list of choices to the process running the current program.
-
- |
- ||||||||||
- |
-
-
- Displays the monkeyrunner API reference in a style similar to that of Python's
-
- pydoc tool, using the specified format.
- |
- ||||||||||
- |
-
-
- Displays a dialog that accepts input.
-
- |
- ||||||||||
- |
-
-
- Pauses the current program for the specified number of seconds.
-
- |
- ||||||||||
-
- MonkeyDevice
-
- |
-
-
- Tries to make a connection between the
- monkeyrunner backend and the
- specified device or emulator.
- |
-
- Displays an alert dialog to the process running the current - program. The dialog is modal, so the program pauses until the user clicks the dialog's - button. -
-message | -- The message to display in the dialog. - | -
---|---|
title | -- The dialog's title. The default value is "Alert". - | -
okTitle | -- The text displayed in the dialog button. The default value is "OK". - | -
- Displays a dialog with a list of choices to the process running the current program. The - dialog is modal, so the program pauses until the user clicks one of the dialog's - buttons. -
-message | -- The prompt message displayed in the dialog. - | -
---|---|
choices | -- A Python iterable containing one or more objects that are displayed as strings. The - recommended form is an array of strings. - | -
- title - | -- The dialog's title. The default is "Input". - | -
- Displays the monkeyrunner API reference in a style similar to that of Python's
- pydoc
tool, using the specified format.
-
format | -- The markup format to use in the output. The possible values are "text" for plain text - or "html" for HTML. - | -
---|
- Displays a dialog that accepts input and returns it to the program. The dialog is - modal, so the program pauses until the user clicks one of the dialog's buttons. -
-- The dialog contains two buttons, one of which displays the okTitle value - and the other the cancelTitle value. If the user clicks the okTitle button, - the current value of the input box is returned. If the user clicks the cancelTitle - button, an empty string is returned. -
-message | -- The prompt message displayed in the dialog. - | -
---|---|
initialValue | -- The initial value to display in the dialog. The default is an empty string. - | -
title | -- The dialog's title. The default is "Input". - | -
okTitle | -- The text displayed in the okTitle button. The default is "OK". - | -
cancelTitle | -- The text displayed in the cancelTitle button. The default is "Cancel". - | -
- Pauses the current program for the specified number of seconds. -
-seconds | -- The number of seconds to pause. - | -
---|
- MonkeyDevice
-
-
- waitForConnection
-
- (float timeout,
- string deviceId)
-
-
- Tries to make a connection between the monkeyrunner
backend and the
- specified device or emulator.
-
timeout | -- The number of seconds to wait for a connection. The default is to wait forever. - | -
---|---|
- deviceId - | -- A regular expression that specifies the serial number of the device or emulator. See - the topic - Android Debug Bridge - for a description of device and emulator serial numbers. - | -
MonkeyDevice
- instance for the device or emulator. Use this object to control and communicate with the
- device or emulator.
- Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an -emulator instance or connected Android-powered device. It is a client-server program that includes -three components:
- -You can find the {@code adb} tool in {@code <sdk>/platform-tools/}.
- -When you start an adb client, the client first checks whether there is an adb server -process already running. If there isn't, it starts the server process. When the server starts, -it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb -clients use port 5037 to communicate with the adb server.
- -The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example:
- -
-Emulator 1, console: 5554
-Emulator 1, adb: 5555
-Emulator 2, console: 5556
-Emulator 2, adb: 5557
-and so on...
-
As shown, the emulator instance connected to adb on port 5555 is the same as the instance -whose console listens on port 5554.
- -Once the server has set up connections to all emulator instances, you can use adb commands to -access those instances. Because the server manages connections to emulator/device -instances and handles commands from multiple adb clients, you can control any emulator/device -instance from any client (or from a script).
- - -In order to use adb with a device connected over USB, you must enable -USB debugging in the device system settings, under -Developer options.
- -On Android 4.2 and higher, the Developer options screen is -hidden by default. To make it visible, go to -Settings > About phone and tap Build number seven times. Return to the previous -screen to find Developer options at the bottom.
- -On some devices, the Developer options screen may be located or named differently.
- -Note: When you connect a device running Android 4.2.2 or higher -to your computer, the system shows a dialog asking whether to accept an RSA key that allows -debugging through this computer. This security mechanism protects user devices because it ensures -that USB debugging and other adb commands cannot be executed unless you're able to unlock the -device and acknowledge the dialog. This requires that you have adb version 1.0.31 (available with -SDK Platform-tools r16.0.1 and higher) in order to debug on a device running Android 4.2.2 or -higher.
- -For more information about connecting to a device over USB, read -Using Hardware Devices.
- - - - -You can issue adb commands from a command line on your development machine or from a script. -The usage is:
- --adb [-d|-e|-s <serialNumber>] <command> -- -
If there's only one emulator running or only one device connected, the adb command is
-sent to that device by default. If multiple emulators are running and/or multiple devices are
-attached, you need to use the -d
, -e
, or -s
-option to specify the target device to which the command should be directed.
The table below lists all of the supported adb commands and explains their meaning and usage.
- - -Category | -Command | -Description | -Comments | -
---|---|---|---|
Target Device | --d |
-Direct an adb command to the only attached USB device. | -Returns an error if more than one USB device is attached. | -
-e |
-Direct an adb command to the only running emulator instance. | -Returns an error if more than one emulator instance is running. | -|
-s <serialNumber> |
-Direct an adb command a specific emulator/device instance, referred to by its adb-assigned serial number (such as "emulator-5556"). | -See Directing -Commands to a Specific Emulator/Device Instance. | -|
General | -devices |
-Prints a list of all attached emulator/device instances. | -See Querying for Emulator/Device Instances for more information. | -
help |
-Prints a list of supported adb commands. | -- | |
version |
-Prints the adb version number. | -- | |
Debug | -logcat [option] [filter-specs] |
-Prints log data to the screen. | -- |
bugreport |
-Prints dumpsys , dumpstate , and logcat data to the screen, for the purposes of bug reporting. |
-- | |
jdwp |
-Prints a list of available JDWP processes on a given device. | -You can use the forward jdwp:<pid> port-forwarding specification to connect to a specific JDWP process. For example: - adb forward tcp:8000 jdwp:472 - jdb -attach localhost:8000
- |
-|
Data | -install <path-to-apk> |
-Pushes an Android application (specified as a full path to an .apk file) to an emulator/device. | -- |
pull <remote> <local> |
-Copies a specified file from an emulator/device instance to your development computer. | -- | |
push <local> <remote> |
-Copies a specified file from your development computer to an emulator/device instance. | -- | |
Ports and Networking | -forward <local> <remote> |
-Forwards socket connections from a specified local port to a specified remote port on the emulator/device instance. | -Port specifications can use these schemes:
-
|
-
ppp <tty> [parm]... |
-Run PPP over USB.
-
Note that you should not automatically start a PPP connection. |
-- | |
Scripting | -get-serialno |
-Prints the adb instance serial number string. | -See Querying for Emulator/Device Instances for more information. | -
get-state |
-Prints the adb state of an emulator/device instance. | - -||
wait-for-device |
-Blocks execution until the device is online — that is, until the instance state is device . |
-You can prepend this command to other adb commands, in which case adb will wait until the emulator/device instance is connected before issuing the other commands. Here's an example:
-adb wait-for-device shell getprop- -Note that this command does not cause adb to wait until the entire system is fully booted. For that reason, you should not prepend it to other commands that require a fully booted system. As an example, the install requires the Android package manager, which is available only after the system is fully booted. A command such as
-
-adb wait-for-device install <app>.apk- -would issue the install command as soon as the emulator or device instance connected to the adb server, but before the Android system was fully booted, so it would result in an error. |
-|
Server | -start-server |
-Checks whether the adb server process is running and starts it, if not. | -- |
kill-server |
-Terminates the adb server process. | -- | |
Shell | -shell |
-Starts a remote shell in the target emulator/device instance. | -See ADB Shell Commands for more information. | -
shell [shellCommand] |
-Issues a shell command in the target emulator/device instance and then exits the remote shell. | -
Before issuing adb commands, it is helpful to know what emulator/device instances are connected to the adb server. You can generate a list of attached emulators/devices using the devices
command:
adb devices- -
In response, adb prints this status information for each instance:
- -<type>-<consolePort>
.
- Here's an example serial number: emulator-5554
offline
— the instance is not connected to adb or is not responding.device
— the instance is now connected to the adb server. Note that this state does not
- imply that the Android system is fully booted and operational, since the instance connects to adb
- while the system is still booting. However, after boot-up, this is the normal operational state of
- an emulator/device instance.no device
— there is no emulator/device connected.
- The output for each instance is formatted like this:
- -[serialNumber] [state]- -
Here's an example showing the devices
command and its output:
adb devices -List of devices attached -emulator-5554 device -emulator-5556 device -emulator-5558 device- - - - - - -
If multiple emulator/device instances are running, you must specify a target instance
-when issuing adb commands. To do so, use the -s
option in the commands. The usage
-for the -s
option is:
adb -s <serialNumber> <command>- -
As shown, you specify the target instance for a command using its adb-assigned serial number.
-You can use the devices
command to obtain the serial numbers of running
-emulator/device instances. For example:
adb -s emulator-5556 install helloWorld.apk- -
Note that, if you issue a command without specifying a target emulator/device instance -while multiple devices are available, adb generates an error. - -
If you have multiple devices available (hardware or emulated), but only one is an emulator, -simply use the {@code -e} option to send commands to the emulator. Likewise if there's multiple -devices but only one hardware device attached, use the {@code -d} option to send commands to -the hardware device. - - - - -
You can use adb to copy an application from your development computer and install it on an emulator/device instance. To do so, use the install
command. With the command, you must specify the path to the .apk file that you want to install:
adb install <path_to_apk>- -
For more information about how to create an .apk file that you can install on an emulator/device -instance, see Building and Running
- -Note that, if you are using Android Studio, you do not need to use adb (or aapt) directly to install your application on the emulator/device. Instead, Android Studio handles the packaging and installation of the application for you.
- - - - - - -You can use the forward
command to set up arbitrary port forwarding — forwarding of requests on a specific host port to a different port on an emulator/device instance. Here's how you would set up forwarding of host port 6100 to emulator/device port 7100:
adb forward tcp:6100 tcp:7100-
You can also use adb to set up forwarding to named abstract UNIX domain sockets, as illustrated here:
-adb forward tcp:6100 local:logd- - - - - -
You can use the adb commands pull
and push
to copy files to
-and from an emulator/device instance. Unlike the install
command,
-which only copies an APK file to a specific location, the pull
and push
-commands let you copy arbitrary directories and files to any location in an
-emulator/device instance.
To copy a file or directory (and its sub-directories) from the emulator or device, use
-adb pull <remote> <local>- -
To copy a file or directory (and its sub-directories) to the emulator or device, use
-adb push <local> <remote>- -
In the commands, <local>
and <remote>
refer to the
-paths to the target files/directory on your development machine (local) and on the
-emulator/device instance (remote). For example:
adb push foo.txt /sdcard/foo.txt- - - - -
In some cases, you might need to terminate the adb server process and then restart it -to resolve the problem (e.g., if adb does not respond to a command).
- -To stop the adb server, use the kill-server
command.
-You can then restart the server by issuing any other adb command.
-adb is usually used over USB. However, it is also possible to use over -Wi-Fi, as described here. -
- -Connect your Android device and adb host computer -to a common Wi-Fi network accessible to both. -We have found that not all access points -are suitable; you may need to use an access point -whose firewall is configured properly to support adb.
- -Note: If you are attempting to connect -to a Wear device, force it to connect to Wi-Fi by shutting off Bluetooth -on the phone connected to it.
--$ adb tcpip 5555 --
-$ adb connect <device-ip-address> --
-$ adb devices -List of devices attached -<device-ip-address>:5555 device -- -
-You're now good to go! -
- --If the adb connection is ever lost: -
- --adb kill-server --and then start over from the beginning. -
- Important: Support for the Android Developer Tools (ADT) in Eclipse has ended, - per our announcement. You should migrate your app development projects to - Android Studio as soon as possible. For more information on transitioning to Android Studio, see - Migrating from Eclipse ADT. -
- -Formerly the official IDE solution for Android development, Android Developer Tools (ADT) - is a plugin for Eclipse that provides GUI-based access to many of the command-line SDK tools, - along with a UI design tool for rapid prototyping, designing, and building of your app's - user interface.
- -As with ADT, support for the Ant - tool for building from the command line has ended. - Gradle is now the supported method - of building Android apps. -
diff --git a/docs/html/tools/help/am-allocation.jd b/docs/html/tools/help/am-allocation.jd deleted file mode 100644 index 20570c3be2e1..000000000000 --- a/docs/html/tools/help/am-allocation.jd +++ /dev/null @@ -1,220 +0,0 @@ -page.title=Allocation Tracker -parent.title=Android Monitor -parent.link=android-monitor.html -meta.tags="android, performance, profiling, tools, monitor" -page.tags="android", "performance", "profiling", "tools", "monitor" -page.metaDescription=Use the Memory Monitor to capture allocation data about your app. The Allocation Tracker displays each method responsible for an allocation, as well as the allocation size and number of instances. -page.image=tools/help/thumbnails/am_alloctracker.png -page.article=true - -@jd:body - -Android Studio allows you to track memory allocation as it monitors memory use. Tracking memory - allocation allows you to monitor where objects are being allocated when you perform certain - actions. Knowing these allocations enables you to adjust the method calls related to those actions - to optimize app performance and memory use.
- -The Allocation Tracker does the following:
-However, it takes time and experience to learn to interpret the output from this tool.
- -- The Allocation Tracker looks similar to the following figure: -
- -- - -
The tool displays the following information:
- -Column | -Description | -
---|---|
Method | -The Java method responsible for the allocation. | -
Count | -Total number of instances allocated. | -
Size | -The total amount of allocated memory in bytes. | -
To examine allocation data:
-The Memory Monitor displays the period when it took the snapshot. In the following - figure, you can see the snapshot period, as shown on the left. By comparison, when you dump the - Java heap, the Memory Monitor displays just the point where the heap snapshot was taken, as - shown on the right.
- - -Android Studio creates the heap snapshot file with the
- filename package_yyyy.mm.dd_hh.mm.ss.alloc
using the activity package (or
- project) name, year, month, day,
- hour, minute, and second of the capture, for example,
- com.android.calc_2015.11.17_14.58.48.alloc
.
After you capture allocation data, Android Studio automatically stores it so -you can view it again.
-To view an allocation tracking file in the Allocation Tracker:
- - -Or select View > Tools Windows > -Captures.
-The Captures window appears.
-To sort allocation data:
-For some items displayed in the Allocation Tracker, you can view the Java source.
-To display Java source:
-The source code appears in the Code Editor.
- - -You can rename, locate, and delete an allocation tracking file from within -Android Studio.
- -If you rename a file from within Android Studio, it continues to appear in the Captures - window.
-To rename an allocation tracking file:
-You can quickly discover where Android Studio stored allocation tracking files on disk.
- - -To locate an allocation tracking file from Android Studio:
-Android Studio opens an operating system file browser displaying the location where the file - resides.
-Note: If you move an allocation tracking file, Android Studio - no longer displays it in the Captures window. To display the file, use - File - > Open. Also, rename the file from the Captures - window and not in the operating system file browser.
- -To delete an allocation tracking file:
-Android Studio deletes the file from the Captures dialog and from disk.
-
- Android Monitor has a main window that contains the logcat, Memory, CPU, GPU, and Network
- Monitors. From this window, you can select a device and app process to work with, terminate an
- app, collect dumpsys
system information, and create screenshots and videos of the
- running app.
-
- Before you start using Android Monitor, you need to set up your environment, as well as the - hardware device or emulator. All of the monitors require the following: -
-- All but the logcat Monitor have these additional requirements: -
-debuggable
property to true
in the manifest or
- build.gradle
file (it’s initially set by default).
- - The GPU Monitor has this requirement as well: -
-- The Network Monitor and the Video Capture tool work with a hardware device - only, not the emulator. -
- - - -- Android Monitor is integrated into the Android Studio main window: -
- -- Note: If you don't see the sidebar buttons, you can - display them by selecting View > - Tool Buttons. -
-- Android Monitor looks like the following figure: -
- - -- After you've met the prerequisites and optionally connected a hardware device, you're ready - to profile an app in Android Monitor: -
- -- By default, Android Monitor displays data for your most recently run app. You can switch to - another device and app as needed. In addition to currently running apps, you can view - information about apps that are no longer running so you can continue to see any information - about them that you gathered previously. -
- -- At the top of the Android Monitor main window are two menus listing devices and processes. To - switch to another device, process, or both: -
- -- The Device menu lists the devices and emulators that are running or have run during your - current session. There are various status messages that can appear in the Device menu: -
- -- The Process menu lists the processes that are running or have run during your current session. If - a process is no longer running, the menu displays a status of DEAD. -
-- You can rearrange the Android Monitor windows for optimal viewing during your - tests: -
-- To rearrange the logcat and Monitors tabs: -
-- To stop an app you’ve run from Android Studio: -
- -- The process status changes to DEAD in the Processes menu. The emulator or device - continues to run, but the app closes. Any running monitors in Android Monitor stop. -
-- To remove an app from a device you use for development, use the normal uninstall procedure on the - device. -
- -- If you run a new version of an app from Android Studio that’s been already installed on a - hardware device, the device displays an Application Installation Failed dialog. Click - OK to install the new version of the app. -
- -- From the Android Monitor main window, you can also do the following: -
- -dumpsys
system information.
- - The CPU Monitor lets you easily monitor the central processing unit (CPU) usage of your app. It - displays CPU usage in real time and displays the percentage of total CPU time (including all cores) - used in user and kernel mode. In user mode, the code must use system APIs to access hardware or - memory, has access to virtual memory addresses only, and crashes are usually - recoverable. In kernel mode, the code can directly access - hardware, including physical memory addresses; crashes halt the device. -
- - -- To display an app running on a particular device or emulator in the CPU Monitor: -
- -- The CPU Monitor starts to display any CPU usage. - In the graph, the y-axis displays the percentage of CPU used. The x-axis records the time elapsed - and starts with seconds, and then minutes and seconds, and so on. -
- -- You can capture a record of the changes on the call stack during a particular - time period while the CPU Monitor is running. For more information, see - Method Trace. -
- - - - diff --git a/docs/html/tools/help/am-gpu.jd b/docs/html/tools/help/am-gpu.jd deleted file mode 100644 index fb140ad8b9b2..000000000000 --- a/docs/html/tools/help/am-gpu.jd +++ /dev/null @@ -1,89 +0,0 @@ -page.title=GPU Monitor -parent.title=Android Monitor -parent.link=android-monitor.html -meta.tags="android, performance, profiling, tools, monitor" -page.tags="android", "performance", "profiling", "tools", "monitor" -page.metaDescription=Use the GPU Monitor for a visual representation of how much time it takes to render the frames of a UI window. Use this information to optimize the code that displays graphics and conserve memory. -page.image=tools/help/thumbnails/am-gpumon.png -page.article=true - -@jd:body - -- The GPU Monitor gives you a quick visual representation of how much time it takes to render the - frames of a UI window. It profiles the amount of time it takes for the render thread to prepare, - process, and execute the draw commands. The GPU Monitor can help you to: -
- -- For example, if displaying a static photo continues to take Graphics Processor Unit - (GPU) resources long after it has finished - drawing on the screen, that’s a likely candidate for optimization. -
- - -- To display an app running on a particular device or emulator in the GPU Monitor: -
- -- Any GPU usage begins to appear in the GPU Monitor: -
- - -- The y-axis is the amount of time it takes the GPU to execute, process, prepare, and draw frames, - in milliseconds. The x-axis records the time elapsed; it starts with seconds, and then minutes - and seconds, and so on. -
- -- When you're monitoring memory usage in the Memory Monitor you can, at the same time, dump a - snapshot of the Java heap to an Android-specific Heap/CPU Profiling (HPROF) file. The HPROF Viewer - displays classes, instances of each class, and a reference tree to help you track memory usage - and find memory leaks. HPROF is a binary heap dump format originally supported by J2SE. -
-The Java heap display does the following:
- -- However, you have to look for changes over time yourself by tracking what's happening in the - graph. -
- -- The HPROF Analyzer finds the following potential issues: -
- -- A dominator is at the top of a tree. If you remove it, you also remove the branches of the tree - it dominates, so it’s a potential way to free memory. -
- -- The HPROF Viewer looks similar to the following figure: -
- -- The tool displays the following information: -
- -Column | -Description | -
---|---|
Class Name | -The Java class responsible for the memory. | -
Total Count | -Total number of instances outstanding. | -
Heap Count | -Number of instances in the selected heap. | -
Sizeof | -Size of the instances (currently, 0 if the size is variable). | -
Shallow Size | -Total size of all instances in this heap. | -
Retained Size | -Size of memory that all instances of this class is dominating. | -
Instance | -A specific instance of the class. | -
Reference Tree | -References that point to the selected instance, as well as references pointing to the - references. | -
Depth | -The shortest number of hops from any GC root to the selected instance. | -
Shallow Size | -Size of this instance. | -
Dominating Size | -Size of memory that this instance is dominating. | -
If you click Capture Analysis, the HPROF Analyzer appears:
- -You can detect leaked activities and find duplicate strings with the HPROF Analyzer.
- -- To examine a snapshot of the Java heap: -
- -
- When the icon on the Memory Monitor display changes from
- to
- , the file is ready. Android Studio creates the heap snapshot
- file with the
- filename package_yyyy.mm.dd_hh.mm.ss.hprof
using
- the activity package (or project) name, year, month, day, hour, minute, and second of the
- capture, for example,
- com.android.calc_2015.11.17_14.58.48.hprof
.
-
- The HPROF Viewer appears. -
-After you do a heap dump, Android Studio automatically stores it so you can view it again. -
-To view an HPROF file in the HPROF Viewer:
- -Or select View > Tools Windows > -Captures.
-The Captures window appears.
-- The HPROF Viewer appears. -
- - -The following steps outline the typical workflow:
-You can detect leaked activities and find duplicate strings with the HPROF Analyzer. -
-To use the HPROF Analyzer:
-.hprof
file to display it in the
- HPROF Viewer. The HPROF Analyzer appears to the right of the HPROF Analyzer, by default.
- - - -To sort heap dump data:
-For some items displayed in the HPROF Viewer, you can go straight to its -source code. -
-To display Java source:
-The source code appears in the Code Editor.
-You can rename, locate, and delete an HPROF file from within Android Studio. -You can also convert it to standard HPROF format to use with other analysis -tools.
- -If you rename a file from within Android Studio, it continues to appear in -the Captures window.
-To rename an HPROF file:
-You can quickly discover where Android Studio stored HPROF files on disk.
- - -To locate an HPROF file on disk:
-Android Studio opens an operating system file browser displaying the location where the file - resides.
-Note: If you move an HPROF file, Android Studio no longer - displays it in the Captures window. To display it, use - File > Open. Also, if you want to rename the file, do it - from the Captures window and not in the operating system file browser.
- -To delete a heap dump file:
-Android Studio deletes the file from the Captures dialog and from disk.
-You can convert an HPROF file to standard format so you can use it outside of Android Studio with - other analysis tools.
-To convert an HPROF file:
-Android Studio creates a binary HPROF file in the location you specified.
-- The Android logging system provides a mechanism for collecting and viewing system debug output. - The logcat Monitor displays system messages, such as when a garbage collection occurs, as well as - messages that you added to your app by using the Log class. - It displays messages in real time and also keeps a history so you can view older - messages. -
- -- To display just the information of interest, you can create filters, modify how much information - is displayed in messages, set priority levels, display messages produced by app code - only, and search the log. By default, the logcat Monitor shows the log output related to the - most recently run app only. -
- -- When an app throws an exception, the logcat Monitor shows a message followed by the associated - stack trace containing links to - the code. This feature can help you fix errors and improve app operation. -
- -- Every Android log message has a tag and a priority associated with it. The tag of a system - log message - is a short string indicating the system component from which the message originates (for example, - {@link android.app.ActivityManager}). A user-defined tag can be any string that you find helpful, - such as the name of the current class (the recommended tag). You define it in a - {@link android.util.Log} method call, for example: -
- --Log.d(tag, message); --
- The priority is one of the following values: -
- -- The log message format is: -
- --date time PID-TID/package priority/tag: message -- -
- For example, the following log message has a priority of V
and a tag of
- AuthZen
:
-
-12-10 13:02:50.071 1901-4229/com.google.android.gms V/AuthZen: Handling delegate intent. --
- PID stands for process identifier and TID is thread identifier; they can be the same if there’s - only one thread. -
- -- To display the log messages for a particular app: -
- -- By default, the logcat Monitor displays just the log messages for your app running on the - device or emulator: -
- -- To change this default, see Filtering logcat Messages. -
-- You can control how many messages appear in the logcat Monitor by setting the log level. You can - display all messages, or just the messages indicating the most severe conditions. -
- -- Remember that the logcat Monitor continues to collect all messages regardless of the log level setting. - The setting just determines what the logcat Monitor displays. -
- -- To set the log level: -
- -- To search the messages currently displayed in the logcat Monitor: -
- -- The logcat Monitor display changes accordingly. -
- - -- One way to reduce the log output to a manageable level is to restrict it by using a filter. -
- -- Note: The filter applies to your full logcat history, not just those messages - currently displayed in the logcat Monitor. Make sure your other display options are set - appropriately so you can see the filter output you want to examine. -
- -- To define and apply a filter: -
- -- After you define filters, you can also select them in the menu. To remove them from the - menu, delete them. -
- -- To remove a filter, select it in the left pane and click -. -
- -- If you don't think you see the log messages you want, try selecting - No filters and searching for particular - log messages. -
-- To customize the header display to show just the information you’re interested - in: -
- -- For more information about message elements, see logcat Message Format. -
- -- When the app throws an exception, the message includes a stack trace of method calls. - logcat - Monitor lets you quickly locate stack traces in the log and view the associated code - in the Code Editor. If needed (and possible), the decompiler derives source code that - you can view. -
-- To move up and down the stack trace, and view the associated code in the Code Editor: -
-- Clicking a particular message stops the display of messages. -
-- To quickly move to - the end of the log to see the real-time message flow: -
- -- To preserve log information, you can send the log to a printer, write the log to a PDF file, or - copy and paste the log into a text file. -
-- To print the log or write it to a PDF file: -
-- You can set the parameters to send the log to a printer or write it to a PDF file. -
-- To copy the log to a text file: -
-Press Ctrl+A (⌘A) to select all.
-- To clear (flush) the entire log: -
-- If there's a problem and the log is no longer progressing, you can restart the log: -
- -- Android Studio provides a Memory Monitor so you can more easily monitor app performance and - memory usage to find deallocated objects, locate memory leaks, and track the amount of memory the - connected device is using. The Memory Monitor reports how your app allocates memory and helps you - to visualize the memory your app uses. It lets you: -
- -- To profile and optimize memory use, the typical workflow is to run your app and do the following: -
- -- The Java heap data shows in real-time what types of objects your application has allocated, how - many, and their sizes on the heap. Viewing the heap helps you to: -
- -- Allocation tracking records app memory allocations and lists all allocations for the - profiling cycle, including the call stack, size, and allocating code. It helps you to: -
- -- When you dump the Java heap, the Memory Monitor creates an Android-specific Heap/CPU Profiling - (HPROF) file that you can view in the HPROF Viewer. The HPROF Viewer indicates a garbage - collection root with the icon (and a depth of zero) - and a - dominator with the icon. -
- -- There are several kinds of garbage collection roots in Java: -
- -- The HPROF file provides the list of roots to the HPROF Viewer. -
- -- A dominator tree traces paths to objects created by the app. An object dominates another object - if the only way to reach the other object is, directly or indirectly, through the dominator - object. When you examine objects and paths created by an app in an effort to optimize memory use, - try to remove objects that are no longer needed. You can release a dominator object to - release all subordinate objects. For example, in the following figure, if you were to - remove object B, that would also release the memory used by the objects it dominates, which are - objects C, D, E, and F. In fact, if objects C, D, E, and F were marked for removal, but object B - was still referring to them, that could be the reason that they weren’t released. -
- - - -- An app performs better if it uses memory efficiently and releases the memory when it’s no longer - needed. - Memory leaks that are large or that grow over time are the most important to correct. -
- -- One way to optimize memory usage is to analyze large arrays. For example, can you reduce the size - of individual elements in the array to save memory? -
- -- Another area that deserves attention is objects that the app no longer needs but continues to - reference. You can gather heap dumps over different periods of time and compare them to determine - if you have a growing memory leak, such as an object type that your code creates multiple times - but doesn’t destroy. These objects could be part of a growing array or an object tree, for - example. To track down this problem, compare the heap dumps and see if you have a particular - object type that continues to have more and more instances over time. -
- -- Continually growing object trees that contain root or dominator objects can prevent subordinate - objects from being garbage-collected. This issue is a common cause of memory leaks, out-of-memory - errors, - and crashes. Your app could have a small number of objects that are preventing a large number of - subordinate objects from being destroyed, so it runs out of memory quickly. To find these issues, - get a heap dump and examine the amount of memory held by root and dominator objects. If the - memory is substantial, you’ve likely found a good place to start optimizing your memory use. -
- -- As you start narrowing down memory issues, you should also use the Allocation Tracker to get a - better understanding of where your memory-hogging objects are allocated. The Allocation Tracker - can be valuable not only for looking at specific uses of memory, but also for analyzing critical - code paths, such as loading and scrolling. For example, tracking allocations when flinging a list - in your app - allows you to see all of the allocations that need to be done for that behavior, what thread they - are on, and where they came from. This information is extremely valuable for tightening up these - paths to reduce the work they need and improve the overall smoothness of the UI. -
- -- It’s useful to examine your algorithms for allocations that are unnecessary or that create the - same object many times instead of reusing them. For example, do you create temporary objects and - variables within recursive loops? If so, try creating an object or variable before - the loop for use within the loop. Otherwise, your app might needlessly allocate many objects and - variables, depending on the number of recursions. -
- -- It’s important to perform allocation tests on portions of your code that create the most and - largest objects, as those areas offer the most optimization opportunities. In addition to unit - tests, you should test your app with production-realistic data loads, especially those algorithms - that are data-driven. Also, make sure to account for the app caching and startup phase, which can - sometimes be slow; allocation analysis is best done after that phase to produce accurate results. -
- -- After you optimize code, be sure to test that it worked. You need to test under different load - conditions and also without running the Memory Monitor tools. Compare results before and after - optimization to make sure that performance has actually improved. -
- -- Android Monitor uses the Virtual Machine (VM) that the device or emulator uses: -
- -- The VM handles garbage collection. The Dalvik VM uses a mark-and-sweep scheme for garbage - collection. The ART VM uses a generational scheme, combined with mark-and-sweep when memory needs - a more thorough garbage collection, such as when memory becomes excessively fragmented. The - logcat Monitor displays some messages that indicate the type of garbage collection that occurred - and why. -
- -- Memory Monitor results can vary between the different VMs. As a result, if you’re supporting both - VMs, you might want to test with both. In addition, the VMs available for different API levels - can have different behavior. For example, the Dalvik VM in Android 2.3 (API level 10) and lower - uses externally allocated memory while higher versions allocate in the Dalvik heap only. -
- -- You can’t reconfigure the Dalvik and ART VMs to tune performance. Instead, you should examine - your app code to determine how to improve its operation, for example, reducing the size of very - large arrays. -
- -- There are programmatic ways to manipulate when the VM performs garbage collection, although it’s - not a best practice. These techniques can be specific to the VM. For more information, see - Addressing - Garbage Collection (GC) Issues and Investigating Your RAM - Usage. -
- -- The ART VM adds a number of performance, development, and debugging improvements over the Dalvik - VM. For more information, see ART and Dalvik. -
- -- To display an app running on a particular device or emulator in the Memory Monitor: -
- -- In the graph, the y-axis displays the free and allocated RAM in megabytes. The x-axis shows the - time elapsed; it starts with seconds, and then minutes and seconds, and so on. The amount of free - memory, measured in megabytes, - is shown in a light color, and allocated memory is a darker color. When there’s a sharp drop in - allocated memory, that indicates a garbage collection event.
- - - -- To force a garbage collection event, click Initiate GC . -
- -In the following figure, the VM initiated the first garbage collection event, while the - developer forced the second. -
- - -- The graph can show you potential issues: -
- -- For example, you might see the following signs of problems: -
- -- Normally, VMs perform garbage collection only when absolutely needed, since it’s expensive. - However, it can be useful to force garbage collection in certain circumstances. For example, when - locating memory leaks, if you want to determine whether a large object was successfully released - already, you can initiate garbage collection much more aggressively than usual. -
- -- To force a garbage collection event: -
- -- You can take snapshots while the Memory Monitor is running or paused: -
- -- You can start a method trace from the CPU Monitor. It lets you view the call stack and timing - information for your app. This information can help you optimize and debug your app. -
- -- The method trace looks similar to the following figure: -
- - - -The display shows the following information:
- -Field | -Description | -
---|---|
Name | -The name of the method. | -
Invocation Count | -How many times the method was called. | -
Inclusive Time (microseconds) | -Time spent in the method and all of its children, either wall clock or thread time, - depending on your selection in the x-axis menu. | -
Exclusive Time (microseconds) | -Time spent just in the method (excluding time spent in its children), either wall clock - or thread time, depending on your selection in the x-axis menu. | -
Note: Running the method trace significantly affects CPU timings. - Use the method trace to understand the flow of the program, but not for performance timings.
- -- To perform a method trace: -
- -- The method trace appears in the Code Editor area. -
- -
- Android Studio creates the method trace file
- with the filename package_yyyy.mm.dd_hh.mm.ss.trace
- using the activity package (or project) name, year, month, day, hour, minute, and second of
- the capture, for example,
- com.android.calc_2015.11.17_14.58.48.trace
.
-
- The graphic represents the wall clock or thread time for each method. Hover the cursor - over the display to receive information about the method. This information also appears - in the table. -
-- After you do a method trace, Android Studio automatically stores it so you can view it - again.
- -To examine a saved method trace: -
- -Or select View > Tools Windows > - Captures.
- -- The Captures window appears. -
- -- You can sort the data by method name, count, inclusive time, and exclusive - time.
- -To sort method trace data:
- - -You can rename, locate, and delete a method trace file from within Android -Studio.
- -- Rename a method trace file from within Android Studio so it - continues to appear in the Captures window.
- -To rename a method trace file: -
- -- You can quickly discover where Android Studio stored method trace files on - disk.
- -To locate a method trace file on disk: -
- - - -- Android Studio opens an operating system file browser displaying the location where the file - resides. -
-- Note: If you move a method trace file, Android Studio no longer displays the file - in the Captures window. To display it, use File > - Open. Also, rename a file from the Captures - window and not in the operating system file browser. -
- -- To delete a method trace file: -
- -- Android Studio deletes the file from the Captures dialog and from disk. -
\ No newline at end of file diff --git a/docs/html/tools/help/am-network.jd b/docs/html/tools/help/am-network.jd deleted file mode 100644 index 812999207f7b..000000000000 --- a/docs/html/tools/help/am-network.jd +++ /dev/null @@ -1,87 +0,0 @@ -page.title=Network Monitor -parent.title=Android Monitor -parent.link=android-monitor.html -meta.tags="android, performance, profiling, tools, monitor" -page.tags="android", "performance", "profiling", "tools", "monitor" -page.metaDescription=Use the Network Monitor to analyze network requests, including how and when your app transfers data. Preserve battery life by optimizing network use. -page.image=tools/help/thumbnails/am-networkmon.png -page.article=true - -@jd:body - -- The Network Monitor makes it possible to track when your application is making network requests. - Using this tool, you can monitor how and when your app transfers data, and optimize the underlying - code appropriately. -
- -- By monitoring the frequency of data transfers, and the amount of data transferred during each - connection, you can identify areas of your app that can be made more efficient and use less - battery power. - Generally, you should look for short spikes that can be delayed, or that could cause a later - transfer to be preempted. -
- - -- To display an app running on a particular device in the Network Monitor: -
- -Connect a hardware device; the Network Monitor doesn't monitor an emulator. -
-- Any network traffic begins to appear in the Network Monitor: -
- -- The Network Monitor adds up the amount of time it takes for the device to transmit and receive - kilobytes of data. - The y-axis is in kilobytes per second. The x-axis starts with seconds, and then minutes and - seconds, and so on. -
-- You can take a PNG screenshot of the display on a connected device or the emulator. You can use - the images for your marketing materials as well as for debugging, for example. -
- - -- To take a screen capture: -
-The screenshot appears in a Screenshot Editor window.
- - - -The screenshot file appears in the Code Editor area.
-dumpsys
information about your app. View activity manager, package, memory usage, and graphics state information.
-page.image=tools/help/thumbnails/am_sysinfo.png
-page.article=true
-@jd:body
-
- You can capture dumpsys
output from within Android Monitor and
- display the file in the Code Editor. The Captures window lists the
- system information files so you can retrieve the information later for
- analysis.
-
- To capture and view a snapshot of system information: -
- -
- The menu items display different types of dumpsys
- output:
-
dumpsys activity
- dumpsys package
- dumpsys
- meminfo
- dumpsys
- procstats
- dumpsys gfxinfo
- - The information appears in an editable text file in the Code Editor. -
- -Android Studio creates the system information file with the
- filename package_yyyy.mm.dd_hh.mm.ss.txt
using the
- activity package (or project) name, year, month, day,
- hour, minute, and second of the capture, for example,
- com.android.calc_2015.11.17_14.58.48.txt
.
-After you take a snapshot of system information, Android Studio automatically -stores it so you can view it again.
- -To examine a saved system information file:
- -Or select View > Tools Windows > - Captures.
- -- The Captures window appears. -
- -You can rename, locate, and delete a system information file from within -Android Studio.
- -- Rename a system information file from within Android Studio so it - continues to appear in the Captures window.
- -To rename a system information file: -
- -- You can quickly discover where Android Studio stored system information files - on disk.
- -To locate a system information file on disk: -
- - - -- Android Studio opens an operating system file browser displaying the location - where the file resides. -
-- Note: If you move a system information file, Android Studio - no longer displays the file - in the Captures window. To display it, use File > - Open. Also, rename a file from the Captures - window and not in the operating system file browser. -
- -- To delete a system information file: -
- -- Android Studio deletes the file from the Captures dialog and from - disk. -
diff --git a/docs/html/tools/help/am-video.jd b/docs/html/tools/help/am-video.jd deleted file mode 100644 index 5ecdd11ad40a..000000000000 --- a/docs/html/tools/help/am-video.jd +++ /dev/null @@ -1,78 +0,0 @@ -page.title=Video Capture -parent.title=Android Monitor -parent.link=android-monitor.html -meta.tags="android, performance, profiling, tools, monitor" -page.tags="android", "performance", "profiling", "tools", "monitor" -page.metaDescription=Use the Video tool to make a video of the display on a hardware device. -page.image=tools/help/thumbnails/am_video.png -page.article=true -@jd:body - - -- Android Studio lets you record an MP4 video from your hardware device for a maximum of three - minutes. You can use the video for your marketing materials as well as for debugging, for - example. -
- - - - -- To record a video from a hardware device: -
-The screenshot appears in a Screenshot Editor window.
- -- Android Monitor helps you to profile the performance of your apps so you can optimize, debug, and - improve them. It lets you monitor the following aspects of your apps from a hardware device or - the Android Emulator: -
- -Android Monitor provides various tools that provide real-time information about your app. It - lets you capture data as your app runs and stores it in a file that you can analyze in various - viewers. You can also capture screen shots and videos of your app as it runs.
- -View log messages — in real time and historically — which is useful for debugging.
- -Visualize the behavior and performance of your app.
- -Android Monitor lets you capture various types of data about your app while it's running and - stores it in a file, which you can access whenever is convenient. - It lists these files in the Captures window.
- -Create screen captures and videos of your app to help with marketing and debugging. -
- -To begin using Android Monitor, start with Android Monitor Basics. -
- - diff --git a/docs/html/tools/help/android.jd b/docs/html/tools/help/android.jd deleted file mode 100755 index fa359e99e559..000000000000 --- a/docs/html/tools/help/android.jd +++ /dev/null @@ -1,418 +0,0 @@ -page.title=android -parent.title=Tools -parent.link=index.html -@jd:body - -{@code android} is an important development tool that lets you:
- -If you are using Android Studio, the android
tool's features are
-integrated into the IDE, so you should not need to use this tool directly.
Note: The documentation of options below is not exhaustive
-and may be out of date. For the most current list of options, execute android
---help
.
android [global options] action [action options]- -
-s
-h
-v
Action | - -Option | - -Description | - -Comments | -
---|---|---|---|
avd |
-
- None | - -Launch the AVD Manager | - -- |
sdk |
-
- None | - -Launch the Android SDK Manager | - -- |
create avd |
-
- -n <name> |
-
- The name for the AVD. | - -Required | -
-t <targetID> |
-
- Target ID of the system image to use with the new AVD. To obtain a list of available
- targets, use android list targets |
-
- Required | -|
-c <path>|<size>[K|M] |
-
- The path to the SD card image to use with this AVD or the size of a new SD card image to
- create for this AVD. For example, -c path/to/sdcard or -c
- 1000M . |
-
- - | |
-f |
-
- Force creation of the AVD | - -- | |
-p <path> |
-
- Path to the location at which to create the directory for this AVD's files. | - -- | |
-s <name>|<width>-<height> |
-
- The skin to use for this AVD, identified by name or dimensions. The android
- tool scans for a matching skin by name or dimension in the skins/ directory of
- the target referenced in the -t <targetID> argument. For example, -s
- HVGA-L |
-
- - | |
delete avd |
-
- -n <name> |
-
- The name of the AVD to delete | - -Required | -
move avd |
-
- -n <name> |
-
- The name of the AVD to move | - -Required | -
-p <path> |
-
- Path to the location at which to create the directory for this AVD's files. | - -- | |
-r <new-name> |
-
- New name of the AVD if you want to rename it | - -- | |
update avd |
-
- -n <name> |
-
- The name of the AVD to move | - -Required | -
Action | - -Option | - -Description | - -Comments | -
---|---|---|---|
create project |
-
- -n <name> |
-
- The name for the project | - -Required | -
-t <targetID> |
-
- Target ID of the system image to use with the new AVD. To obtain a list of available
- targets, use android list targets |
-
- Required | -|
-k <path>|<size>[K|M] |
-
- Package namespace | - -Required | -|
-a |
-
- Name for the default Activity class | - -Required | -|
-p <path> |
-
- Location of your project directory | - -Required | -|
update project |
-
- -n <name> |
-
- The name of the project to update | - -- |
-p <path> |
-
- Location path of the project | - -Required | -|
-l <library path> |
-
- Location path of an Android Library to add, relative to the main project | - -- | |
-s <subprojects> |
-
- Update any projects in subfolders such as test projects | - -- | |
-t <targetID> |
-
- Target id to set for the project | - -- | |
create test-project |
-
- -n <name> |
-
- The name of the project | - -- |
-p <path> |
-
- Location path of the project | - -Required | -|
-m <main> |
-
- The name of the project | - -Required | -|
update test-project |
-
- -p <path> |
-
- Location path of the project to test, relative to the new project | - -Required | -
-m <main> |
-
- The main class of the project to test | - -Required | -|
create lib-project |
-
- -k <packageName> |
-
- (Required) Package name of the library project | - -Required | -
-p <path> |
-
- Location path of the project | - -Required | -|
-t <targetID> |
-
- Target ID of the library project | - -Required | -|
-n <name> |
-
- The name of the project | - -Required | -|
update lib-project |
-
- -p <path> |
-
- Location path of the project | - -Required | -
-l <libraryPath> |
-
- Location path of an Android Library to add, relative to the main project | - -- | |
-t <name> |
-
- Target ID of the library project | - -- | |
create uitest-project |
- -n <name> |
- The name of the UI test project | -- |
-t <name> |
-
- Target ID of the UI test project | - -Required | -|
-p <path> |
-
- Location path of the UI test project | - -Required | -
update adb
update sdk
Android Studio helps you add support for URLs, app indexing, and search -functionality to your apps. - These features can help to drive more traffic to your - app, discover which app content is used most, make it easier for users to find content in an - installed app, and attract new users.
- -To use Android Studio to add support for URL, app indexing, and search -features to your app:
- -Intent filters and the App Indexing API are ways to implement URL support -and app indexing, but - there are other possible implementations as well. See - Alternate Android Indexing Methods - for more information.
- -Android Studio can create a basic intent filter in your manifest that you can customize to - define URLs for your app. You can then write Java code in an activity to handle the - intent. This implementation lets users directly open the specified app activity by - clicking a URL. Users can see the URLs in google.com in a browser, in the - Google Search app, and in Google Now on Tap.
- -After setting up URL support for your app, you can associate your website -with your app by using - the Google Search Console and Google Play Developer Console. Afterward, Google indexes your app - for URLs defined in - your intent filters and begins to include them in search results. In addition, you can optionally - exclude app content from Google Search. After you associate a website with your app, features - such as Now on Tap and enhanced search result display (like including your app icon) - become available.
- -As an alternative to associating your app with a website, - for Android 6.0 (API level 23) and higher, you can add - default handlers and verification for URLs - instead.
- -Chrome displaying google.com serves search results with URLs that are accessible to both - signed-in users and those who aren't. Google Search app users must be signed in to see URLs - in their search results.
- -Next, if you want to support additional search features, such as autocompletions, you can - add App Indexing API code to your app. Android Studio can create skeleton code in an activity - that you can then customize to support app indexing. The App Indexing API allows app indexing - even if - Googlebot - can’t get content from your app.
- -Android Studio helps you test your code with the following features:
- -The details for implementing URL support and app indexing are described next. - - -
To use Android Studio features to add an intent filter defining a URL:
- -AndroidManifest.xml
file to open it
- in the Code Editor.<activity>
element, click in the left column so the light bulb
- appears. Click
-
- and select Create URL.<activity>
element and select Generate
- > URL.The Code Editor adds skeleton code using the - intention action and - generate code mechanisms.
- -The Code Editor adds an intent filter similar to the following:
--<!-- ATTENTION: This intent was auto-generated. Follow instructions at - https://g.co/AppIndexing/AndroidStudio to publish your URLs. --> -<intent-filter> - <action android:name="android.intent.action.VIEW" /> - - <category android:name="android.intent.category.DEFAULT" /> - <category android:name="android.intent.category.BROWSABLE" /> - <!-- ATTENTION: This data URL was auto-generated. - We recommend that you use the HTTP scheme. - TODO: Change the host or pathPrefix as necessary. --> - <data - android:host="www.example.com" - android:pathPrefix="/gizmos" - android:scheme="http" /> -</intent-filter> -- -
<data>
element
- and optionally the <category>
element, as needed.We recommend that you define a <data>
element that supports URLs that you’ll
- add in the future. In the previous sample code, for example, Google will index any URLs starting
- with http://www.example.com/gizmos
. Also, remember to
- include a URL for your app home screen so it’s included in search results.
The URLs you specify in your intent filters can be the same as the URLs of -the comparable pages on your website.
- -To support Google Search for your URLs:
-Alternatively, for Android 6.0 (API level 23) and higher, add - link default handling and verification.
-To test and debug your links, you can use the following Android Studio features:
-In addition, you can - preview your APK in the Google Search Console - to test your URLs, whether the app is associated with a website or not.
- - - -After adding URL support to your app, you can add App Indexing API code to -an activity to support additional search features.
- -To add App Indexing API code to an activity:
-The Code Editor adds skeleton code using the - intention action and - generate code - mechanisms.
- -If you don’t see the App Indexing API Code menu item, make sure your cursor is - within an activity, and check your code for App Indexing API methods. The Code Editor can insert - skeleton Java code into an activity in the following circumstances:
- -onStart()
method, or the onStart()
- method doesn’t contain an AppIndexApi.start()
or AppIndexApi.view()
- call.onStop()
method, or the onStop()
- method doesn’t contain an AppIndexApi.end()
or AppIndexApi.viewEnd()
- call.The Code Editor adds Java code similar to the following:
-- /** - * ATTENTION: This was auto-generated to implement the App Indexing API. - * See https://g.co/AppIndexing/AndroidStudio for more information. - */ - private GoogleApiClient client; - - // ATTENTION: This was auto-generated to implement the App Indexing API. - // See https://g.co/AppIndexing/AndroidStudio for more information. - client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build(); - } - - - @Override - public void onStart() { - super.onStart(); - - // ATTENTION: This was auto-generated to implement the App Indexing API. - // See https://g.co/AppIndexing/AndroidStudio for more information. - client.connect(); - Action viewAction = Action.newAction( - Action.TYPE_VIEW, // TODO: choose an action type. - "Main Page", // TODO: Define a title for the content shown. - // TODO: If you have web page content that matches - // this app activity's content, - // make sure this auto-generated web page URL is correct. - // Otherwise, set the URL to null. - Uri.parse("http://www.example.com/gizmos"), - // TODO: Make sure this auto-generated app URL is correct. - Uri.parse("android-app://com.example/http/www.example.com/gizmos") - ); - AppIndex.AppIndexApi.start(client, viewAction); - } - - @Override - public void onStop() { - super.onStop(); - - // ATTENTION: This was auto-generated to implement the App Indexing API. - // See https://g.co/AppIndexing/AndroidStudio for more information. - Action viewAction = Action.newAction( - Action.TYPE_VIEW, // TODO: choose an action type. - "Main Page", // TODO: Define a title for the content shown. - // TODO: If you have web page content that matches - // this app activity's content, - // make sure this auto-generated web page URL is correct. - // Otherwise, set the URL to null. - Uri.parse("http://www.example.com/gizmos"), - // TODO: Make sure this auto-generated app URL is correct. - Uri.parse("android-app://com.example/http/www.example.com/gizmos") - ); - AppIndex.AppIndexApi.end(client, viewAction); - client.disconnect(); - } -} -- -
For more information about the App Indexing API methods, see - Android API for App Indexing. - For information about the action types, see the - Action Class Constant Summary. -
- -If your app isn’t already configured for the Google Play Services App Indexing API, the Code
- Editor also modifies your build.gradle
and AndroidManifest.xml
files
- to include it. If your app already depends on it but the version is lower than 8.1.0, your app
- is upgraded to version 8.1.0. For more information and to correct any issues, see
- Add Google Play Services
- and Setting Up Google Play Services.
-
Pay attention to the comments, which help you find areas that need work, such as setting the - title and URLs. For more information, see - Add the App Indexing API. -
-To test and debug your App Indexing API code, you can use the following Android Studio - features:
-In addition, you can - preview your APK in the Google Search Console.
- - -When you run your app from Android Studio, you can specify a URL to launch so you can - test it.
- -To launch a URL from Android Studio:
-Or type the URL you want to test, for example, http://example.com/gizmos
.
If the link is successful, the app launches in the device or emulator, and displays the app at - the specified activity. Otherwise, an error message appears in the Run window.
-For more information about creating run configurations at the project, default, and module - levels, see - Building and Running from Android Studio. -
- -You can view App Indexing API log messages while the app is running, as described next.
- - -The logcat Monitor can display app indexing log messages to determine if your App Indexing API - code is pushing the correct data to the cloud. For example, you can check the app title and the - URL. The logcat Monitor is part of Android Monitor in Android Studio.
- -To view App Indexing API messages in the logcat Monitor:
-App indexing log messages should appear. If they don’t, check the following items:
-build.gradle
file? If so, it might be out-of-date and should be upgraded to
- a higher version. For more information, see the - Google Play Services Download - page and Setting Up Google Play Services. -
-You can use the Android Studio built-in Lint tool to check whether you have valid URLs - defined in the manifest and have implemented the App Indexing API correctly in activities.
- -You can view URL and app indexing warnings and errors in two ways:
-To set default Lint checks for URLs and the App Indexing API:
-For example, the following Lint warning appears for the first setting:
- - -To produce a list of Lint checks displayed in the Inspection Results window:
-The scope specifies the files you want to analyze, and the profile specifies the Lint checks - you’d like to perform.
-In the Inspections dialog, you can search for the string "app indexing" -to find the URL and App Indexing API Lint checks. Note that changing Lint settings for a -profile in the Inspections dialog doesn’t change the default settings, as described in -the previous procedure. It does change the settings for profiles displayed in the -Inspections dialog, however.
-The results appear in the Inspection Results window.
- -You can use a Google App Indexing Test to check whether Google can index -a URL by either crawling your app page or using the App Indexing API. -Google can index the URL if your app supports at least one of the following: -
-To perform a Google App Indexing Test:
-Android Studio builds the APK and starts the test. The test can take a few -minutes to complete. The results appear in a new tab in the Code Editor.
- - -If the app preview on the right shows the screen that corresponds to the URL -you're testing, then Googlebot can find the URL.
- -The following table lists common errors and warnings you might encounter.
- -Warning or Error | -Description | -
---|---|
Error: Google cannot index this page. | -Your app can't be crawled by Googlebot or using the App Indexing API, - so Google isn't able to index this app. | -
Warning: The App URL you sent by using the App Indexing API doesn't - match the URL opened. | -When calling the App Indexing API, the URL specified in the app must - match the opened URL. | -
Warning: Google cannot index this page using the App Indexing API - because the title is empty. | -When calling the App Indexing API, the title shouldn't be empty. | -
Warning: Google can index this page using Googlebot crawling but - identified blocked resources. | -The app references other resources, and some of them are blocked or
- temporarily unavailable. If these resources aren't critical, it might not
- matter. Check the preview on the right to see whether the content
- displays correctly. To fix this issue, make sure the resources aren't
- blocked by robots.txt . |
-
Warning: Google cannot index this page using the App Indexing API. | -Your app isn’t using the App Indexing API. We recommended adding App - Indexing API support to your app. | -
The AVD Manager provides a graphical user interface in which you can create -and manage Android Virtual Devices (AVDs), which are required by the -Android Emulator.
- -You can launch the AVD Manager in one of the following ways:
-tools/
directory and execute
- android avd
.For more information, see Managing -AVDs with AVD Manager. diff --git a/docs/html/tools/help/bmgr.jd b/docs/html/tools/help/bmgr.jd deleted file mode 100644 index 8823f338a543..000000000000 --- a/docs/html/tools/help/bmgr.jd +++ /dev/null @@ -1,190 +0,0 @@ -page.title=bmgr -parent.title=Tools -parent.link=index.html -@jd:body - - - -
bmgr
is a shell tool you can use to interact with the Backup Manager
-on Android devices supporting API Level 8 or greater. It provides commands to induce backup
-and restore operations so that you don't need to repeatedly wipe data or take similar
-intrusive steps in order to test your application's backup agent. These commands are
-accessed via the adb shell.
-
-
For information about adding support for backup in your application, read Data Backup, which includes a guide to testing -your application using {@code bmgr}.
- - -Normally, your application must notify the Backup Manager when its data has changed, via {@link
-android.app.backup.BackupManager#dataChanged()}. The Backup Manager will then invoke your
-backup agent's {@link
-android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor,BackupDataOutput,ParcelFileDescriptor)
-onBackup()} implementation at some time in the future. However, instead of calling {@link
-android.app.backup.BackupManager#dataChanged()}, you can invoke a backup request from the command
-line by running the bmgr backup
command:
-
-
adb shell bmgr backup <package>- -
<package>
is the formal package name of the application you wish to
-schedule for
-backup. When you execute this backup command, your application's backup agent will be invoked to
-perform a backup operation at some time in the future (via your {@link
-android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor,BackupDataOutput,ParcelFileDescriptor)
-onBackup()} method), though there is no guarantee when it will occur. However, you can force all
-pending backup operations to run immediately by using the bmgr run
command:
-
-
adb shell bmgr run- -
This causes a backup pass to execute immediately, invoking the backup agents of all applications
-that had previously called {@link android.app.backup.BackupManager#dataChanged()} since the
-last backup operation, plus any applications which had been manually scheduled for
-backup via bmgr backup
.
-
-
-
-
Unlike backup operations, which are batched together and run on an occasional basis, restore -operations execute immediately. The Backup Manager currently provides two kinds of restore -operations. The first kind restores an entire device with the data that has been backed up. This -is typically performed only when a device is first provisioned (to replicate settings and other -saved state from the user's previous device) and is an operation that only the system can -perform. The second kind of restore operation restores -a single application to its "active" data set; that is, the application will abandon its current -data and revert to the last-known-good data that is held in the current backup image. You can -invoke this second restore operation with the {@link -android.app.backup.BackupManager#requestRestore(RestoreObserver) requestRestore()} method. The -Backup Manager will then invoke your backup agent's {@link -android.app.backup.BackupAgent#onRestore(BackupDataInput,int,ParcelFileDescriptor) -onRestore()} implementation. - -
While testing your application, you can immediately invoke the restore operation (bypassing the
-{@link android.app.backup.BackupManager#requestRestore(RestoreObserver) requestRestore()} method)
-for your application by using the bmgr restore
command:
-
-
adb shell bmgr restore <package>- -
<package>
is the formal Java-style package name of the application
-participating in the backup/restore mechanism, which you would like to restore. The Backup
-Manager will immediately instantiate the application's backup agent and invoke it for restore. This
-will happen even if your application is not currently running.
-
-
-
-
-
-
The data for a single application can be erased from the active data set on demand. This is
-very useful while you're developing a backup agent, in case bugs lead you to write corrupt data
-or saved state information. You can wipe an application's data with the bmgr wipe
-command:
-
-
adb shell bmgr wipe <package>- -
<package>
is the formal package name of the application whose data
-you wish to
-erase. The next backup operation that the application's agent processes will look as
-though the application had never backed anything up before.
-
-
-
You can see whether the Backup Manager is operational at all with the bmgr
-enabled
command:
-
-
adb shell bmgr enabled- -
This might be useful if your application's backup agent is never being invoked for backup, to -verify whether the operating system thinks it should be performing such operations at all.
- -You can also directly disable or enable the Backup Manager with this command: - -
adb shell bmgr enable <boolean>- -
<boolean>
is either true
or false
.
-This is equivalent to disabling or enabling backup in the device's main Settings UI.
Warning! When backup is disabled, the current backup transport
-will explicitly wipe
-the entire active data set from its backend storage. This is so that when a user says
-they do not want their data backed up, the Backup Manager respects that wish. No further
-data will be saved from the device, and no restore operations will be possible, unless the Backup
-Manager is re-enabled (either through Settings or through the above bmgr
command).
-
-
-
-
-
diff --git a/docs/html/tools/help/ddms.html b/docs/html/tools/help/ddms.html
deleted file mode 100644
index d885d561dd00..000000000000
--- a/docs/html/tools/help/ddms.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
You should be redirected. Please click here.
- - \ No newline at end of file diff --git a/docs/html/tools/help/desktop-head-unit.jd b/docs/html/tools/help/desktop-head-unit.jd deleted file mode 100644 index 981979c8e8f5..000000000000 --- a/docs/html/tools/help/desktop-head-unit.jd +++ /dev/null @@ -1,439 +0,0 @@ -page.title=Desktop Head Unit -page.tags="auto", "car", "testing","dhu" -@jd:body - - -The Desktop Head Unit (DHU) enables your development machine to emulate an Android Auto -head unit, so you can easily run and test Android Auto apps. The DHU runs on -Windows, Mac, and Linux hosts and replaces previous Android Auto simulators, -such as the Android Media Browser and Messaging -simulators.
- -Note: For other information about testing Auto apps, see the -training lesson -Run and Test Auto Apps.
- - -
- To launch the DHU, run the desktop-head-unit.exe
(on Windows)
- or desktop-head-unit
(on Mac or Linux) command, as described in
- Connecting
- the DHU to your mobile device.
-
- By default, the DHU emulates the most common form of Android Auto-compatible
- head unit, which uses a touch screen user interface. You can simulate user
- touches by clicking the DHU with a mouse. To emulate head units which use
- a rotary controller for input, you can use the -i controller
flag,
- as in this example:
-
$ ./desktop-head-unit -i controller- -
- When the DHU is in rotary-controller mode you can simulate controller - operations by using keyboard shortcuts, as described in DHU commands and key bindings. If the DHU is in rotary - controller mode, it ignores mouse clicks; you must operate Android Auto with - the simulated rotary controller operations. -
- -- DHU commands allow you to test your app with Android Auto features, such as - playing voice input or switching between night and day display mode. You can issue commands to - the DHU by running commands from the terminal window where you launched DHU. - You can also issue commands by selecting the DHU window and - using keyboard shortcuts. The DHU commands - and key bindings for all controls are listed in DHU - commands and key bindings. -
- - -- Android Auto supports different color schemes for day and night. You should test your app in both - day and night mode. You can switch between night and day mode in either of the - following ways: -
- -daynight
in the terminal where you launched the DHU.
- The DHU supports using a microphone for voice input. You can also instruct the DHU to treat -a pre-recorded voice track as input, as if the DHU had heard the track through the microphone.
- -To use a pre-recorded sound file as input, enter this command:
--$ mic play <sound_file_path>/<sound_file>.wav -- -
For your convenience, we have provided the following sound files for common
-voice commands. These sound files are installed in the
-<sdk>/extras/google/auto/voice/
directory.
exitnav.wav
- navgoogle.wav
- navsoh.wav
- nextturn.wav
- showalternateroute.wav
- howlong.wav
- navhome.wav
- navwork.wav
- pause.wav
- showtraffic.wav
- The DHU supports the following commands.
- - -Category | -Command | -Subcommand | -Argument(s) | -Keyboard Shortcut(s) | -Description | -
---|---|---|---|---|---|
System | -help | -- | [command] | -- | Shows the full command set. Specifying a command name (for example, help day )
- causes the system to show help for that command. |
-
quit | -- | - | Alt+q | -Quits the head unit. | -|
sleep | -- | [seconds] | -- | Sleeps for one second. Specifying an argument (for example, sleep 30 ) causes the
-system to sleep the specified number of seconds. This command
-is useful if you are writing scripts for the DHU. (You can run a script by using I/O redirection
-from the command line: ./desktop-head-unit < script.txt loads commands from the
-file script.txt .) |
-|
screenshot | -- | filename.png | -- | Saves a screenshot to filename.png . |
-|
Microphone | -mic | -begin | -- | m | -Activates the microphone (equivalent to clicking the steering wheel's microphone button) and -waits for input from the computer microphone. | -
play | -filename.wav | -- | Causes the DHU to treat filename.wav as voice input, as if it had heard that sound
- through the microphone. You do not hear the sound file being played, but you do hear
- the response from Android Auto. |
-||
repeat | -- | - | Repeats the last mic play command, as if you had called mic play
- again with the same sound file parameter. |
-||
Input | -dpad | -up down left right |
-- | Arrow keys | -Simulates moving the rotary controller. | -
soft left soft right |
-- | Shift+Arrow keys | -Simulates pressing the side buttons available on some rotary controllers. | -||
click | -- | Return | -Simulates pressing the rotary controller. | -||
back | -- | Backspace | -Simulates pressing the back button available below some rotary - controllers. | -||
rotate left rotate right |
-- | 1 2 |
-Simulates rotating the rotary controller left (counter-clockwise) or right (clockwise). | -||
flick left flick right |
-- | Shift+1 Shift+2 |
-Simulates a fast spin of the rotary controller to the left (counter-clockwise) or right - (clockwise). | -||
tap | -- | x y | -- | Simulates a touch event at the specified coordinates. For example, tap 50 100 |
-|
Day/Night | -day | -- | - | Shift+n | -Activates day mode (high brightness, full color). | -
night | -- | - | Ctrl+n | -Activates night mode (low brightness, high contrast). | -|
daynight | -- | - | n | -Toggles current day/night mode. | -
Important: Use of the Android Media Browser and Messaging -Simulators for testing Android Auto apps is deprecated. Instead, we recommend using the -Desktop Head Unit, which enables your development machine to act as if it were an Android Auto head -unit.
- -To get the simulators, open the -SDK Manager and download -them from Extras > Android Auto API Simulators.
- -Before you begin testing, compile your app in your development environment. -Install your app and the Android simulator for the features you want to test -(that is, audio or messaging) on a physical or virtual device running Android -5.0 (API level 21) or higher. To check the version of Android on the device, go -to Settings > About phone (or About tablet) -> Android Version.
- -To run and test audio apps:
- -To run and test messaging apps:
- -dmtracedump
is a tool that gives you an alternate way of generating
- graphical call-stack diagrams from trace log files (instead of using Traceview).
This document is a reference to the available command line options. For more information on generating trace - logs, see Profiling with - Traceview and dmtracedump.
- -The usage for dmtracedump
is:
-dmtracedump [-ho] [-s sortable] [-d trace-base-name] [-g outfile] <trace-base-name> -- -
The tool then loads trace log data from <trace-base-name>.data
and
- <trace-base-name>.key. The table below lists the options for dmtracedump.
Option | - -Description | -
---|---|
-d <trace-base-name> |
-
- Diff with this trace name | -
-g <outfile> |
-
- Generate output to <outfile> | -
-h |
-
- Turn on HTML output | -
-o |
-
- Dump the trace file instead of profiling | -
-d <trace-base-name> |
-
- URL base to the location of the sortable javascript file | -
-t <percent> |
-
- Minimum threshold for including child nodes in the graph (child's inclusive time as a - percentage of parent inclusive time). If this option is not used, the default threshold is - 20%. | -
The Draw 9-patch tool is a WYSIWYG editor that allows you to create bitmap images that -automatically resize to accommodate the contents of the view and the size of the screen. Selected -parts of the image are scaled horizontally or vertically based indicators drawn within the image.
-For an introduction to NinePatch graphics and how they work, please read -the section about NinePatch Drawables in the -Canvas and Drawables -document.
- - - -Here's a quick guide to create a NinePatch graphic using the Draw 9-patch tool. -You'll need the PNG image with which you'd like to create a NinePatch image.
- -draw9patch
command from your SDK
- sdk/tools
directory to launch the Draw 9-patch tool.
- The left pane is your drawing area, in which you can edit the lines for the - stretchable patches and content area. The right - pane is the preview area, where you can preview your graphic when stretched.
-Your image will be saved with the .9.png
file name.
To make sure that your NinePatch graphics scale down properly, verify that any - stretchable regions are at least 2x2 pixels in size. - Otherwise, they may disappear when scaled down. Also, provide one pixel of extra safe space in - the graphics before and after stretchable regions to avoid interpolation during scaling that may - cause the color at the boundaries to change.
- -Note: A normal PNG file (*.png
) will be
- loaded with an empty one-pixel border added around the image, in which you can draw
- the stretchable patches and content area.
- A previously saved NinePatch file (*.9.png
) will be loaded as-is,
- with no drawing area added, because it already exists.
Optional controls include:
-The Android SDK includes a mobile device emulator — a virtual mobile device -that runs on your computer. The emulator lets you develop and test -Android applications without using a physical device.
- -This page describes command line features that you can use with the -Android Emulator. -For information about using the Android Emulator UI, see -Using the Android Emulator. -
- - -During development and testing of your application, you install and run your -application in the Android Emulator. You can launch the emulator as a standalone -application from a command line, or you can run it from within your Android Studio -development environment. In either case, you specify the AVD configuration to -load and any startup options you want to use, as described in this document. -
- -You can run your application on a single instance of the emulator or, -depending on your needs, you can start multiple emulator instances and run your -application in more than one emulated device. You can use the emulator's -built-in commands to simulate GSM phone calling or SMS between emulator -instances, and you can set up network redirection that allows emulators to send -data to one another. For more information, see Telephony -Emulation, SMS Emulation, and -Emulator Networking
- -To start an instance of the emulator from the command line, navigate to the
-tools/
folder of the SDK. Enter emulator
command
-like this:
emulator -avd <avd_name> [<options>]- -
This initializes the emulator, loads an AVD configuration and displays the emulator -window. For more information about command line options for the emulator, see the -Android Emulator tool reference.
- -Note: You can run multiple -instances of the emulator concurrently, each with its own AVD configuration and -storage area for user data, SD card, and so on.
- -When you run your app from Android Studio, it installs and launches the -app on your connected device or emulator (launching the emulator, if necessary). -You can specify emulator startup options in the Run/Debug -dialog, in the Target tab. When the emulator is running, you can issue -console commands as described later in this document.
- -If you are not working in Android Studio, see Installing Applications -on the Emulator for information about how to install your application.
- -To stop an emulator instance, just close the emulator's window.
- -For a reference of the emulator's startup commands and keyboard mapping, see -the Android Emulator tool -reference.
- - -If you don't have access to Android Studio, you can install your application on the
-emulator using the adb utility. Before
-installing the application, you need to build and package it into an .apk
as described
-in Building and
-Running Apps. Once the application is installed, you can start the emulator from the command
-line as described previously, using any startup options necessary.
-When the emulator is running, you can also connect to the emulator instance's
-console to issue commands as needed.
As you update your code, you periodically package and install it on the emulator.
-The emulator preserves the application and its state data across restarts,
-in a user-data disk partition. To ensure that the application runs properly
-as you update it, you may need to delete the emulator's user-data partition.
-To do so, start the emulator with the -wipe-data
option.
-For more information about the user-data partition and other emulator storage,
-see Working with Emulator Disk Images.
The emulator supports a variety of options that you can specify -when launching the emulator, to control its appearance or behavior. -Here's the command-line syntax of the options available to the {@code emulator} program:
- -emulator -avd <avd_name> [-<option> [<value>]] ... [-<qemu args>]- - -
Category | -Option | -Description | -Comments | -
---|---|---|---|
AVD | --avd <avd_name> or - @<avd_name> |
- Required. Specifies the AVD to load for this emulator - instance. | -You must create an AVD configuration before launching the emulator. For - information, see Managing - AVDs with AVD Manager. | -
Disk Images | --cache <filepath> |
- Use <filepath> as the working cache partition image. | -An absolute or relative path to the current working directory.
- If no cache file is specified, the emulator's default behavior is to use a temporary file instead.
- For more information on disk images, use |
-data <filepath> |
- Use {@code <filepath>} as the working user-data disk image. | -Optionally, you can specify a path relative to the current working directory.
- If -data is not used, the emulator looks for a file named {@code userdata-qemu.img}
- in the storage area of the AVD being used (see -avd ).
- | |
-initdata <filepath> |
- When resetting the user-data image (through -wipe-data ), copy the contents
- of this file to the new user-data disk image. By default, the emulator copies the <system>/userdata.img . |
- Optionally, you can specify a path relative to the current working directory. See also -wipe-data .
- For more information on disk images, use |
-|
-nocache |
- Start the emulator without a cache partition. | -See also -cache <file> . |
-|
-ramdisk <filepath> |
- Use <filepath> as the ramdisk image. | -Default value is <system>/ramdisk.img .
- Optionally, you can specify a path relative to the current working directory.
- For more information on disk images, use |
-|
-sdcard <filepath> |
- Use <file> as the SD card image. | -Default value is <system>/sdcard.img .
- Optionally, you can specify a path relative to the current working directory. For more information on disk images, use |
-|
-wipe-data |
- Reset the current user-data disk image (that is, the file specified by -datadir and
- -data , or the default file). The emulator deletes all data from the user data image file,
- then copies the contents of the file at -inidata data to the image file before starting.
- |
- See also -initdata .
- For more information on disk images, use |
-|
Debug | --debug <tags> |
- Enable/disable debug messages for the specified debug tags. | -<tags> is a space/comma/column-separated list of debug component names.
- Use -help-debug-tags to print a list of debug component names that you can use. |
-
-debug-<tag> |
- Enable/disable debug messages for the specified debug tag. | -Use -help-debug-tags to print a list of debug component names that you can use in <tag> . |
-|
-debug-no-<tag> |
- Disable debug messages for the specified debug tag. | -||
-logcat <logtags> |
- Enable logcat output with given tags. | -If the environment variable ANDROID_LOG_TAGS is defined and not - empty, its value will be used to enable logcat output by default. | -|
-shell |
- Create a root shell console on the current terminal. | -You can use this command even if the adb daemon in the emulated system is broken. - Pressing Ctrl-c from the shell stops the emulator instead of the shell. | -|
-shell-serial <device> |
- Enable the root shell (as in -shell and specify the QEMU character
- device to use for communication with the shell. |
- <device> must be a QEMU device type. See the documentation for '-serial dev' at
- http://wiki.qemu.org/download/qemu-doc.html
- for a list of device types.
-
- Here are some examples: -
|
-|
-show-kernel <name> |
- Display kernel messages. | -- | |
-trace <name> |
- Enable code profiling (press F9 to start), written to a specified file. | -- | |
-verbose |
- Enable verbose output. | -Equivalent to -debug-init .
-You can define the default verbose output options used by emulator instances in the Android environment variable
-ANDROID_VERBOSE. Define the options you want to use in a comma-delimited list, specifying only the stem of each option:
- Here's an example showing ANDROID_VERBOSE defined with the
For more information about debug tags, use |
-|
Media | --audio <backend> |
- Use the specified audio backend. | -- |
-audio-in <backend> |
- Use the specified audio-input backend. | -- | |
-audio-out <backend> |
- Use the specified audio-output backend. | -- | |
-noaudio |
- Disable audio support in the current emulator instance. | -- | |
-radio <device> |
- Redirect radio modem interface to a host character device. | -||
-useaudio |
- Enable audio support in the current emulator instance. | -Enabled by default. | -|
Network | --dns-server <servers> |
- Use the specified DNS server(s). | -The value of <servers> must be a comma-separated list of up to 4 DNS server names or
- IP addresses. |
-
-http-proxy <proxy> |
- Make all TCP connections through a specified HTTP/HTTPS proxy | -The value of <proxy> can be one of the following:- http://<server>:<port> - http://<username>:<password>@<server>:<port>
- The |
-|
-netdelay <delay> |
- Set network latency emulation to <delay>. | -Default value is none . See the table in
- Network Delay Emulation
- for supported <delay> values. |
-|
-netfast |
- Shortcut for -netspeed full -netdelay none |
- ||
-netspeed <speed> |
- Set network speed emulation to <speed>. | -Default value is full . See the table in
- Network Speed Emulation for
- supported <speed> values. |
-|
-port <port> |
- Set the console port number for this emulator instance to <port> . |
- The console port number must be an even integer between 5554 and 5584, inclusive. <port> +1
- must also be free and will be reserved for ADB. |
-|
-report-console <socket> |
- Report the assigned console port for this emulator instance to a remote third party - before starting the emulation. | -<socket> must use one of these formats:
-
-
Use |
-|
System | --cpu-delay <delay> |
- Slow down emulated CPU speed by <delay> | -Supported values for <delay> are integers between 0 and 1000.
-
- Note that the <delay> does not correlate to clock speed or other absolute metrics -— it simply represents an abstract, relative delay factor applied non-deterministically -in the emulator. Effective performance does not always -scale in direct relationship with <delay> values. - |
-
-gps <device> |
- Redirect NMEA GPS to character device. | -Use this command to emulate an NMEA-compatible GPS unit connected to
- an external character device or socket. The format of <device> must be QEMU-specific
- serial device specification. See the documentation for 'serial -dev' at
- http://wiki.qemu.org/download/qemu-doc.html.
- |
-|
-nojni |
- Disable JNI checks in the Dalvik runtime. | ||
-qemu |
- Pass arguments to the qemu emulator software. | -Important: When using this option, make sure it is the - last option specified, since all options after it are interpretted as qemu-specific - options. | |
-qemu -enable-kvm |
- Enable KVM acceleration of the emulator virtual machine. | -This option is only effective when your system is set up to use
- KVM-based VM acceleration.
- You can optionally specify a memory size ({@code -m <size>}) for the VM, which should match
- your emulator's memory size:
- {@code -qemu -m 512 -enable-kvm} - {@code -qemu -m 1024 -enable-kvm} - | |
-qemu -h |
- Display qemu help. | -||
-gpu on |
- Turn on graphics acceleration for the emulator. | -This option is only available for emulators using a system image with API Level 15, revision 3 - and higher. For more information, see - Using the Android - Emulator. | |
-radio <device> |
- Redirect radio mode to the specified character device. | -The format of <device> must be QEMU-specific
- serial device specification. See the documentation for 'serial -dev' at
-http://wiki.qemu.org/download/qemu-doc.html.
- |
-|
-timezone <timezone> |
- Set the timezone for the emulated device to <timezone>, instead of the host's timezone. | -<timezone> must be specified in zoneinfo format. For example:
-"America/Los_Angeles" |
-|
-version |
- Display the emulator's version number. | -- | |
UI | --dpi-device <dpi> |
- Scale the resolution of the emulator to match the screen size - of a physical device. | -The default value is 165. See also -scale . |
-
-no-boot-anim |
- Disable the boot animation during emulator startup. | -Disabling the boot animation can speed the startup time for the emulator. | -|
-no-window |
- Disable the emulator's graphical window display. | -- | |
-scale <scale> |
- Scale the emulator window. | -<scale> is a number between 0.1 and 3 that represents the desired scaling factor. You can
- also specify scale as a DPI value if you add the suffix "dpi" to the scale value. A value of "auto"
- tells the emulator to select the best window size. |
-|
-raw-keys |
- Disable Unicode keyboard reverse-mapping. | -||
-noskin |
- Don't use any emulator skin. | -||
-keyset <file> |
- Use the specified keyset file instead of the default. | -The keyset file defines the list of key bindings between the emulator and the host keyboard.
- For more information, use -help-keyset to print information about this topic.
- |
-|
-onion <image> |
- Use overlay image over screen. | -No support for JPEG. Only PNG is supported. | |
-onion-alpha <percent> |
- Specify onion skin translucency value (as percent). - | Default is 50. | -|
-onion-rotation <position> |
- Specify onion skin rotation. - | <position> must be one of the values 0, 1, 2, 3. |
-|
-skin <skinID> |
- This emulator option is deprecated. | -Please set skin options using AVDs, rather than by using this emulator -option. Using this option may yield unexpected and in some cases misleading -results, since the density with which to render the skin may not be defined. -AVDs let you associate each skin with a default density and override the default -as needed. For more information, see Managing Virtual Devices -with AVD Manager. - | -|
-skindir <dir> |
- This emulator option is deprecated. | -See comments for -skin , above. |
-|
Help | --help |
- Print a list of all emulator options. | -- |
-help-all |
- Print help for all startup options. | -- | |
-help-<option> |
- Print help for a specific startup option. | -- | |
-help-debug-tags |
- Print a list of all tags for -debug <tags> . |
- - | |
-help-disk-images |
- Print help for using emulator disk images. | -- | |
-help-environment |
- Print help for emulator environment variables. | -s - | |
-help-keys |
- Print the current mapping of keys. | -- | |
-help-keyset-file |
- Print help for defining a custom key mappings file. | -- | |
-help-virtual-device |
- Print help for Android Virtual Device usage. | -- |
To make the Android emulator run faster and be more responsive, you can configure it to -take advantage of hardware acceleration, using a combination of configuration options, specific -Android system images and hardware drivers.
- - -Caution: As of SDK Tools Revision 17, the graphics -acceleration feature for the emulator is experimental; be alert for incompatibilities and -errors when using this feature.
- -Graphics acceleration for the emulator takes advantage of your development computer's graphics -hardware, specifically its graphics processing unit (GPU), to make screen drawing faster. To use -the graphics acceleration feature, you must have the following versions of the Android development -tools installed:
- -Use the Android SDK -Manager to install these components:
- -Note: Not all applications are compatible with graphics hardware -acceleration. In particular, the Browser application and applications using the {@link -android.webkit.WebView} component are not compatible with graphics acceleration.
- -To configure an AVD to use graphics acceleration:
- -Note: You can also enable graphics acceleration when you -start an emulator using command line options as describe in the next section.
-Caution: Do not select the Snapshot: Enabled -option. Snapshots are not supported for emulators with graphics acceleration enabled.
-If you set GPU emulation to Yes for your AVD, then graphics -acceleration is automatically enabled when you run it. If you did not enable GPU -emulation when you created the AVD, you can still enable it at runtime.
- -To enable graphics acceleration at runtime for an AVD:
- -emulator -avd <avd_name> -gpu on-
Note: You must specify an AVD configuration that uses -Android 4.0.3 (API Level 15, revision 3) or higher system image target. Graphics acceleration is not -available for earlier system images.
-Caution: As of SDK Tools Revision 17, the virtual machine -acceleration feature for the emulator is experimental; be alert for incompatibilities and errors -when using this feature.
- -Many modern CPUs provide extensions for running virtual machines (VMs) more efficiently. Taking -advantage of these extensions with the Android emulator requires some additional configuration of -your development system, but can significantly improve the execution speed. Before attempting to use -this type of acceleration, you should first determine if your development system’s CPU supports one -of the following virtualization extensions technologies:
- -The specifications from the manufacturer of your CPU should indicate if it supports -virtualization extensions. If your CPU does not support one of these virtualization technologies, -then you cannot use virtual machine acceleration.
- -Note: Virtualization extensions are typically enabled through -your computer's BIOS and are frequently turned off by default. Check the documentation for your -system's motherboard to find out how to enable virtualization extensions.
- -Once you have determined that your CPU supports virtualization extensions, make sure you can work -within these additional requirements of running an emulator inside an accelerated virtual -machine:
- -To use virtual machine acceleration with the emulator, you need the following version of Android -development tools. Use the Android SDK -Manager to install these components:
- -If your development environment meets all of the requirements for running a VM-accelerated -emulator, you can use the AVD Manager to create an x86-based AVD configuration:
- -Tip: System images are listed under each API Level in the SDK - Manager. An x86 system image may not be available for all API levels.
-Virtual machine acceleration for Windows requires the installation of the Intel Hardware -Accelerated Execution Manager (Intel HAXM). The software requires an Intel CPU with -Virtualization Technology (VT) support and one of the following operating systems:
- -To install the virtualization driver:
- -sc query intelhaxm-
You should see a status message including the following information:
--SERVICE_NAME: intelhaxm - ... - STATE : 4 RUNNING - ... --
To run an x86-based emulator with VM acceleration:
-emulator -avd <avd_name>-
Note: You must provide an x86-based AVD configuration -name, otherwise VM acceleration will not be enabled.
-You can adjust the amount of memory available to the Intel HAXM kernel extension by re-running -its installer.
- -You can stop using the virtualization driver by uninstalling it. Re-run the installer or use -the Control Panel to remove the software.
- - -Virtual machine acceleration on a Mac requires the installation of the Intel Hardware Accelerated -Execution Manager (Intel HAXM) kernel extension to allow the Android emulator to make use of CPU -virtualization extensions. The kernel extension is compatible with Mac OS X Snow Leopard (version -10.6.0) and higher.
- -To install the Intel HAXM kernel extension:
- -kextstat | grep intel-
You should see a status message containing the following extension name, indicating that the - kernel extension is loaded:
-com.intel.kext.intelhaxm-
To run an x86-based emulator with VM acceleration:
-emulator -avd <avd_name>-
Note: You must provide an x86-based AVD configuration -name, otherwise VM acceleration will not be enabled.
-You can adjust the amount of memory available to the Intel HAXM kernel extension by re-running -the installer.
- -You can stop using the virtualization kernel driver by uninstalling it. Before removing it, shut -down any running x86 emulators. To unload the virtualization kernel driver, run the following -command in a terminal window:
- -sudo /System/Library/Extensions/intelhaxm.kext/Contents/Resources/uninstall.sh- -
Linux-based systems support virtual machine acceleration through the KVM software package. Follow -instructions for installing KVM on your -Linux system, and verify that KVM is enabled. In addition to following the installation -instructions, be aware of these configuration requirements:
- -To run an x86-based emulator with VM acceleration:
- -emulator -avd <avd_name> -qemu -m 512 -enable-kvm-
Note: You must provide an x86-based AVD configuration -name, otherwise VM acceleration will not be enabled.
--qemu -m 512 -enable-kvm-
Important: When using the {@code -qemu} command line option, make sure -it is the last parameter in your command. All subsequent options are interpreted as qemu-specific -parameters.
- - -You can create a disk image and then load it to the emulator at startup, to -simulate the presence of a user's SD card in the device. To do this, you can specify -an SD card image when you create an AVD, or you can use the mksdcard utility included -in the SDK.
- -The following sections describe how to create an SD card disk image, how to copy -files to it, and how to load it in the emulator at startup.
- -Note that you can only load a disk image at emulator startup. Similarly, you -can not remove a simulated SD card from a running emulator. However, you can -browse, send files to, and copy/remove files from a simulated SD card either -with adb or the emulator.
- -The emulator supports emulated SDHC cards, so you can create an SD card image -of any size up to 128 gigabytes.
- - -There are several ways of creating an SD card image. The easiest way is to use the
-AVD Manager to create a new SD card by specifying a size when you create an AVD.
-You can also use the {@code android} command line tool when creating an AVD. Just add the
--c
option to your command:
android create avd -n <avd_name> -t <targetID> -c <size>[K|M]- -
The -c
option can also be used to to specify a path to an SD card
-image for the new AVD. For more information, see Managing Virtual Devices
-from the Command Line.
-
You can also use the mksdcard tool, included in the SDK, to create a FAT32 disk -image that you can load in the emulator at startup. You can access mksdcard in -the tools/ directory of the SDK and create a disk image like this:
- -mksdcard <size> <file>- -
For example:
- -mksdcard 1024M sdcard1.iso- -
For more information, see mksdcard
.
Once you have created the disk image, you can copy files to it prior to -loading it in the emulator. To copy files, you can mount the image as a loop -device and then copy the files to it, or you can use a utility such as {@code mtools} to -copy the files directly to the image. The {@code mtools} package is available for Linux, -Mac, and Windows.
- -Alternatively, you can use the {@code adb push} command to move files onto an SD card image -while it is loaded in an emulator. For more information see the {@code adb push} documentation.
- -By default, the emulator loads the SD card image that is stored with the active
-AVD (see the -avd
startup option).
Alternatively, you can start the emulator with the
--sdcard
flag and specify the name and path of your image (relative
-to the current working directory):
emulator -sdcard <filepath>- - -
The emulator uses mountable disk images stored on your development machine to -simulate flash (or similar) partitions on an actual device. For example, it uses a -disk image containing an emulator-specific kernel, the Android system, a -ramdisk image, and writeable images for user data and simulated SD card.
- -To run properly, the emulator requires access to a specific set of disk image -files. By default, the Emulator always looks for the disk images in the -private storage area of the AVD in use. If no images exist there when -the Emulator is launched, it creates the images in the AVD directory based on -default versions stored in the SDK.
- -Note: The default storage location for
-AVDs is in ~/.android/avd
on OS X and Linux, C:\Documents and
-Settings\<user>\.android\
on Windows XP, and
-C:\Users\<user>\.android\
-on Windows Vista.
To let you use alternate or custom versions of the image files, the emulator -provides startup options that override the default locations and filenames of -the image files. When you use one of these options, the emulator searches for the image -file under the image name or location that you specify; if it can not locate the -image, it reverts to using the default names and location.
- -The emulator uses three types of image files: default image files, runtime -image files, and temporary image files. The sections below describe how to -override the location/name of each type of file.
- -When the emulator launches, but does not find an existing user data image in -the active AVD's storage area, it creates a new one from a default version -included in the SDK. The default user data image is read-only. The image -files are read-only.
- -The emulator provides the -system <dir>
startup option to
-let you override the location where the emulator looks for the default
-user data image.
The emulator also provides a startup option that lets you override the name
-of the default user data image, as described in the following table. When you use the
-option, the emulator looks in the default directory, or in a custom location
-(if you specified -system <dir>
).
Name | -Description | -Comments | -
---|---|---|
userdata.img |
- The initial user-data disk image | -Override using -initdata <file> . Also see
--data <file> , below. |
-
At runtime, the emulator reads and writes data to two disk images: a -user-data image and (optionally) an SD card image. These images emulate the user-data -partition and removable storage media on actual device.
- -The emulator provides a default user-data disk image. At startup, the emulator -creates the default image as a copy of the system user-data image (user-data.img), -described above. The emulator stores the new image with the files of the active AVD.
- - - -The emulator provides startup options to let you override the actual names and storage -locations of the runtime images to load, as described in the following table. When you use one -of these options, the emulator looks for the specified file(s) in the current working directory, -in the AVD directory, or in a custom location (if you specified a path with the filename).
- -Name | -Description | -Comments | -
---|---|---|
userdata-qemu.img |
- An image to which the emulator writes runtime user-data for a unique user. | -Override using -data <filepath> , where <filepath> is the
-path the image, relative to the current working directory. If you supply a filename only,
-the emulator looks for the file in the current working directory. If the file at <filepath> does
-not exist, the emulator creates an image from the default userdata.img , stores it under the name you
-specified, and persists user data to it at shutdown. |
-
sdcard.img |
- An image representing an SD card inserted into the emulated device. | -Override using -sdcard <filepath> , where <filepath> is the
-path the image, relative to the current working directory. If you supply a filename only,
-the emulator looks for the file in the current working directory. |
-
Each emulator instance uses a writeable user-data image to store user- and -session-specific data. For example, it uses the image to store a unique user's -installed application data, settings, databases, and files.
- -At startup, the emulator attempts to load a user-data image stored during -a previous session. It looks for the file in the current working directory, -in the AVD directory described in a previous section and at the custom location/name -that you specified at startup.
- --data
startup option.Note: Because of the AVD configurations used in the emulator,
-each emulator instance gets its own dedicated storage. There is no longer a need
-to use the -d
option to specify an instance-specific storage area.
Optionally, you can create a writeable disk image that the emulator can use -to simulate removeable storage in an actual device. For information about how to create an -emulated SD card and load it in the emulator, see SD Card Emulation
- -You can also use the android tool to automatically create an SD Card image -for you, when creating an AVD. For more information, see Managing Virtual Devices with AVD -Manager. - - -
The emulator creates two writeable images at startup that it deletes at -device power-off. The images are:
- -/cache
partition imageThe emulator does not permit renaming the temporary system image or -persisting it at device power-off.
- -The /cache
partition image is initially empty, and is used by
-the browser to cache downloaded web pages and images. The emulator provides an
--cache <file>
, which specifies the name of the file in which
-to persist the /cache
image at device power-off. If <file>
-
does not exist, the emulator creates it as an empty file.
You can also disable the use of the cache partition by specifying the
--nocache
option at startup.
The emulator provides versatile networking capabilities that you can use to -set up complex modeling and testing environments for your application. The -sections below introduce the emulator's network architecture and capabilities. -
- -Each instance of the emulator runs behind a virtual router/firewall service -that isolates it from your development machine's network interfaces and settings -and from the internet. An emulated device can not see your development machine -or other emulator instances on the network. Instead, it sees only that it is -connected through Ethernet to a router/firewall.
- -The virtual router for each instance manages the 10.0.2/24 network address -space — all addresses managed by the router are in the form of -10.0.2.<xx>, where <xx> is a number. Addresses within this space are -pre-allocated by the emulator/router as follows:
- -Network Address | -Description | -
---|---|
10.0.2.1 | -Router/gateway address | -
10.0.2.2 | -Special alias to your host loopback interface (i.e., 127.0.0.1 on your -development machine) | -
10.0.2.3 | -First DNS server | -
10.0.2.4 / 10.0.2.5 / 10.0.2.6 | -Optional second, third and fourth DNS server (if any) | -
10.0.2.15 | -The emulated device's own network/ethernet interface | -
127.0.0.1 | -The emulated device's own loopback interface | -
Note that the same address assignments are used by all running emulator -instances. That means that if you have two instances running concurrently on -your machine, each will have its own router and, behind that, each will have an -IP address of 10.0.2.15. The instances are isolated by a router and can -not see each other on the same network. For information about how to -let emulator instances communicate over TCP/UDP, see Connecting Emulator Instances.
- -Also note that the address 127.0.0.1 on your development machine corresponds -to the emulator's own loopback interface. If you want to access services running -on your development machine's loopback interface (a.k.a. 127.0.0.1 on your -machine), you should use the special address 10.0.2.2 instead.
- -Finally, note that each emulated device's pre-allocated addresses are -specific to the Android emulator and will probably be very different on real -devices (which are also very likely to be NAT-ed, i.e., behind a -router/firewall)
- - -Android applications running in an emulator can connect to the network available on your -workstation. However, they connect through the emulator, not directly to hardware, and the emulator -acts like a normal application on your workstation. This means that the emulator, and thus your -Android applications, are subject to some limitations:
- -The emulator's virtual router should be able to handle all outbound TCP and -UDP connections/messages on behalf of the emulated device, provided your -development machine's network environment allows it to do so. There are no -built-in limitations on port numbers or ranges except the one imposed by your -host operating system and network.
- -Depending on the environment, the emulator may not be able to support other -protocols (such as ICMP, used for "ping") might not be supported. Currently, the -emulator does not support IGMP or multicast.
- -To communicate with an emulator instance behind its virtual router, you need -to set up network redirection on the virtual router. Clients can then connect -to a specified guest port on the router, while the router directs traffic -to/from that port to the emulated device's host port.
- -To set up the network redirection, you create a mapping of host and guest -ports/addresses on the emulator instance. There are two ways to set up -network redirection: using emulator console commands and using the ADB tool, as -described below.
- - -Each emulator instance provides a control console the you can connect to, to
-issue commands that are specific to that instance. You can use the
-redir
console command to set up redirection as needed for an
-emulator instance.
First, determine the console port number for the target emulator instance. -For example, the console port number for the first emulator instance launched is -5554. Next, connect to the console of the target emulator instance, specifying -its console port number, as follows:
- -telnet localhost 5554
-
-Once connected, use the redir
command to work with redirection.
-To add a redirection, use:
add <protocol>:<host-port>:<guest-port>
-
-
-where <protocol>
is either tcp
or udp
,
-and <host-port>
and <guest-port>
sets the
-mapping between your own machine and the emulated system, respectively.
For example, the following command sets up a redirection that handles all -incoming TCP connections to your host (development) machine on 127.0.0.1:5000 -and will pass them through to the emulated system's 10.0.2.15:6000.:
- -redir add tcp:5000:6000- -
To delete a redirection, you can use the redir del
command. To
-list all redirection for a specific instance, you can use redir
-list
. For more information about these and other console commands, see
-Using the Emulator Console.
Note that port numbers are restricted by your local environment. this typically
-means that you cannot use host port numbers under 1024 without special
-administrator privileges. Also, you won't be able to set up a redirection for a
-host port that is already in use by another process on your machine. In that
-case, redir
generates an error message to that effect.
The Android Debug Bridge (ADB) tool provides port forwarding, an alternate -way for you to set up network redirection. For more information, see Forwarding Ports in the ADB -documentation.
- -Note that ADB does not currently offer any way to remove a redirection, -except by killing the ADB server.
- - -At startup, the emulator reads the list of DNS servers that your system is -currently using. It then stores the IP addresses of up to four servers on this -list and sets up aliases to them on the emulated addresses 10.0.2.3, 10.0.2.4, -10.0.2.5 and 10.0.2.6 as needed.
- -On Linux and OS X, the emulator obtains the DNS server addresses by parsing
-the file /etc/resolv.conf
. On Windows, the emulator obtains the
-addresses by calling the GetNetworkParams()
API. Note that this
-usually means that the emulator ignores the content of your "hosts" file
-(/etc/hosts
on Linux/OS X, %WINDOWS%/system32/HOSTS
- on Windows).
When starting the emulator at the command line, you can also use the
--dns-server <serverList>
option to manually specify the
-addresses of DNS servers to use, where <serverList> is a comma-separated
-list of server names or IP addresses. You might find this option useful if you
-encounter DNS resolution problems in the emulated network (for example, an
-"Unknown Host error" message that appears when using the web browser).
If your emulator must access the Internet through a proxy server, you can use
-the -http-proxy <proxy>
option when starting the emulator, to
-set up the appropriate redirection. In this case, you specify proxy information
-in <proxy>
in one of these formats:
http://<machineName>:<port>- -
or
- -http://<username>:<password>@<machineName>:<port>- -
The -http-proxy
option forces the emulator to use the specified
-HTTP/HTTPS proxy for all outgoing TCP connections. Redirection for UDP is not
-currently supported.
Alternatively, you can define the environment variable
-http_proxy
to the value you want to use for
-<proxy>
. In this case, you do not need to specify a value for
-<proxy>
in the -http-proxy
command — the
-emulator checks the value of the http_proxy
environment variable at
-startup and uses its value automatically, if defined.
You can use the -verbose-proxy
option to diagnose proxy
-connection problems.
To allow one emulator instance to communicate with another, you must set up -the necessary network redirection as illustrated below.
- -Assume that your environment is
- -and you want to run a server on B, to which C will connect, here is how you -could set it up:
- -10.0.2.15:<serverPort>
A:localhost:<localPort>
to
-B:10.0.2.15:<serverPort>
10.0.2.2:<localPort>
For example, if you wanted to run an HTTP server, you can select
-<serverPort>
as 80 and <localPort>
as
-8080:
redir add tcp:8080:80
The emulator automatically forwards simulated voice calls and SMS messages from one instance to -another. To send a voice call or SMS, use the dialer application or SMS application, respectively, -from one of the emulators.
- -To initiate a simulated voice call to another emulator instance:
-To send an SMS message to another emulator instance, launch the SMS application (if available). Specify the console port number of the target emulator instance as as the SMS address, enter the message text, and send the message. The message is delivered to the target emulator instance.
- -You can also connect to an emulator instance's console to simulate an incoming voice call or SMS. For more information, see Telephony Emulation and SMS Emulation. - - -
Each running emulator instance provides a console that lets you query and control the emulated -device environment. For example, you can use the console to manage port redirection, network -characteristics, and telephony events while your application is running on the emulator. To -access the console and enter commands, use telnet to connect to the console's port number.
- -To connect to the console of any running emulator instance at any time, use this command:
- -telnet localhost <console-port>- -
An emulator instance occupies a pair of adjacent ports: a console port and an {@code adb} port. -The port numbers differ by 1, with the {@code adb} port having the higher port number. The console -of the first emulator instance running on a given machine uses console port 5554 and {@code adb} -port 5555. Subsequent instances use port numbers increasing by two — for example, 5556/5557, -5558/5559, and so on. Up to 16 concurrent emulator instances can run a console facility.
- -To connect to the emulator console, you must specify a valid console port. If multiple emulator instances are running, you need to determine the console port of the emulator instance you want to connect to. You can find the instance's console port listed in the title of the instance window. For example, here's the window title for an instance whose console port is 5554:
- -Android Emulator (5554)
Alternatively, you can use the adb devices
command, which prints a list of running emulator instances and their console port numbers. For more information, see Querying for Emulator/Device Instances in the adb documentation.
Note: The emulator listens for connections on ports 5554-5587 and accepts connections only from localhost.
- -Once you are connected to the console, you can then enter help [command]
to see a list of console commands and learn about specific commands.
To exit the console session, use quit
or exit
.
The following sections below describe the major functional areas of the console.
- - -You can use the console to add and remove port redirection while the emulator is running. After -you connect to the console, manage port redirection by entering the following command:
- -redir <list|add|del>- -
The redir
command supports the subcommands listed in the table below.
Subcommand - | Description | -Comments | -
---|---|---|
list |
- List the current port redirection. | -- |
add <protocol>:<host-port>:<guest-port> |
- Add a new port redirection. | -
|
-
del <protocol>:<host-port> |
- Delete a port redirection. | -The meanings of <protocol> and <host-port> are listed in the previous row. | -
You can use the console to set the geographic location reported to the applications running
-inside an emulator. Use the geo
command to send a simple GPS fix to the
-emulator, with or without NMEA 1083 formatting:
geo <fix|nmea>- -
The geo
command supports the subcommands listed in the table below.
Subcommand | -Description | -Comments | -
---|---|---|
fix <longitude> <latitude> [<altitude>] |
- Send a simple GPS fix to the emulator instance. | -Specify longitude and latitude in decimal degrees. Specify altitude in meters. | -
nmea <sentence> |
- Send an NMEA 0183 sentence to the emulated device, as if it were sent from an emulated GPS modem. | -<sentence> must begin with '$GP'. Only '$GPGGA' and '$GPRCM' sentences are currently supported. |
-
You can issue the geo
command as soon as an emulator instance is running. The
-emulator sets the location you enter by creating a mock location provider. This provider responds to
-location listeners set by applications, and also supplies the location to the {@link
-android.location.LocationManager}. Any application can query the location manager to obtain the
-current GPS fix for the emulated device by calling:
-
-
LocationManager.getLastKnownLocation("gps")- -
For more information about the Location Manager, see {@link android.location.LocationManager}. -
- -The {@code event} console commands sends hardware events to the emulator. The syntax for this -command is as follows:
- -event <send|types|codes|text>- -
The event
command supports the subcommands listed in the table below.
Subcommand - | Description | -Comments | -
---|---|---|
send <type>:<code>:<value> [...] |
- Send one or more events to the Android kernel. | -You can use text names or integers for <type> and <value> . |
-
types |
- List all <type> string aliases supported by the event subcommands. |
-- |
codes <type> |
- List all <codes> string aliases supported by the event
- subcommands for the specified <type> . |
-- |
event text <message> |
- Simulate keypresses to send the specified string of characters as a message, | -The message must be a UTF-8 string. Unicode posts will be reverse-mapped according to the current device keyboard. Unsupported characters will be discarded silently. | -
The {@code power} command controls the power state reported by the emulator to applications. The -syntax for this command is as follows:
- -power <display|ac|status|present|health|capacity>- -
The event
command supports the subcommands listed in the table below.
Subcommand | -Description | -Comments | -
---|---|---|
display |
- Display battery and charger state. | -- |
ac <on|off> |
- Set AC charging state to on or off. | -- |
status <unknown|charging|discharging|not-charging|full> |
- Change battery status as specified. | -- |
present <true|false> |
- Set battery presence state. | -- |
health <unknown|good|overheat|dead|overvoltage|failure> |
- Set battery health state. | -- |
capacity <percent> |
- Set remaining battery capacity state (0-100). | -- |
You can use the console to check the network status and current delay and speed characteristics. To do so, connect to the console and use the netstatus
command. Here's an example of the command and its output.
network status -- - -
The emulator lets you simulate various network latency levels, so that you can test your -application in an environment more typical of the actual conditions in which it will run. You can -set a latency level or range at emulator startup or you can use the console to change the latency, -while the application is running in the emulator.
- -To set latency at emulator startup, use the -netdelay
emulator option with a
-supported <delay>
value, as listed in the table below. Here are some
-examples:
emulator -netdelay gprs -emulator -netdelay 40 100- -
To make changes to network delay while the emulator is running, connect to the console and use
-the netdelay
command with a supported <delay>
value from the table
-below.
network delay gprs- -
The format of network <delay> is one of the following (numbers are milliseconds):
- -Value | -Description | Comments |
---|---|---|
gprs | GPRS | -(min 150, max 550) | -
edge | EDGE/EGPRS | -(min 80, max 400) | -
umts | UMTS/3G | -(min 35, max 200) | -
none | No latency | (min 0, max 0) |
<num> |
-Emulate an exact latency (milliseconds). | -|
<min>:<max> |
-Emulate an specified latency range (min, max milliseconds). | -
The emulator also lets you simulate various network transfer rates. -You can set a transfer rate or range at emulator startup or you can use the console to change the -rate, while the application is running in the emulator.
- -To set the network speed at emulator startup, use the -netspeed
emulator option with a supported
-<speed>
value, as listed in the table below. Here are some examples:
emulator -netspeed gsm -emulator -netspeed 14.4 80- -
To make changes to network speed while the emulator is running, connect to the console and use
-the netspeed
command with a supported <speed>
value from the table
-below.
network speed 14.4 80- -
The format of network <speed>
is one of the following (numbers are
-kilobits/sec):
Value | -Description | Comments |
---|---|---|
gsm |
- GSM/CSD | (Up: 14.4, down: 14.4) |
hscsd |
- HSCSD | (Up: 14.4, down: 43.2) |
gprs |
- GPRS | (Up: 40.0, down: 80.0) |
edge |
- EDGE/EGPRS | -(Up: 118.4, down: 236.8) | -
umts |
- UMTS/3G | (Up: 128.0, down: 1920.0) |
hsdpa |
- HSDPA | (Up: 348.0, down: 14400.0) |
full |
- no limit | (Up: 0.0, down: 0.0) |
<num> |
- Set an exact rate used for both upload and download. | |
<up>:<down> |
- Set exact rates for upload and download separately. |
The Android emulator includes its own GSM emulated modem that lets you simulate telephony -functions in the emulator. For example, you can simulate inbound phone calls, establish data -connections and terminate them. The Android system handles simulated calls exactly as it would -actual calls. The emulator does not support call audio.
- -You can use the {@code gsm} command to access the emulator's telephony functions after connecting -to the console. The syntax for this command is as follows:
- -gsm <call|accept|busy|cancel|data|hold|list|voice|status>- -
The gsm
command supports the subcommands listed in the table below.
Subcommand | -Description | -Comments | -
---|---|---|
call <phonenumber> |
- Simulate an inbound phone call from <phonenumber>. | -- |
accept <phonenumber> |
- Accept an inbound call from <phonenumber> and change the call's state "active". | -You can change a call's state to "active" only if its current state is "waiting" or "held". | -
busy <phonenumber> |
- Close an outbound call to <phonenumber> and change the call's state to "busy". | -You can change a call's state to "busy" only if its current state is "waiting". | -
cancel <phonenumber> |
- Terminate an inbound or outbound phone call to/from <phonenumber>. | -- |
data <state> |
- Change the state of the GPRS data connection to <state>. | -Supported <state> values are: -
|
-
hold |
- Change the state of a call to "held". | -You can change a call's state to "held" only if its current state is "active" or "waiting". | -
list |
- List all inbound and outbound calls and their states. | -- |
voice <state> |
- Change the state of the GPRS voice connection to <state>. | -Supported <state> values are: -
|
-
status |
- Report the current GSM voice/data state. | -Values are those described for the voice and data commands. |
-
The Android emulator console lets you generate an SMS message and direct it to an emulator -instance. Once you connect to an emulator instance, you can generate an emulated incoming SMS using -the following command:
- -sms send <senderPhoneNumber> <textmessage>- -
where <senderPhoneNumber>
contains an arbitrary numeric string.
The console forwards the SMS message to the Android framework, which passes it through to an application that handles that message type.
- - -You can use the vm
command to control the VM on an emulator instance. The syntax for
-this command is as follows:
vm <start|stop|status>- -
The vm
command supports the subcommands listed in the table below.
Subcommand | -Description | -Comments | -
---|---|---|
start |
- Start the VM on the instance. | -- |
stop |
- Stop the VM on the instance. | -- |
start |
- Display the current status of the VM (running or stopped). | -- |
You can use the window
command to manage the emulator window. The syntax for this
-command is as follows:
window <scale>- -
The vm
command supports the subcommands listed in the table below.
Subcommand | -Description | -Comments | -
---|---|---|
scale <scale> |
- Scale the emulator window. | -A number between 0.1 and 3 that sets the scaling factor. You can - also specify scale as a DPI value if you add the suffix "dpi" to the scale value. A value of "auto" - tells the emulator to select the best window size. | -
You can terminate an emulator instance through the console, using the kill
command.
The {@code adb} utility sees the emulator as an actual physical device. For this reason, you
-might have to use the {@code -d} flag with some common {@code adb} commands, such as
-install
. The {@code -d} flag lets you specify which of several connected devices to use
-as the target of a command. If you don't specify {@code -d}, the emulator targets the first
-device in its list. For more information about {@code adb}, see Android Debug Bridge.
For emulators running on Mac OS X, if you see an error {@code Warning: No DNS servers found}
-when starting the emulator, check to see whether you have an /etc/resolv.conf
file. If
-not, please run the following line in a command window:
ln -s /private/var/run/resolv.conf /etc/resolv.conf- -
See Frequently Asked Questions for more -troubleshooting information.
diff --git a/docs/html/tools/help/etc1tool.jd b/docs/html/tools/help/etc1tool.jd deleted file mode 100644 index a7f76f5cadb6..000000000000 --- a/docs/html/tools/help/etc1tool.jd +++ /dev/null @@ -1,68 +0,0 @@ -page.title=etc1tool -parent.title=Tools -parent.link=index.html -@jd:body - - -etc1tool
is a command line utility that lets you encode PNG
- images to the ETC1 compression standard and decode ETC1 compressed images back to PNG.
The usage for etc1tool
is:
etc1tool infile [--help | --encode | --encodeNoHeader | --decode] [--showDifference -diff-file] [-o outfile]- -
Option | - -Description | -
---|---|
infile |
-
- The input file to compress | -
--help |
-
- Print usage information | -
--encode |
-
- Create an ETC1 file from a PNG file. - This is the default mode for the tool if nothing is specified. | -
--encodeNoHeader |
-
- Create a raw ETC1 data file (without a header) from a PNG file. | -
--decode |
-
- Create a PNG file from an ETC1 file | -
--showDifference diff-file |
-
- Write the difference between the original and encoded image to
- diff-file (only valid when encoding). |
-
-o outfile |
-
- Specify the name of the output file.
- If outfile is not specified, the output file is constructed
- from the input filename with the appropriate suffix (.pkm or .png ).
- |
-
Tracer is a tool for analyzing OpenGL for Embedded Systems (ES) code in your Android application. -The tool allows you to capture OpenGL ES commands and frame by frame images to help you understand -how your graphics commands are being executed.
- -Note: The Tracer tool requires a device running Android 4.1 (API -Level 16) or higher.
- - -To run Tracer in Device Monitor:
- -Tracer captures OpenGL ES command execution logs and can also capture progressive images of the -frames generated by those commands to enable you to perform logical and visual analysis of your -OpenGL ES code. The Tracer tool operates by connecting to a device running Android 4.1 (API Level -16) or higher that is running the application you want to analyze. The Tracer tool captures trace -information while the application is running and saves it to a {@code .gltrace} file for -analysis.
- - - - -To capture an OpenGL ES trace for an Android application:
- -Note: If you are tracing the default activity for the -application, you can leave this field blank.
-Note: If you want to capture progressive frame images for each -drawing call, enable the Read back currently bound framebuffer on glDraw*() option. -Be aware that using this option can result in large trace files.
-After you have generated a trace, you can load it for review and analysis.
- -To review a captured trace:
- -The Hierarchy Viewer allows you to debug and optimize your user -interface. It provides a visual representation of the layout's View hierarchy -(the Layout View) and a magnified inspector of the display (the Pixel Perfect View).
- -To start the Hierarchy Viewer, do one of the following:
- -tools/
directory, enter:
- monitor
For more information on how to use the Hierarchy Viewer, see -Optimizing Your UI. -
- -Note: The command line version of Hierarchy Viewer has been -deprecated.
- - diff --git a/docs/html/tools/help/hprof-conv.jd b/docs/html/tools/help/hprof-conv.jd deleted file mode 100644 index 89d6a68ec1c6..000000000000 --- a/docs/html/tools/help/hprof-conv.jd +++ /dev/null @@ -1,26 +0,0 @@ -page.title=HPROF Converter -parent.title=Tools -parent.link=index.html -@jd:body - -
-The hprof-conv
tool converts the HPROF file that is
-generated by the Android SDK tools to a standard format so you
-can view the file in a profiling tool of your choice.
hprof-conv [-z] <infile> <outfile>- -
-You can use "-" for <infile>
or <outfile>
-to specify stdin or stdout.
-
-You can use "-z" to filter out zygote allocations shared by all applications. -
- -Note: Android Studio provides integrated access to this conversion -process. To convert a heap dump to standard HPROF format in Android Studio, right-click a heap -snapshot in the Captures view and select Export to standard .hprof.
- - diff --git a/docs/html/tools/help/image-asset-studio.jd b/docs/html/tools/help/image-asset-studio.jd deleted file mode 100644 index 818b7442007f..000000000000 --- a/docs/html/tools/help/image-asset-studio.jd +++ /dev/null @@ -1,200 +0,0 @@ -page.title=Image Asset Studio -parent.title=Tools -parent.link=index.html -page.tags=image asset -@jd:body -Image Asset Studio helps you to generate custom icons for your Android applications from existing
- image, clipart, or text-string resources. It generates a set of icons at the appropriate resolution
- for each generalized screen
- density that your app supports.
- The newly generated icons are placed in density-specific folders (for example, mipmap-mdpi/
-
or drawable-xxxhdpi/
), which
- reside in the application’s res/
folder. At runtime, Android uses the appropriate
- resource based on the screen density of the device your application is running on.
Image Asset Studio generates the following asset types:
-This guide shows how to generate these assets using Image Asset Studio.
- -Follow these steps to access Image Asset Studio:
-res/
folder and select New > Image
-Asset. The Image Asset Studio window appears.You can generate icons from image, clipart -, or text-string resources. This section explains how to work with -each of these resources. -
- - -The icon to be generated appears in the Preview pane, displayed at sizes corresponding - to different screen densities.
- -The rest of the settings on this screen are optional. -To learn how to customize your icons using these options, - see Customizing Icons.
The icon to be generated appears in the Preview pane, displayed at sizes corresponding -to different screen densities.
-The rest of the settings on this screen are optional. - To learn how to customize your icons using these options, - see Customizing Icons.
The icon to be generated appears in the Preview pane, displayed at sizes corresponding -to different screen densities.
The rest of the settings on this screen are optional. -To learn how to customize your icons using these options, -see Customizing Icons.
Image Asset Studio lets you customize various visual effects for your icons. The following options -are of particular note.
- -This section explains how to save your icons to the res/
folder. Do so by following
- these steps:
Note: Launcher icon files reside in a different location from that
- of other icons. They are located in the mipmap/
folder. All other icon files reside
- in the drawable/
folder of your project.
To change the module and resource directory, follow these steps:
-src/main/res
: This source set applies to all build variants, including debug
- and release.src/debug/res
, src/release/res
: These source sets override the main
- source set and apply to one version of a build. The debug source set is for debugging only.
- After you have an image resource in the res/
directory of your project, you can
- reference it from your Java code or your XML layout using its
-
- resource ID.
For example, the following XML references the ic_launcher icon
in the
-mipmap/
folder.
-<application android:name="ApplicationTitle" - android:label="@string/app_label" - android:icon="@mipmap/ic_launcher" >- -
The following Java code sets an
-ImageView to use
- the drawable/myimage.png
resource:
ImageView imageView = (ImageView) findViewById(R.id.myimageview); -imageView.setImageResource(R.drawable.myimage);diff --git a/docs/html/tools/help/index.jd b/docs/html/tools/help/index.jd deleted file mode 100755 index 411f908463ba..000000000000 --- a/docs/html/tools/help/index.jd +++ /dev/null @@ -1,176 +0,0 @@ -page.title=Tools Help -@jd:body - - -
The Android SDK includes a variety of tools that help you develop mobile -applications for the Android platform. The tools are classified into two groups: SDK tools -and platform tools. SDK tools are platform independent and are required no matter which -Android platform you are developing on. Platform tools are customized to support the features of the -latest Android platform.
- - -The SDK tools are installed with the SDK starter package and are periodically updated.
-The SDK tools are required if you are developing Android applications. The most important SDK tools
-include the Android SDK Manager (android sdk
), the AVD Manager (android
-avd
) the emulator (emulator
), and the Dalvik Debug Monitor Server
-(ddms
). A short summary of some frequently-used SDK tools is provided below.
dmtracedump
. For more information on using dmtracedump
, see Profiling
-with Traceview and dmtracedump.apk
files by ensuring that all uncompressed data starts with a
-particular alignment relative to the start of the file. This should always be used to align .apk
-files after they have been signed.The platform tools are typically updated every time you install a new SDK platform. Each update
-of the platform tools is backward compatible with older platforms. Usually, you directly use only
-one of the platform tools—the Android Debug Bridge (adb
).
-Android Debug Bridge 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 Android application (.apk) file on a
-device.
The other platform tools, such as aidl,
-aapt
, dexdump
, and dx
, are typically called by the Android
-build tools, so you rarely need to invoke these tools directly.
-As a general rule, you should rely on the build tools to call them as needed.
Note: The Android SDK provides additional shell tools that can
-be accessed through adb
, such as bmgr and
-logcat.
The {@code jobb} tool allows you to build encrypted and unencrypted APK expansion files in - Opaque Binary Blob (OBB) format. You can download and mount these expansion files in your - application using {@link android.os.storage.StorageManager} on devices with Android 2.3 (API - Level 9) or higher. OBB files are used to provide additional file assets for Android applications - (such as graphics, sounds and video), separate from an application's APK file. For more - information on using expansion files, see - APK Expansion Files.
- - -The syntax for running {@code jobb} is as follows:
- --jobb [-d <directory>][-o <filename>][-pn <package>][-pv <version>] \ - [-k <key>][-ov][-dump <filename>][-v][-about] -- -
You can use the {@code jobb} tool to create an OBB file or extract the contents of an -existing OBB. The following example command creates an OBB file from source files.
- --$ jobb -d /temp/assets/ -o my-app-assets.obb -k secret-key -pn com.my.app.package -pv 11 -- -
This example shows how to dump (extract) the contents of an existing OBB file:
- --$ jobb -d /temp/obb-output/ -o my-app-assets.obb -k secret-key -- - -
The table below lists the command line options for the {@code jobb} tool.
- -Option | -Description | -
---|---|
{@code -d <directory>} | -Set the input directory for creating an OBB file, or the output directory when extracting - ({@code -dump}) an existing file. When creating an OBB file, the contents of the specified - directory and all its sub-directories are included in the OBB file system. - | -
{@code -o <filename>} | -Specify the filename for the OBB file. This parameter is required when - creating an OBB and extracting (dumping) its contents. | -
{@code -pn <package>} | -Specify the package name for the application that mounts the OBB file, which corresponds - to the {@code package} value specified in your application's manifest. This parameter is - required when creating an OBB file. | -
{@code -pv <version>} | -Set the minimum version for the application that can mount the OBB file, which corresponds - to the {@code android:versionCode} value in your application's manifest. This parameter is - required when creating an OBB file. | -
{@code -k <key>} | -Specify a password for encrypting a new OBB file or decrypting an existing, encypted - OBB file. | -
{@code -ov} | -Create OBB file that is an overlay of an existing OBB file structure. This option allows - the new package contents to be mounted into the same location as a previous package and is - intended for creating patch versions of previously generated OBB files. Files within an - overlay OBB file replace files that have the same path. | -
{@code -dump <filename>} | -Extract the contents of the specified OBB file. When using this option, you must also - specify the output directory for the contents using the {@code -d <directory>} - parameter. - -Note: When dumping an existing OBB file, you can omit the - {@code -d <directory>} parameter to get a listing of the directories inside the file, - without extracting the contents. - |
-
{@code -v} | -Set verbose output for the tool. | -
{@code -about} | -Display version and help information for the {@code jobb} tool. | -
Note: The Android layoutopt
tool has been replaced
-by the {@code lint} tool beginning in SDK Tools revision 16. The {@code lint} tool reports UI
-layout performance issues in a similar way as layoutopt
, and detects additional problems.
For more information about using {@code lint}, see -Improving Your Code with lint and the -lint reference documentation.
- -layoutopt
is a command-line tool that helps you optimize the
-layouts and layout hierarchies of your applications.
- -
This document is a reference to the available command line options. For more information and -sample -output of the tool, see Optimizing layouts with -layoutopt.
- -To run layoutopt
against a given list of layout resources:
layoutopt <file_or_directory> ...- -
For example:
- -$ layoutopt res/layout-land-
$ layoutopt res/layout/main.xml res/layout-land/main.xml- diff --git a/docs/html/tools/help/lint.jd b/docs/html/tools/help/lint.jd deleted file mode 100644 index 0f52689b3342..000000000000 --- a/docs/html/tools/help/lint.jd +++ /dev/null @@ -1,191 +0,0 @@ -page.title=lint -parent.title=Tools -parent.link=index.html -@jd:body - -
The Android {@code lint} tool is a static code analysis tool that checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization.
- -In Android Studio, the configured lint
and other IDE inspections run automatically
-whenever you compile your program. You can also manually run inspections in Android Studio
-by selecting Analyze > Inspect Code from the application or right-click menu.
-The Specify Inspections Scope dialog appears so you can specify the desired inspection
-profile and scope.
For more information on enabling {@code lint} inspections and running {@code lint}, -see Improving Your Code with lint.
- --
lint [flags] <project directory>- -For example, you can issue the following command to scan the Java and XML files under the -{@code myproject} directory and its subdirectories. The result is displayed on the console. -
lint myproject- -You can also use {@code lint} to check for a specific issue. For example, you can run the following command to scan the files under the {@code myproject} directory and its subdirectories to check for XML attributes missing the Android namespace prefix. The issue ID {@code MissingPrefix} tells lint to only scan for this issue. -
lint --check MissingPrefix myproject- -You can create an HTML report for the issues that {@code lint} detects. For example, you can run the following command to scan the {@code myproject} directory and its subdirectories for accessibility issues, then generate an HTML report in the {@code accessibility_report.html} file. -
lint --check Accessibility --HTML accessibility_report.html myproject- - -
Table 1 describes the command-line options for {@code lint}.
- -Category | -Option | -Description | -Comments | -
---|---|---|---|
Checking | ---disable <list> |
-Disable checking for a specific list of issues. | -The <list> must be a comma-separated list of {@code lint} issue IDs or categories. |
-
--enable <list> |
-Check for all the default issues supported by {@code lint} as well as the specifically enabled list of issues. | -The <list> must be a comma-separated list of {@code lint} issue IDs or categories. |
-|
--check <list> |
-Check for a specific list of issues. | -The <list> must be a comma-separated list of {@code lint} issue IDs or categories. |
-|
-w or --nowarn |
-Only check for errors and ignore warnings | -- | |
-Wall |
-Check for all warnings, including those that are disabled by default | -- | |
-Werror |
-Report all warnings as errors | -- | |
--config <filename> |
-Use the specified configuration file to determine if issues are enabled or disabled for {@code lint} checking | -If the project contains a {@code lint.xml} file, the {@code lint.xml} file will be used as the configuration file by default. | -|
Reporting | ---html <filename> |
-Generate an HTML report. | -The report is saved in the output file specified in the argument. The HTML output includes code snippets of the source code where {@code lint} detected an issue, a verbose description of the issue found, and links to the source file. | -
--url <filepath>=<url> |
-In the HTML output, replace a local path prefix <filepath> with a url prefix <url> . |
-The {@code --url} option only applies when you are generating an HTML report with the {@code --html} option. You can specify multiple <filepath>=<url> mappings in the argument by separating each mapping with a comma. To turn off linking to files, use {@code --url none} |
-|
--simplehtml <filename> |
-Generate a simple HTML report | -The report is saved in the output file specified in the argument. | -|
--xml <filename> |
-Generate an XML report | -The report is saved in the output file specified in the argument. | -|
--fullpath |
-Show the full file paths in the {@code lint} checking results. | -- | |
--showall |
-Don't truncate long messages or lists of alternate locations. | -- | |
--nolines |
-Don't include code snippets from the source files in the output. | -- | |
--exitcode |
-Set the exit code to 1 if errors are found. | -- | |
--quiet |
-Don't show the progress indicator. | -- | |
Help | ---help |
-List the command-line arguments supported by the {@code lint} tool. | -Use {@code --help <topic>} to see help information for a specific topic, such as "suppress". | -
--list |
-List the ID and short description for issues that can be checked by {@code lint} | -- | |
--show |
-List the ID and verbose description for issues that can be checked by {@code lint} | -Use {@code --show <ids>} to see descriptions for a specific list of {@code lint} issue IDs. | -|
--version |
-Show the {@code lint} version | -- |
To configure lint checking, you can apply the following annotation or attribute to the source files in your Android project.
-@SuppressLint
-annotation. tools:ignore
attribute. You can also specify your {@code lint} checking preferences for a specific Android project in
-the lint.xml
file. For more information on configuring {@code lint}, see
-Improving Your Code with lint.
The Android logging system provides a mechanism for collecting and viewing system debug
- output. Logs from various applications and portions of the system are collected in a series of
- circular buffers, which then can be viewed and filtered by the logcat
command. You can use
- logcat
from an ADB shell to view the log messages.
For complete information about logcat options and filtering specifications, see - Reading and Writing Logs.
- -For more information on accessing logcat
from DDMS, instead of the command line, see
- Using DDMS.
-[adb] logcat [<option>] ... [<filter-spec>] ... -- -
You can run logcat
as an adb command or directly in a shell prompt
- of your emulator or connected device. To view log output using adb, navigate to your SDK
- platform-tools/
directory and execute:
-$ adb logcat -- -
You can create a shell connection to a device and execute:
--$ adb shell -# logcat -- -
The following table describes the command line options of logcat
.
Option | - -Description | -
---|---|
-b <buffer> |
-
- Loads an alternate log buffer for viewing, such as events or
- radio . The main buffer is used by default. See Viewing Alternative Log Buffers. |
-
-c |
-
- Clears (flushes) the entire log and exits. | -
-d |
-
- Dumps the log to the screen and exits. | -
-f <filename> |
-
- Writes log message output to <filename> . The default is
- stdout . |
-
-g |
-
- Prints the size of the specified log buffer and exits. | -
-n <count> |
-
- Sets the maximum number of rotated logs to <count> . The default value
- is 4. Requires the -r option. |
-
-r <kbytes> |
-
- Rotates the log file every <kbytes> of output. The default value is
- 16. Requires the -f option. |
-
-s |
-
- Sets the default filter spec to silent. | -
-v <format> |
-
- Sets the output format for log messages. The default is brief format. For a
- list of supported formats, see Controlling Log Output
- Format. |
-
The mksdcard
tool lets you quickly create a FAT32 disk image that you can load in the
- emulator, to simulate the presence of an SD card in the device. Because you can specify an SD
- card while creating an AVD in the AVD Manager, you usually use that feature to create an SD card.
- This tool creates an SD card that is not bundled with an AVD, so it is useful for situations
- where you need to share a virtual SD card between multiple emulators.
-mksdcard -l <label> <size> <file> -- -
The following table describes the command-line options of mksdcard
Option | - -Description | -
---|---|
-l |
-
- A volume label for the disk image to create. | -
size |
-
- An integer that specifies the size (in bytes) of disk image to create. You can also
- specify size in kilobytes or megabytes, by appending a "K" or "M" to <size>. For
- example, 1048576K , 1024M . |
-
file |
-
- The path/filename of the disk image to create. | -
Once you have created the disk image file, you can load it in the emulator at startup using
- the emulator's -sdcard
option. For more information, see Android Emulator.
The usage for the -sdcard
option is as follows:
emulator -sdcard <file>- -
mksdcard -l mySdCard 1024M mySdCardFile.img\ No newline at end of file diff --git a/docs/html/tools/help/monitor.jd b/docs/html/tools/help/monitor.jd deleted file mode 100755 index 3541cc30d928..000000000000 --- a/docs/html/tools/help/monitor.jd +++ /dev/null @@ -1,51 +0,0 @@ -page.title=Device Monitor -@jd:body - -
Android Device Monitor is a stand-alone tool that provides a graphical user interface for -several Android application debugging and analysis tools. The Monitor tool does not -require installation of an integrated development environment, such as Android Studio, and -encapsulates the following tools:
- -To start Device Monitor:
- -tools/
directory, enter the following command:
- monitor-
Start an Android emulator or connect an Android device via USB cable, and connect Device -Monitor to the device by selecting it in the Devices window.
- -Note: Only one debugger can be connected to your device at a time.
diff --git a/docs/html/tools/help/monkey.jd b/docs/html/tools/help/monkey.jd deleted file mode 100644 index 941f5d9696b0..000000000000 --- a/docs/html/tools/help/monkey.jd +++ /dev/null @@ -1,242 +0,0 @@ -page.title=UI/Application Exerciser Monkey -parent.title=Tools -parent.link=index.html -@jd:body - -The Monkey is a program that runs on your -emulator or device and generates pseudo-random -streams of user events such as clicks, touches, or gestures, as well as a number of system-level -events. You can use the Monkey to stress-test applications that you are developing, in a random -yet repeatable manner.
- - -The Monkey is a command-line tool that you can run on any emulator -instance or on a device. It sends a pseudo-random stream of -user events into the system, which acts as a stress test on the application software you are -developing.
- -The Monkey includes a number of options, but they break down into four primary -categories:
- -When the Monkey runs, it generates events and sends them to the system. It also watches -the system under test and looks for three conditions, which it treats specially:
- -Depending on the verbosity level you have selected, you will also see reports on the progress -of the Monkey and the events being generated.
- - -You can launch the Monkey using a command line on your development machine or from a script.
-Because the Monkey runs in the emulator/device environment, you must launch it from a shell in
-that environment. You can do this by prefacing adb shell
to each command,
-or by entering the shell and entering Monkey commands directly.
The basic syntax is:
- -$ adb shell monkey [options] <event-count>- -
With no options specified, the Monkey will launch in a quiet (non-verbose) mode, and will send -events to any (and all) packages installed on your target. Here is a more typical command line, -which will launch your application and send 500 pseudo-random events to it:
- -$ adb shell monkey -p your.package.name -v 500- - -
The table below lists all options you can include on the Monkey command line.
- -Category | -Option | -Description | -
---|---|---|
General | ---help |
-Prints a simple usage guide. | -
-v |
-Each -v on the command line will increment the verbosity level. -Level 0 (the default) provides little information beyond startup notification, test completion, and -final results. -Level 1 provides more details about the test as it runs, such as individual events being sent to -your activities. -Level 2 provides more detailed setup information such as activities selected or not selected for -testing. | -|
Events | --s <seed> |
-Seed value for pseudo-random number generator. If you re-run the Monkey with the same seed -value, it will generate the same sequence of events. | -
--throttle <milliseconds> |
-Inserts a fixed delay between events. You can use this option to slow down the Monkey. -If not specified, there is no delay and the events are generated as rapidly as possible. | -|
--pct-touch <percent> |
-Adjust percentage of touch events. -(Touch events are a down-up event in a single place on the screen.) | -|
--pct-motion <percent> |
-Adjust percentage of motion events. -(Motion events consist of a down event somewhere on the screen, a series of pseudo-random -movements, and an up event.) | -|
--pct-trackball <percent> |
-Adjust percentage of trackball events. -(Trackball events consist of one or more random movements, sometimes followed by a click.) | -|
--pct-nav <percent> |
-Adjust percentage of "basic" navigation events. -(Navigation events consist of up/down/left/right, as input from a directional input device.) | -|
--pct-majornav <percent> |
-Adjust percentage of "major" navigation events. -(These are navigation events that will typically cause actions within your UI, such as -the center button in a 5-way pad, the back key, or the menu key.) | -|
--pct-syskeys <percent> |
-Adjust percentage of "system" key events. -(These are keys that are generally reserved for use by the system, such as Home, Back, Start Call, -End Call, or Volume controls.) | -|
--pct-appswitch <percent> |
-Adjust percentage of activity launches. At random intervals, the Monkey will issue a startActivity() call, as a way of maximizing -coverage of all activities within your package. | -|
--pct-anyevent <percent> |
-Adjust percentage of other types of events. This is a catch-all for all other types of events such as keypresses, other less-used -buttons on the device, and so forth. | -|
Constraints | --p <allowed-package-name> |
-If you specify one or more packages this way, the Monkey will only allow the system -to visit activities within those packages. If your application requires access to activities in -other packages (e.g. to select a contact) you'll need to specify those packages as well. -If you don't specify any packages, the Monkey will allow the system to launch activities -in all packages. To specify multiple packages, use the -p option multiple times — one -p -option per package. | -
-c <main-category> |
-If you specify one or more categories this way, the Monkey will only allow the -system to visit activities that are listed with one of the specified categories. -If you don't specify any categories, the Monkey will select activities listed with the category -Intent.CATEGORY_LAUNCHER or Intent.CATEGORY_MONKEY. To specify multiple categories, use the -c -option multiple times — one -c option per category. | -|
Debugging | ---dbg-no-events |
-When specified, the Monkey will perform the initial launch into a test activity, but -will not generate any further events. -For best results, combine with -v, one or more package constraints, and a non-zero throttle to keep the Monkey -running for 30 seconds or more. This provides an environment in which you can monitor package -transitions invoked by your application. | -
--hprof |
-If set, this option will generate profiling reports immediately before and after -the Monkey event sequence. -This will generate large (~5Mb) files in data/misc, so use with care. See -Traceview for more information -on trace files. | -|
--ignore-crashes |
-Normally, the Monkey will stop when the application crashes or experiences any type of -unhandled exception. If you specify this option, the Monkey will continue to send events to -the system, until the count is completed. | -|
--ignore-timeouts |
-Normally, the Monkey will stop when the application experiences any type of timeout error such -as a "Application Not Responding" dialog. If you specify this option, the Monkey will continue to -send events to the system, until the count is completed. | -|
--ignore-security-exceptions |
-Normally, the Monkey will stop when the application experiences any type of permissions error, -for example if it attempts to launch an activity that requires certain permissions. If you specify -this option, the Monkey will continue to send events to the system, until the count is -completed. | -|
--kill-process-after-error |
-Normally, when the Monkey stops due to an error, the application that failed will be left -running. When this option is set, it will signal the system to stop the process in which the error -occurred. -Note, under a normal (successful) completion, the launched process(es) are not stopped, and -the device is simply left in the last state after the final event. | -|
--monitor-native-crashes |
-Watches for and reports crashes occurring in the Android system native code. If --kill-process-after-error is set, the system will stop. | -|
--wait-dbg |
-Stops the Monkey from executing until a debugger is attached to it. | -
- The monkeyrunner tool provides an API for writing programs that control an Android device - or emulator from outside of Android code. With monkeyrunner, you can write a Python program - that installs an Android application or test package, runs it, sends keystrokes to it, - takes screenshots of its user interface, and stores screenshots on the workstation. The - monkeyrunner tool is primarily designed to test applications and devices at the - functional/framework level and for running unit test suites, but you are free to use it for - other purposes. -
-
- The monkeyrunner tool is not related to the
- UI/Application Exerciser Monkey,
- also known as the monkey
tool. The monkey
tool runs in an
- adb
shell directly on the
- device or emulator and generates pseudo-random streams of user and system events. In comparison,
- the monkeyrunner tool controls devices and emulators from a workstation by sending specific
- commands and events from an API.
-
- The monkeyrunner tool provides these unique features for Android testing: -
-os
and
- subprocess
- modules to call Android tools such as
- Android Debug Bridge.
- - You can also add your own classes to the monkeyrunner API. This is described - in more detail in the section - Extending monkeyrunner with plugins. -
-- The monkeyrunner tool uses Jython, a - implementation of Python that uses the Java programming language. Jython allows the - monkeyrunner API to interact easily with the Android framework. With Jython you can - use Python syntax to access the constants, classes, and methods of the API. -
- -
- Here is a simple monkeyrunner program that connects to a device, creating a
- MonkeyDevice
- object. Using the MonkeyDevice
object, the program installs an Android application
- package, runs one of its activities, and sends key events to the activity.
- The program then takes a screenshot of the result, creating a
- MonkeyImage
object.
- From this object, the program writes out a .png
file containing the screenshot.
-
-# Imports the monkeyrunner modules used by this program -from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice - -# Connects to the current device, returning a MonkeyDevice object -device = MonkeyRunner.waitForConnection() - -# Installs the Android package. Notice that this method returns a boolean, so you can test -# to see if the installation worked. -device.installPackage('myproject/bin/MyApplication.apk') - -# sets a variable with the package's internal name -package = 'com.example.android.myapplication' - -# sets a variable with the name of an Activity in the package -activity = 'com.example.android.myapplication.MainActivity' - -# sets the name of the component to start -runComponent = package + '/' + activity - -# Runs the component -device.startActivity(component=runComponent) - -# Presses the Menu button -device.press('KEYCODE_MENU', MonkeyDevice.DOWN_AND_UP) - -# Takes a screenshot -result = device.takeSnapshot() - -# Writes the screenshot to a file -result.writeToFile('myproject/shot1.png','png') -- -
- The monkeyrunner API is contained in three modules in the package
- com.android.monkeyrunner
:
-
MonkeyRunner
:
- A class of utility methods for monkeyrunner programs. This class provides a method for
- connecting monkeyrunner to a device or emulator. It also provides methods for
- creating UIs for a monkeyrunner program and for displaying the built-in help.
- MonkeyDevice
:
- Represents a device or emulator. This class provides methods for installing and
- uninstalling packages, starting an Activity, and sending keyboard or touch events to an
- application. You also use this class to run test packages.
- MonkeyImage
:
- Represents a screen capture image. This class provides methods for capturing screens,
- converting bitmap images to various formats, comparing two MonkeyImage objects, and
- writing an image to a file.
-
- In a Python program, you access each class as a Python module. The monkeyrunner tool
- does not import these modules automatically. To import a module, use the
- Python from
statement:
-
-from com.android.monkeyrunner import <module> --
- where <module>
is the class name you want to import. You can import more
- than one module in the same from
statement by separating the module names with
- commas.
-
- You can either run monkeyrunner programs from a file, or enter monkeyrunner statements in
- an interactive session. You do both by invoking the monkeyrunner
command
- which is found in the tools/
subdirectory of your SDK directory.
- If you provide a filename as an argument, the monkeyrunner
command
- runs the file's contents as a Python program; otherwise, it starts an interactive session.
-
- The syntax of the monkeyrunner
command is
-
-monkeyrunner -plugin <plugin_jar> <program_filename> <program_options> --
-Table 1 explains the flags and arguments. -
- - -Argument | -Description | -
---|---|
- -plugin <plugin_jar>
- |
-
- (Optional) Specifies a .jar file containing a plugin for monkeyrunner.
- To learn more about monkeyrunner plugins, see
- Extending monkeyrunner with plugins. To specify more than one
- file, include the argument multiple times.
- |
-
- <program_filename>
- |
-
- If you provide this argument, the monkeyrunner command runs the contents
- of the file as a Python program. If the argument is not provided, the command starts an
- interactive session.
- |
-
- <program_options>
- |
- - (Optional) Flags and arguments for the program in <program_file>. - | -
- You can generate an API reference for monkeyrunner by running: -
--monkeyrunner help.py <format> <outfile> --
-The arguments are: -
-<format>
is either text
for plain text output
- or html
for HTML output.
- <outfile>
is a path-qualified name for the output file.
-
- You can extend the monkeyrunner API with classes you write in the Java programming language
- and build into one or more .jar
files. You can use this feature to extend the
- monkeyrunner API with your own classes or to extend the existing classes. You can also use this
- feature to initialize the monkeyrunner environment.
-
- To provide a plugin to monkeyrunner, invoke the monkeyrunner
command with the
- -plugin <plugin_jar>
argument described in
- table 1.
-
- In your plugin code, you can import and extend the the main monkeyrunner classes
- MonkeyDevice
, MonkeyImage
, and MonkeyRunner
in
- com.android.monkeyrunner
(see The monkeyrunner API).
-
- Note that plugins do not give you access to the Android SDK. You can't import packages
- such as com.android.app
. This is because monkeyrunner interacts with the
- device or emulator below the level of the framework APIs.
-
- The .jar
file for a plugin can specify a class that is instantiated before
- script processing starts. To specify this class, add the key
- MonkeyRunnerStartupRunner
to the .jar
file's
- manifest. The value should be the name of the class to run at startup. The following
- snippet shows how you would do this within an ant
build script:
-
-<jar jarfile="myplugin" basedir="${build.dir}"> -<manifest> -<attribute name="MonkeyRunnerStartupRunner" value="com.myapp.myplugin"/> -</manifest> -</jar> - - --
- To get access to monkeyrunner's runtime environment, the startup class can implement
- com.google.common.base.Predicate<PythonInterpreter>
. For example, this
- class sets up some variables in the default namespace:
-
-package com.android.example; - -import com.google.common.base.Predicate; -import org.python.util.PythonInterpreter; - -public class Main implements Predicate<PythonInterpreter> { - @Override - public boolean apply(PythonInterpreter anInterpreter) { - - /* - * Examples of creating and initializing variables in the monkeyrunner environment's - * namespace. During execution, the monkeyrunner program can refer to the variables "newtest" - * and "use_emulator" - * - */ - anInterpreter.set("newtest", "enabled"); - anInterpreter.set("use_emulator", 1); - - return true; - } -} -diff --git a/docs/html/tools/help/proguard.jd b/docs/html/tools/help/proguard.jd deleted file mode 100755 index b38aba67b214..000000000000 --- a/docs/html/tools/help/proguard.jd +++ /dev/null @@ -1,493 +0,0 @@ -page.title=Shrink Your Code and Resources -parent.title=Tools -parent.link=index.html -page.metaDescription=Make your APK file smaller and more secure by shrinking your code and resources. -@jd:body - -
To make your APK file as small as possible, you should enable shrinking for -your code and resources in your release build. This guide describes how to do -both and how to specify what to keep or discard during a build.
- -Code shrinking is available with ProGuard, which detects and removes unused -classes, fields, methods, and attributes from your packaged app, including -those from included code libraries (making it a valuable tool for working -around the 64k reference -limit). ProGuard also optimizes the bytecode, removes unused code -instructions, and obfuscates the remaining classes, fields, and methods with -short names. The obfuscated code makes your APK difficult to reverse engineer, -which is especially valuable when your app uses security-sensitive features, -such as licensing -verification.
- -Resource shrinking is available with the Android Plugin for Gradle, which -removes unused resources from your packaged app, including unused resources in -code libraries. It works in conjunction with code shrinking such that once -unused code has been removed, any resources no longer referenced can be safely -removed as well.
- - -Features in this document depend on:
-To enable code shrinking with ProGuard, add minifyEnabled true
-to the appropriate build type in your build.gradle
file.
Be aware that code shrinking slows down the build time, so you should avoid -using it on your debug build if possible. However, it's important that you -do enable code shrinking on your final APK used for testing, because it might -introduce bugs if you do not sufficiently customize which -code to keep.
- -For example, the following snippet from a build.gradle
file
-enables code shrinking for the release build:
-android { - buildTypes { - release { - minifyEnabled true - proguardFiles getDefaultProguardFile(‘proguard-android.txt'), - 'proguard-rules.pro' - } - } - ... -} -- -
Note: Android Studio disables ProGuard when -using Instant -Run.
- -In addition to the minifyEnabled
property, the
-proguardFiles
property defines the ProGuard rules:
getDefaultProguardFile(‘proguard-android.txt')
method gets
-the default ProGuard settings from the Android SDK tools/proguard/
-folder.
-Tip: For even more code shrinking, try the
-proguard-android-optimize.txt
file that's in the same location. It
-includes the same ProGuard rules, but with other optimizations that perform
-analysis at the bytecode level—inside and across methods—to reduce your APK
-size further and help it run faster.
proguard-rules.pro
file is where you can add custom
-ProGuard rules. By default, this file is located at the root of the module
-(next to the build.gradle
file).To add more ProGuard rules that are specific to each build variant, add
-another proguardFiles
property in the corresponding
-productFlavor
block. For example, the following Gradle file adds
-flavor2-rules.pro
to the flavor2
product flavor. Now
-flavor2
uses all three ProGuard rules because those from the
-release
block are also applied.
-android { - ... - buildTypes { - release { - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), - 'proguard-rules.pro' - } - } - productFlavors { - flavor1 { - } - flavor2 { - proguardFile 'flavor2-rules.pro' - } - } -} -- -
With each build, ProGuard outputs the following files:
-dump.txt
mapping.txt
seeds.txt
usage.txt
These files are saved at
-<module-name>/build/outputs/mapping/release/
.
For some situations, the default ProGuard configuration file
-(proguard-android.txt
) is sufficient and ProGuard removes all—and
-only—the unused code. However, many situations are difficult for ProGuard to
-analyze correctly and it might remove code your app actually needs. Some
-examples of when it might incorrectly remove code include:
AndroidManifest.xml
fileTesting your app should reveal any errors caused by inappropriately removed
-code, but you can also inspect what code was removed by reviewing the
-usage.txt
output file saved in
-<module-name>/build/outputs/mapping/release/
.
To fix errors and force ProGuard to keep certain code, add a -keep
line in the ProGuard configuration file. For example:
--keep public class MyClass -- -
Alternatively, you can add the @Keep
-annotation to the code you want to keep. Adding @Keep
on a class
-keeps the entire class as-is. Adding it on a method or field will keep the
-method/field (and it's name) as well as the class name intact. Note that this
-annotation is available only when using the Annotations Support
-Library.
There are many considerations you should make when using the
--keep
option; for more information about customizing your
-configuration file, read the
-ProGuard Manual. The
-Troubleshooting section outlines other common problems you might encounter
-when your code gets stripped away.
After ProGuard shrinks your code, reading a stack trace is difficult (if not
-impossible) because the method names are obfuscated. Fortunately, ProGuard
-creates a mapping.txt
file each time it runs, which shows the
-original class, method, and field names mapped to the obfuscated names.
-ProGuard saves the file in the app
-<module-name>/build/outputs/mapping/release/
directory.
Be aware that the mapping.txt
file is overwritten every time
-you create a release build with ProGuard, so you must carefully save a copy
-each time you publish a new release. By retaining a copy of the
-mapping.txt
file for each release build, you'll be able to debug a
-problem if a user submits an obfuscated stack trace from an older version of
-your app.
When publishing your app on Google Play, you can upload the
-mapping.txt
file for each version of your APK. Then Google Play
-will deobfuscate incoming stack traces from user-reported issues so you can
-review them in the Google Play Developer Console. For more information, see the
-Help Center article about how to deobfuscate
-crash stack traces.
To convert an obfuscated stack trace to a readable one yourself, use the
-retrace
script (retrace.bat
on Windows;
-retrace.sh
on Mac/Linux). It is located in the
-<sdk-root>/tools/proguard/
directory. The script takes the
-mapping.txt
file and your stack trace, producing a new, readable
-stack trace. The syntax for using the retrace tool is:
-retrace.bat|retrace.sh [-verbose] mapping.txt [<stacktrace_file>] -- -
For example:
- --retrace.bat -verbose mapping.txt obfuscated_trace.txt -- -
If you do not specify the stack trace file, the retrace tool reads from -standard input.
- -Resource shrinking works only in conjunction with code shrinking. After the -code shrinker removes all unused code, the resource shrinker can identify which -resources the app still uses. This is especially true when you add code -libraries that include resources—you must remove unused library code so the -library resources become unreferenced and, thus, removable by the resource -shrinker.
- -To enable resource shrinking, set the shrinkResources
property
-to true
in your build.gradle
file (alongside
-minifyEnabled
for code shrinking). For example:
-android { - ... - buildTypes { - release { - shrinkResources true - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), - 'proguard-rules.pro' - } - } -} -- -
If you haven't already built your app using minifyEnabled
for
-code shrinking, then try that before enabling shrinkResources
,
-because you might need to edit your proguard-rules.pro
file to
-keep classes or methods that are created or invoked dynamically before you
-start removing resources.
Note: The resource shrinker currently does not
-remove resources defined in a values/
folder (such as strings,
-dimensions, styles, and colors). This is because the Android Asset Packaging
-Tool (AAPT) does not allow the Gradle Plugin to specify predefined versions for
-resources. For details, see issue 70869.
If there are specific resources you wish to keep or discard, create an XML
-file in your project with a <resources>
tag and specify each
-resource to keep in the tools:keep
attribute and each resource to
-discard in the tools:discard
attribute. Both attributes accept a
-comma-separated list of resource names. You can use the asterisk character as a
-wild card.
For example:
- --<?xml version=1.0" encoding="utf-8"?> -<resources xmlns:tools="http://schemas.android.com/tools" - tools:keep="@layout/l_used*_c,@layout/l_used_a,@layout/l_used_b*" - tools:discard="@layout/unused2" /> -- -
Save this file in your project resources, for example, at
-res/raw/keep.xml
. The build does not package this file into your
-APK.
Specifying which resources to discard might seem silly when you could
-instead delete them, but this can be useful when using build variants. For
-example, you might put all your resources into the common project directory,
-then create a different keep.xml
file for each build variant when
-you know that a given resource appears to be used in code (and therefore not
-removed by the shrinker) but you know it actually won't be used for the given
-build variant.
Normally, the resource shrinker can accurately determine whether a resource -is used. However, if your code makes a call to {@link -android.content.res.Resources#getIdentifier(String,String,String) -Resources.getIdentifier()} (or if any of your libraries do that—the AppCompat -library does), that means your code is looking up resource names based on -dynamically-generated strings. When you do this, the resource shrinker behaves -defensively by default and marks all resources with a matching name format as -potentially used and unavailable for removal.
- -For example, the following code causes all resources with the
-img_
prefix to be marked as used.
-String name = String.format("img_%1d", angle + 1); -res = getResources().getIdentifier(name, "drawable", getPackageName()); -- -
The resource shrinker also looks through all the string constants in your
-code, as well as various res/raw/
resources, looking for resource
-URLs in a format similar to
-file:///android_res/drawable//ic_plus_anim_016.png
. If it finds
-strings like this or others that look like they could be used to construct URLs
-like this, it doesn't remove them.
These are examples of the safe shrinking mode that is enabled by default.
-You can, however, turn off this "better safe than sorry" handling, and specify
-that the resource shrinker keep only resources that it's certain are used. To
-do this, set shrinkMode
to strict
in the
-keep.xml
file, as follows:
-<?xml version="1.0" encoding="utf-8"?> -<resources xmlns:tools="http://schemas.android.com/tools" - tools:shrinkMode="strict" /> -- -
If you do enable strict shrinking mode and your code also references
-resources with dynamically-generated strings, as shown above, then you must
-manually keep those resources using the tools:keep
attribute.
The Gradle resource shrinker removes only resources that are not referenced
-by your app code, which means it will not remove
-alternative resources for different device configurations. If necessary,
-you can use the Android Gradle plugin's resConfigs
property to
-remove alternative resource files that your app does not need.
For example, if you are using a library that includes language resources
-(such as AppCompat or Google Play Services), then your APK includes all
-translated language strings for the messages in those libraries whether the
-rest of your app is translated to the same languages or not. If you'd like to
-keep only the languages that your app officially supports, you can specify
-those languages using the resConfig
property. Any resources for
-languages not specified are removed.
The following snippet shows how to limit your language resources to just -English and French:
- --android { - defaultConfig { - ... - resConfigs "en", "fr" - } -} -- -
To customize which screen density or ABI resources to include in your APK, -instead use APK -splits to build different APKs for different devices.
- -By default, Gradle also merges identically named resources, such as
-drawables with the same name that might be in different resource folders. This
-behavior is not controlled by the shrinkResources
property and
-cannot be disabled, because it is necessary to avoid errors when multiple
-resources match the name your code is looking up.
Resource merging occurs only when two or more files share an identical -resource name, type, and qualifier. Gradle selects which file it considers to -be the best choice among the duplicates (based on a priority order described -below) and passes only that one resource to the AAPT for distribution in the -APK file.
- -Gradle looks for duplicate resources in the following locations:
- -src/main/res/
.Gradle merges duplicate resources in the following cascading priority order:
- -Dependencies → Main → Build flavor → Build type
- -For example, if a duplicate resource appears in both your main resources and -a build flavor, Gradle selects the one in the build flavor.
- -If identical resources appear in the same source set, Gradle cannot merge
-them and emits a resource merge error. This can happen if you define multiple
-source sets in the sourceSet
property of your
-build.gradle
file—for example if both src/main/res/
-and src/main/res2/
contain identical resources.
When you shrink resources, the Gradle Console shows a summary of the -resources that it removed from the app package. For example:
- --:android:shrinkDebugResources -Removed unused resources: Binary resource data reduced from 2570KB to 1711KB: Removed 33% -:android:validateDebugSigning -- -
Gradle also creates a diagnostic file named resources.txt
in
-<module-name>/build/outputs/mapping/release/
(the same
-folder as ProGuard's output files). This file includes details such as which
-resources reference other resources and which resources are used or
-removed.
For example, to find out why @drawable/ic_plus_anim_016
is
-still in your APK, open the resources.txt
file and search for that
-file name. You might find that it's referenced from another resource, as
-follows:
-16:25:48.005 [QUIET] [system.out] @drawable/add_schedule_fab_icon_anim : reachable=true -16:25:48.009 [QUIET] [system.out] @drawable/ic_plus_anim_016 -- -
You now need to know why @drawable/add_schedule_fab_icon_anim
-is reachable—and if you search upwards you'll find that resource is listed
-under "The root reachable resources are:". This means there is a code reference
-to add_schedule_fab_icon_anim
(that is, its R.drawable ID was
-found in the reachable code).
If you are not using strict checking, resource IDs can be marked as reachable -if there are string constants that look like they might be used to construct -resource names for dynamically loaded resources. In that case, if you search -the build output for the resource name, you might find a message like this:
- --10:32:50.590 [QUIET] [system.out] Marking drawable:ic_plus_anim_016:2130837506 - used because it format-string matches string pool constant ic_plus_anim_%1$d. -- -
If you see one of these strings and you are certain that the string is not
-being used to load the given resource dynamically, you can use the
-tools:discard
attribute to inform the build system to remove it,
-as described in the section about how to customize which resources to keep.
- You can use the Android Studio File > Project Structure dialog box to - change configuration settings for your Android Studio project. This dialog - box is useful if you need to change some of the settings you chose when you - created the project. -
- -- The Project Structure dialog box contains the following sections: -
- -- The following two sections provide information on the Developer Services and Modules - sections. -
- -- The Developer Services section of the Project Structure - dialog box contains configuration pages - for several services that you can be use with your app. This section - contains the following pages: -
- -- Turning on any of these services may cause Android Studio to add necessary - dependencies and permissions to your app. Each configuration page lists these - and other actions that Android Studio takes if you enable the associated service. -
- -- The Modules settings section lets you change configuration - options for each of your project's modules. This section contains one page - for each module in your app. In many cases, the project has just a single - module, named app. However, if your project targets multiple form - factors, it might have several modules. For example, if your project contains - both a tablet app and a wearable app, it might have two modules, named - mobile and wear. For more information about project - modules, see Android Application - Modules. -
- -- Each module's settings page is divided into the following panes: -
- -The Android SDK Manager separates the SDK tools, platforms, and other components into packages -for easy access and management. You can also customize which sites the SDK Manager checks for new -or updated SDK packages and add-on tools. For example, you can configure the SDK Manager -to automatically check for updates and notify you when updates are available. -When you receive such a notification, you can then quickly decide whether to download the changes.
- -To enable automatic update checking:
-You can launch the SDK Manager in one of the following ways:
-The SDK Manager appears.
- - - -Tip: The standalone SDK Manager is still available from the -command line, but we recommend it for use with standalone SDK installations only.
- -Click the checkbox next to -each additional SDK platform and tool that you want to install. Clear the -checkbox to uninstall an SDK platform or tool. Click Apply or OK -to update the packages and tools.
- -Tip: When an update is available for an installed -package, a hyphen (-) appears in the checkbox next to the package. A download icon -() -also appears next -to the checkbox to indicate the pending update. An update icon -() appears next to the checkbox to -indicate pending removals.
- -Click the SDK Update Sites tab to manage which SDK sites Android Studio checks for -tool and add-on updates.
- - - -There are several different packages available for the Android SDK. The following section describes -most of the available packages and where they're located in your SDK directory -after you download them.
- - - -Here's an outline of the packages required and those we recommend you use: -
- -Tip: For easy access to the SDK tools from a command line, add the
-location of the SDK tools/
and
-platform-tools
to your PATH
environment variable.
The previous list is not comprehensive and you can add new sites to download additional packages from third parties.
- -In some cases, an SDK package may require a specific minimum revision of -another package or SDK tool. The SDK Manager automatically notifies you of any -dependencies and downloads the required packages or tools. -In addition, development tools notify you if there are dependencies that you need to -address.
- - - -The SDK Update Sites tab displays the sites that Android Studio checks for Android SDK -and third-party updates. You can add other sites that host their own Android SDK add-ons, and then -download the SDK add-ons from those sites.
- -For example, a mobile carrier or device manufacturer might offer additional -API libraries that are supported by their own Android-powered devices. -To develop using their libraries, you must install their Android SDK add-on, if it's not already -available as a third-party add-on.
- -If a carrier or device manufacturer has hosted an SDK add-on repository file -on their website, follow these steps to add their site to the Android SDK Manager:
- -Any SDK packages available from the site appear in the SDK Platforms or -SDK Tools tabs.
-The Android Debug Bridge (adb) provides a Unix shell
-that you can use to run a variety of commands on an emulator or connected device. The command
-binaries are stored in the file system of the emulator or device, at /system/bin/...
-
You can use the shell
command to issue commands, with or without entering
-the adb remote shell on the emulator/device. To issue a single command without entering a
-remote shell, use the shell
command like this:
adb [-d|-e|-s <serialNumber>] shell <shell_command>- -
Or enter a remote shell on an emulator/device like this:
- -adb [-d|-e|-s <serialNumber>] shell- -
When you are ready to exit the remote shell, press CTRL+D or type
-exit
.
Within an adb shell, you can issue commands with the activity manager ({@code am}) tool to -perform various system actions, such as start an activity, force-stop a process, -broadcast an intent, modify the device screen properties, and more. While in a shell, -the syntax is:
--am <command> -- -
You can also issue an activity manager command directly from adb -without entering a remote shell. For example:
--adb shell am start -a android.intent.action.VIEW -- - - -
Command | -Description | -
---|---|
-start [options] <INTENT>
- |
-Start an {@link android.app.Activity} specified by {@code <INTENT>}. See the -Specification for <INTENT> arguments. - Options are: -
|
-
-startservice [options] <INTENT>
- |
-Start the {@link android.app.Service} specified by {@code <INTENT>}. See the -Specification for <INTENT> arguments. - Options are: -
|
-
-force-stop <PACKAGE>
- |
-Force stop everything associated with {@code <PACKAGE>} (the app's package name). - | -
-kill [options] <PACKAGE>
- |
- Kill all processes associated with {@code <PACKAGE>}
- (the app's package name). This command kills only
- processes that are safe to kill and that will not impact the user
- experience.
- Options are: -
|
-
-kill-all
- |
-Kill all background processes. - | -
-broadcast [options] <INTENT>
- |
-Issue a broadcast intent. See the -Specification for <INTENT> arguments. - Options are: -
|
-
-instrument [options] <COMPONENT>
- |
-Start monitoring with an {@link android.app.Instrumentation} instance.
- Typically the target {@code <COMPONENT>}
- is the form {@code <TEST_PACKAGE>/<RUNNER_CLASS>}. Options are: -
|
-
-profile start <PROCESS> <FILE>
- |
-Start profiler on {@code <PROCESS>}, write results to {@code <FILE>}. - | -
-profile stop <PROCESS>
- |
-Stop profiler on {@code <PROCESS>}. - | -
-dumpheap [options] <PROCESS> <FILE>
- |
-Dump the heap of {@code <PROCESS>}, write to {@code <FILE>}. Options are: -
|
-
-set-debug-app [options] <PACKAGE>
- |
-Set application {@code <PACKAGE>} to debug. Options are: -
|
-
-clear-debug-app
- |
-Clear the package previous set for debugging with {@code set-debug-app}. - | -
-monitor [options]
- |
-Start monitoring for crashes or ANRs. Options are: -
|
-
-screen-compat [on|off] <PACKAGE>
- |
-Control screen -compatibility mode of {@code <PACKAGE>}. - | -
-display-size [reset|<WxH>]
- |
-Override emulator/device display size.
-This command is helpful for testing your app across different screen sizes by mimicking a small
-screen resolution using a device with a large screen, and vice versa.
- Example: |
-
-display-density <dpi>
- |
-Override emulator/device display density.
-This command is helpful for testing your app across different screen densities on high-density
-screen environment using a low density screen, and vice versa.
- Example: |
-
-to-uri <INTENT>
- |
-Print the given intent specification as a URI. See the -Specification for <INTENT> arguments. - |
-
-to-intent-uri <INTENT>
- |
-Print the given intent specification as an {@code intent:} URI. See the -Specification for <INTENT> arguments. - |
-
Within an adb shell, you can issue commands with the package manager ({@code pm}) tool to -perform actions and queries on application packages installed on the device. While in a shell, -the syntax is:
--pm <command> -- -
You can also issue a package manager command directly from adb -without entering a remote shell. For example:
--adb shell pm uninstall com.example.MyApp -- - -
Command | -Description | -
---|---|
-list packages [options] <FILTER>
- |
-Prints all packages, optionally only
- those whose package name contains the text in {@code <FILTER>}. Options: -
|
-
-list permission-groups
- |
-Prints all known permission groups. - | -
-list permissions [options] <GROUP>
- |
-Prints all known permissions, optionally only
- those in {@code <GROUP>}. Options: -
|
-
-list instrumentation
- |
-List all test packages. Options: -
|
-
-list features
- |
-Prints all features of the system. - | -
-list libraries
- |
-Prints all the libraries supported by the current device. - | -
-list users
- |
-Prints all users on the system. - | -
-path <PACKAGE>
- |
-Print the path to the APK of the given {@code <PACKAGE>}. - | -
-install [options] <PATH>
- |
-Installs a package (specified by {@code <PATH>}) to the system. Options: -
|
-
-uninstall [options] <PACKAGE>
- |
-Removes a package from the system. Options: -
|
-
-clear <PACKAGE>
- |
-Deletes all data associated with a package. - | -
-enable <PACKAGE_OR_COMPONENT>
- |
-Enable the given package or component (written as "package/class"). - | -
-disable <PACKAGE_OR_COMPONENT>
- |
-Disable the given package or component (written as "package/class"). - | -
-disable-user [options] <PACKAGE_OR_COMPONENT>
- |
-Options: -
|
-
-grant <PACKAGE_NAME> <PERMISSION>
- |
-Grant a permission to an app. On devices running Android 6.0 (API level 23) -and higher, may be any permission declared in the app manifest. On devices -running Android 5.1 (API level 22) and lower, must be an optional permission defined by the -app. - | -
-revoke <PACKAGE_NAME> <PERMISSION>
- |
-Revoke a permission from an app. On devices running Android 6.0 (API level -23) and higher, may be any permission declared in the app manifest. On devices -running Android 5.1 (API level 22) and lower, must be an optional permission defined by the -app. - | -
-set-install-location <LOCATION>
- |
-Changes the default install location. Location values:
-
Note: This is only intended for debugging; using this can cause - applications to break and other undesireable behavior. - |
-
-get-install-location
- |
-Returns the current install location. Return values:
-
|
-
-set-permission-enforced <PERMISSION> [true|false]
- |
-Specifies whether the given permission should be enforced. - | -
-trim-caches <DESIRED_FREE_SPACE>
- |
-Trim cache files to reach the given free space. - | -
-create-user <USER_NAME>
- |
-Create a new user with the given {@code <USER_NAME>}, - printing the new user identifier of the user. - | -
-remove-user <USER_ID>
- |
-Remove the user with the given {@code <USER_IDENTIFIER>}, - deleting all data associated with that user - | -
-get-max-users
- |
-Prints the maximum number of users supported by the device. - | -
The {@code screencap} command is a shell utility for taking a screenshot of a device display. -While in a shell, the syntax is: -
- --screencap <filename> -- - -
To use the {@code screencap} from the command line, type the following: - -
-$ adb shell screencap /sdcard/screen.png -- -
Here's an example screenshot session, using the adb shell to capture the screenshot and the -{@code pull} command to download the file from the device:
- -
-$ adb shell -shell@ $ screencap /sdcard/screen.png -shell@ $ exit -$ adb pull /sdcard/screen.png -- - -
The {@code screenrecord} command is a shell utility for recording the display of devices - running Android 4.4 (API level 19) and higher. The utility records screen activity to an MPEG-4 - file.
- -Note: Audio is not recorded with the video file.
- -A developer can use this file to create promotional or training videos. While in a shell, the syntax is:
- --screenrecord [options] <filename> -- -
To use {@code screenrecord} from the command line, type the following: - -
-$ adb shell screenrecord /sdcard/demo.mp4 -- -
Stop the screen recording by pressing Ctrl-C, otherwise the recording stops automatically -at three minutes or the time limit set by {@code --time-limit}.
- -To begin recording your device screen, run the {@code screenrecord} command to record -the video. Then, run the {@code pull} command to download the video from the device to the host -computer. Here's an example recording session:
- -
-$ adb shell -shell@ $ screenrecord --verbose /sdcard/demo.mp4 -(press Ctrl-C to stop) -shell@ $ exit -$ adb pull /sdcard/demo.mp4 -- -
The {@code screenrecord} utility can record at any supported resolution and bit rate you - request, while retaining the aspect ratio of the device display. The utility records at the native - display resolution and orientation by default, with a maximum length of three minutes.
- -There are some known limitations of the {@code screenrecord} utility that you should be aware - of when using it:
- -Options | -Description | -
---|---|
--help
- |
- Displays command syntax and options | -
- --size <WIDTHxHEIGHT>
- |
- Sets the video size: {@code 1280x720}. The default value is the device's native - display resolution (if supported), 1280x720 if not. For best results, use a size supported - by your device's Advanced Video Coding (AVC) encoder. | -
--bit-rate <RATE> |
- Sets the video bit rate for the video, in megabits per second. The default value is 4Mbps.
- You can increase the bit rate to improve video quality, but doing so results in larger movie
- files. The following example sets the recording bit rate to 6Mbps:
- screenrecord --bit-rate 6000000 /sdcard/demo.mp4- |
-
--time-limit <TIME> |
- Sets the maximum recording time, in seconds. The default and maximum value is 180 - (3 minutes). | -
--rotate |
- Rotates the output 90 degrees. This feature is experimental. | -
--verbose |
- Displays log information on the command-line screen. If you do not set this option, - the utility does not display any information while running. | -
For a list of all the available shell programs, use the following command:
- -adb shell ls /system/bin- -
Help is available for most of the commands.
- -Table 5 lists some of the more common adb shell commands.
- - -Shell Command | -Description | -Comments | -
---|---|---|
dumpsys |
-Dumps system data to the screen. | -The Dalvik Debug Monitor Server -(DDMS) tool offers an integrated debug environment that you may find easier to use. - | -
dumpstate |
-Dumps state to a file. | -|
logcat [option]... [filter-spec]... |
-Enables system and app logging and prints output to the screen. | -|
dmesg |
-Prints kernel debugging messages to the screen. | -|
start |
-Starts (restarts) an emulator/device instance. | -- |
stop |
-Stops execution of an emulator/device instance. | -- |
From a remote shell to your device or from your host machine, you can use the sqlite3 command-line program to manage SQLite databases
- created by Android applications. The sqlite3
tool includes many useful commands,
- such as .dump
to print out the contents of a table and .schema
to print
- the SQL CREATE statement for an existing table. The tool also gives you the ability to execute
- SQLite commands on the fly.
To use sqlite3
from a remote shell:
adb [-d|-e|-s {<serialNumber>}] shell-
sqlite3
tool by entering the following command:
- sqlite3- -
You can also optionally specify a full path to a database that you want to explore.
- Emulator/device instances store SQLite3 databases in the directory
- /data/data/<package_name>/databases/
.
sqlite3
, you can issue sqlite3
commands in the
- shell. To exit and return to the adb remote shell, enter exit
or press
- CTRL+D
.Here's an example:
-$ adb -s emulator-5554 shell -# sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db -SQLite version 3.3.12 -Enter ".help" for instructions -.... enter commands, then quit... -# sqlite> .exit -- -
To use sqlite3
locally, instead of within a shell,
- pull the database file from the device and start {@code sqlite3}:
-adb pull <database-file-on-device> --
/tools
directory, specifying the database
- file:
- -sqlite3 <database-file-on-host> --
The Systrace tool helps analyze the performance of your application by capturing and - displaying execution times of your applications processes and other Android system processes. The - tool combines data from the Android kernel such as the CPU scheduler, disk activity, and - application threads to generate an HTML report that shows an overall picture of an Android - device’s system processes for a given period of time.
- -The Systrace tool is particularly useful in diagnosing display problems where an - application is slow to draw or stutters while displaying motion or animation. For more information - on how to use Systrace, see Analyzing - UI Performance with Systrace.
- -In order to run Systrace, you must have Android SDK Tools 20 or later installed. You must also -have Python installed and included in your development -computer's execution path. In order to generate a trace, you must connect a device running Android -4.1 (API Level 16) or higher to your development system using a -USB debugging connection.
- -The Systrace tool can be run either from one of the Android SDK's graphical user interface -tools, or from the command line. The following sections describe how to run the tool using either -of these methods.
- - -The Systrace tool can be run from -Android Studio -or the Android Device Monitor. - -
To run the Systrace capture user interface:
- -The Systrace tool has different command line options for devices running Android 4.3 (API -level 18) and higher versus devices running Android 4.2 (API level 17) and lower. The following -sections describe the different command line options for each version.
- -The general syntax for running Systrace from the command line is as follows.
- --$ python systrace.py [options] [category1] [category2] ... [categoryN] -- -
See the sections below for example Systrace sessions.
- - -When you use Systrace on devices running Android 4.3 and higher, you can omit trace category tags -to get the defaults, or you may manually specify tags for inclusion. Here is an example execution -run that sets trace tags and generates a trace from a connected device.
- --$ cd android-sdk/platform-tools/systrace -$ python systrace.py --time=10 -o mynewtrace.html sched gfx view wm -- -
- Tip: If you want to see the names of tasks in the trace output, you must - include the {@code sched} category in your command parameters. -
- -The table below lists the Systrace command line options for devices running Android 4.3 -(API level 18) and higher.
- -Option | - -Description | -
---|---|
-h, --help |
-
- Show the help message. | -
-o <FILE> |
-
- Write the HTML trace report to the specified file. | -
-t N, --time=N |
-
- Trace activity for N seconds. The default value is 5 seconds. | -
-b N, --buf-size=N |
-
- Use a trace buffer size of N kilobytes. This option lets you limit the total size - of the data collected during a trace. | -
-k <KFUNCS> |
-
- Trace the activity of specific kernel functions, specified in a comma-separated list. | -
-l, --list-categories |
-
- List the available tracing category tags. The available tags are:
-
-
Note: Some trace categories are not supported on all - devices. - -Tip: If you want to see the names of tasks in the trace - output, you must include the {@code sched} category in your command parameters. - - |
-
-a <APP_NAME> |
-
- Enable tracing for applications, specified as a comma-separated list of - package names. - The apps must contain tracing instrumentation calls from the {@link android.os.Trace} class. - For more information, see Analyzing - UI Performance with Systrace. - | -
--from-file=<FROM_FILE> |
-
- Create the interactive Systrace report from a file, instead of running a live trace. | -
- -e <DEVICE_SERIAL> |
-
- Conduct the trace on a specific connected device, identified by its - device serial number. | -
Using Systrace on the command line with devices running Android 4.2 and lower is typically a -two-step process. You must first set the trace tags you want to capture and then run the trace. -Here is an example execution run that sets trace tags and generates a trace from a connected -device.
- --$ cd android-sdk/platform-tools/systrace -$ python systrace.py --set-tags gfx,view,wm -$ adb shell stop -$ adb shell start -$ python systrace.py --disk --time=10 -o mynewtrace.html -- -
The table below lists the Systrace command line options for devices running Android 4.2 -(API level 17) and lower.
- -Option | - -Description | -
---|---|
-h, --help |
-
- Show the help message. | -
-o <FILE> |
-
- Write the HTML trace report to the specified file. | -
-t N, --time=N |
-
- Trace activity for N seconds. The default value is 5 seconds. | -
-b N, --buf-size=N |
-
- Use a trace buffer size of N kilobytes. This option lets you limit the total size - of the data collected during a trace. | -
-d, --disk |
-
- Trace disk input and output activity. This option requires root access on the device. | -
-f, --cpu-freq |
-
- Trace CPU frequency changes. Only changes to the CPU frequency are logged, so the initial - frequency of the CPU when tracing starts is not shown. | -
-i, --cpu-idle |
-
- Trace CPU idle events. | -
-l, --cpu-load |
-
- Trace CPU load. This value is a percentage determined by the interactive CPU frequency - governor. | -
-s, --no-cpu-sched |
-
- Prevent tracing of the CPU scheduler. This option allows for longer trace times by reducing - the rate of data flowing into the trace buffer. | -
-u, --bus-utilization |
-
- Trace the bus utilization levels. This option requires root access on the device. | -
-w, --workqueue |
-
- Trace kernel work queues. This option requires root access on the device. | -
--set-tags=<TAGS> |
-
- Set the enabled trace tags in a comma separated list. The available tags are:
-
Note: When setting trace tags from the command line, you - must stop and restart the framework ({@code $ adb shell stop; adb shell start}) for the - tag tracing changes to take effect. - |
-
You can set the trace tags for Systrace on -your Android 4.2 and lower device by navigating to Settings > Developer options > -Monitoring > Enable traces.
- - -The table below lists the keyboard shortcuts that are available while viewing a Systrace -trace HTML report.
- -Key | - -Description | -
---|---|
w | - -Zoom into the trace timeline. | -
s | - -Zoom out of the trace timeline. | -
a | - -Pan left on the trace timeline. | -
d | - -Pan right on the trace timeline. | -
e | - -Center the trace timeline on the current mouse location. | -
g | - -Show grid at the start of the currently selected task. | -
Shift+g | - -Show grid at the end of the currently selected task. | -
Right Arrow | - -Select the next event on the currently selected timeline. | -
Left Arrow | - -Select the previous event on the currently selected timeline. | -
-The Theme Editor is a visual assistant that helps you: -
--This page introduces the fundamental tasks that you can perform with the Theme -Editor, and explains how to do so. -
- - --This section describes how to access the Theme Editor, and how it is laid out. -
- -There are two ways to open the Theme Editor:
- --The Theme Editor's main screen is divided into two sections. The left side of the editor -shows what specific UI elements, such as the app bar or a raised button, look like -when you apply the current theme to them. The right side of the editor displays -the settings for the color resources, such as Theme parent and -colorPrimary, that comprise the current theme. You can modify design -themes by changing these resource settings. -
- --The Theme Editor allows you to create new themes, modify existing ones, and manage the -colors that make up the themes. -
- --To create a theme, follow these steps: -
--To rename a theme, perform the following steps: -
-To change an existing color resource, such as colorPrimary, -follow these steps: -
-You can also directly select colors from the material palette, which the editor displays -as two rows of colored squares beneath the color picker.
- --The Theme Editor allows you to preview - -colors associated with different states. To do so, open the Resource dialog, and click -the State List tab that appears at the top of the dialog.
- --To more fully control the states themselves, you can directly view and edit their -properties in the XML file, -such as {@code colors.xml}, that defines them. For more information, see the -documentation for the {@link android.content.res.ColorStateList} class. -
- --You can choose - -device-specific configurations for your app to support. Perform -the following steps to do so: -
- -For more information about the relationship -between directory names and configurations, see - -Supporting Multiple Screens. For more information about -supported directory names, see - -Providing Resources. -
- - diff --git a/docs/html/tools/help/thumbnails/am-androidmon2.png b/docs/html/tools/help/thumbnails/am-androidmon2.png deleted file mode 100644 index a4a757193b09b445054dc74d015e377d2fa47f49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 151641 zcmcG02Ut_vwl0c_4cHbyqy$7oks{KhB?2m70UNzUx^(F+Bq|C@3n;yc2uKY@I-!X4 z5~PI=0s%~b5JG^2guKPx`<`=dIrr}S-g$l>-%93a{}^-4wPwZ`({~SaG}(`yJ<7tu z!mh1#^AQURn;;9z{+YvvfRVi8{T3`N$GPk^G#+ScXb3%UceS;5vSDG-dKVkd_T)nc zciZBX-18X+&Iw)ExTuACq(SU&x~;YU^+^q(FC$%_UODodIL&2t;-QRYB^ze7kkmo3kS0bYMq~E$wryGH- z4!Zg7RW_v1*U~$h-<04jPb373XP4KmbNC4Zj}Y(r-=@ZXJJta!))*$4z=zSyVLs!< zIcz%dy}K*1w%_>K3M?F_YAHMf>erADD~I=5Y@ut2&h=4(r4hDh??V;xj;Kr#?*2_{ z%4tMx9lFL`KBTZ`jIi|f&0qq+WK=+@>>@CB$X}JlHaTi2ODZF1PPQzPOq1(ZXsM(nK6VD-;DX7BDGtD zp=5%Mow3iR{2?U(n&2PMo`-yfA{uu6Q6tRTMyW*J34^G$@jxxkQCV(ptu;OE1}FnQ z6wor2slT{$2mrC;HQmee&4kZVIFZx4T?yWWshMV?tC^3BG!HvE!y=ZaPzJ6=@u~Kc zqvK})f1U&Yy2OWRO#<)X41zh6uZVW1i$zzJp(?TC{@7>J=4P%i_ajwdRqHZCg4C#y zhHg&UuK65(zQ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