diff --git a/dev/devicelab/bin/tasks/flutter_gallery_instrumentation_test.dart b/dev/devicelab/bin/tasks/flutter_gallery_instrumentation_test.dart index 4ae7cfa499..81670e6a94 100644 --- a/dev/devicelab/bin/tasks/flutter_gallery_instrumentation_test.dart +++ b/dev/devicelab/bin/tasks/flutter_gallery_instrumentation_test.dart @@ -16,9 +16,15 @@ Future main() async { final Directory galleryDirectory = dir('${flutterDirectory.path}/examples/flutter_gallery'); await inDirectory(galleryDirectory, () async { + final Device device = await devices.workingDevice; + await device.unlock(); await flutter('packages', options: ['get']); - await flutter('build', options: ['clean']); // to reset the Dart entry point - await exec('tool/run_instrumentation_test.sh', []); + await flutter('build', options: ['clean']); + await flutter('build', options: ['apk', '--target', 'test/live_smoketest.dart']); + final String androidStudioPath = grep('Android Studio at', from: await evalFlutter('doctor')).first.split(' ').last; + await exec('./tool/run_instrumentation_test.sh', [], environment: { + 'JAVA_HOME': '$androidStudioPath/jre', + }); }); return new TaskResult.success(null);