flutter start crashes when port 8181 is in use

Catch the error and log a warning.

Fixes #1050
This commit is contained in:
Adam Barth
2016-01-07 09:56:44 -08:00
parent 06b566bdea
commit 3615827f0e

View File

@@ -772,7 +772,11 @@ class AndroidDevice extends Device {
void _forwardObservatoryPort() {
// Set up port forwarding for observatory.
String portString = 'tcp:$_observatoryPort';
runCheckedSync(adbCommandForDevice(['forward', portString, portString]));
try {
runCheckedSync(adbCommandForDevice(['forward', portString, portString]));
} catch (e) {
logging.warning('Unable to forward observatory port ($_observatoryPort):\n$e');
}
}
bool startBundle(AndroidApk apk, String bundlePath, {