Add a --debug-mode option to aapt.
When passed (with no needed parameters) to the aapt command line,
aapt will insert debuggable=true in the application node of the manifest
automatically.
This is to be used by the SDK tools to make true "debug" builds
that require no code/file change.
Change-Id: I909759caef499a91d10cc9a0902c6448c87e75ef
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index cafd635..b00e276 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -678,6 +678,13 @@
bundle->getMaxSdkVersion());
}
+ if (bundle->getDebugMode()) {
+ sp<XMLNode> application = root->getChildElement(String16(), String16("application"));
+ if (application != NULL) {
+ addTagAttribute(application, RESOURCES_ANDROID_NAMESPACE, "debuggable", "true");
+ }
+ }
+
// Deal with manifest package name overrides
const char* manifestPackageNameOverride = bundle->getManifestPackageNameOverride();
if (manifestPackageNameOverride != NULL) {