Build and run a profileable app manually
Stay organized with collections
Save and categorize content based on your preferences.
To build a profileable application manually, you
need to first build a release application and then update its manifest file,
which turns the release application into a profileable application. After you
configure the profileable application, launch the profiler and select a
profileable process to analyze.
Build a release app
To build a release application for profiling purposes, do the following:
-
Sign your application with the debug key by adding the following lines to your application's
build.gradle
file. If you already have a working release build variant, you can
skip to the next step.
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
-
In Android Studio, select Build > Select Build Variant... and choose the
release variant.
Change release to profileable
To convert your release app to a profileable app, do the
following:
-
Open the
AndroidManifest.xml
file and adding the following within
<application>
. For more details, see
Build your app for release.
<profileable android:shell="true"/>
-
Depending on the SDK version, you might see an error related to manifest
validation; if you can't resolve them and deem it safe to treat the errors
as warnings, you can do so by adding the following lines to your
build.gradle
file.
aaptOptions {
additionalParameters =["--warn-manifest-validation"]
}
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-08-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-29 UTC."],[],[],null,["# Build and run a profileable app manually\n\nTo build a [profileable](/studio/profile#requirements) application manually, you\nneed to first build a release application and then update its manifest file,\nwhich turns the release application into a profileable application. After you\nconfigure the profileable application, launch the profiler and select a\nprofileable process to analyze.\n\nBuild a release app\n-------------------\n\nTo build a release application for profiling purposes, do the following:\n\n\u003cbr /\u003e\n\n1. Sign your application with the debug key by adding the following lines to your application's\n `build.gradle` file. If you already have a working release build variant, you can\n skip to the next step.\n\n buildTypes {\n release {\n signingConfig signingConfigs.debug\n }\n }\n \n2. In Android Studio, select **Build** \\\u003e **Select Build Variant...** and choose the\n release variant.\n\n\u003cbr /\u003e\n\nChange release to profileable\n-----------------------------\n\nTo convert your [release app](#build-release-app) to a profileable app, do the\nfollowing:\n\n1. Open the\n `AndroidManifest.xml` file and adding the following within\n `\u003capplication\u003e`. For more details, see\n [Build your app for release](/studio/publish/preparing#publishing-build).\n\n `\u003cprofileable android:shell=\"true\"/\u003e`\n2. Depending on the SDK version, you might see an error related to manifest\n validation; if you can't resolve them and deem it safe to treat the errors\n as warnings, you can do so by adding the following lines to your\n `build.gradle` file.\n\n aaptOptions {\n additionalParameters =[\"--warn-manifest-validation\"]\n }"]]