Commit 484c36f1 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Set the android:debuggable flag when building an APK in debug mode (#4523)

See https://github.com/flutter/flutter/issues/4438
parent b2938f40
...@@ -104,7 +104,7 @@ class _ApkBuilder { ...@@ -104,7 +104,7 @@ class _ApkBuilder {
runCheckedSync(packageArgs); runCheckedSync(packageArgs);
} }
void package(File outputApk, File androidManifest, Directory assets, Directory artifacts, Directory resources) { void package(File outputApk, File androidManifest, Directory assets, Directory artifacts, Directory resources, BuildMode buildMode) {
List<String> packageArgs = <String>[_aapt.path, List<String> packageArgs = <String>[_aapt.path,
'package', 'package',
'-M', androidManifest.path, '-M', androidManifest.path,
...@@ -112,6 +112,8 @@ class _ApkBuilder { ...@@ -112,6 +112,8 @@ class _ApkBuilder {
'-I', _androidJar.path, '-I', _androidJar.path,
'-F', outputApk.path, '-F', outputApk.path,
]; ];
if (buildMode == BuildMode.debug)
packageArgs.add('--debug-mode');
if (resources != null) if (resources != null)
packageArgs.addAll(<String>['-S', resources.absolute.path]); packageArgs.addAll(<String>['-S', resources.absolute.path]);
packageArgs.add(artifacts.path); packageArgs.add(artifacts.path);
...@@ -333,7 +335,7 @@ int _buildApk( ...@@ -333,7 +335,7 @@ int _buildApk(
File unalignedApk = new File('${tempDir.path}/app.apk.unaligned'); File unalignedApk = new File('${tempDir.path}/app.apk.unaligned');
builder.package( builder.package(
unalignedApk, components.manifest, assetBuilder.directory, unalignedApk, components.manifest, assetBuilder.directory,
artifactBuilder.directory, components.resources artifactBuilder.directory, components.resources, buildMode
); );
int signResult = _signApk(builder, components, unalignedApk, keystore); int signResult = _signApk(builder, components, unalignedApk, keystore);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment