delay looking for android devices
This commit is contained in:
@@ -14,15 +14,17 @@ import 'device.dart';
|
||||
class InstallCommand extends Command {
|
||||
final name = 'install';
|
||||
final description = 'Install your Flutter app on attached devices.';
|
||||
|
||||
AndroidDevice android = null;
|
||||
InstallCommand([this.android]) {
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
}
|
||||
|
||||
InstallCommand([this.android]);
|
||||
|
||||
@override
|
||||
Future<int> run() async {
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
|
||||
if (install()) {
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
@@ -34,14 +34,14 @@ class ListenCommand extends Command {
|
||||
defaultsTo: '.',
|
||||
abbr: 't',
|
||||
help: 'Target app path or filename to start.');
|
||||
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<int> run() async {
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
|
||||
if (argResults.rest.length > 0) {
|
||||
watchCommand = _initWatchCommand(argResults.rest);
|
||||
} else {
|
||||
|
||||
@@ -21,13 +21,14 @@ class LogsCommand extends Command {
|
||||
argParser.addFlag('clear',
|
||||
negatable: false,
|
||||
help: 'Clear log history before reading from logs (Android only).');
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<int> run() async {
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
|
||||
Future<int> androidLogProcess = null;
|
||||
if (android.isConnected()) {
|
||||
androidLogProcess = android.logs(clear: argResults['clear']);
|
||||
|
||||
@@ -33,13 +33,14 @@ class StartCommand extends Command {
|
||||
defaultsTo: '.',
|
||||
abbr: 't',
|
||||
help: 'Target app path or filename to start.');
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<int> run() async {
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
|
||||
bool startedSomewhere = false;
|
||||
bool poke = argResults['poke'];
|
||||
if (!poke) {
|
||||
|
||||
@@ -18,14 +18,14 @@ class StopCommand extends Command {
|
||||
final description = 'Stop your Flutter app on all attached devices.';
|
||||
AndroidDevice android = null;
|
||||
|
||||
StopCommand([this.android]) {
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
}
|
||||
StopCommand([this.android]);
|
||||
|
||||
@override
|
||||
Future<int> run() async {
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
|
||||
if (stop()) {
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
@@ -27,13 +27,14 @@ class TraceCommand extends Command {
|
||||
argParser.addFlag('stop', negatable: false, help: 'Stop tracing.');
|
||||
argParser.addOption('duration',
|
||||
defaultsTo: '10', abbr: 'd', help: 'Duration in seconds to trace.');
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<int> run() async {
|
||||
if (android == null) {
|
||||
android = new AndroidDevice();
|
||||
}
|
||||
|
||||
if (!android.isConnected()) {
|
||||
_logging.warning('No device connected, so no trace was completed.');
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user