diff --git a/FLUTTER_VERSION b/FLUTTER_VERSION
index e22ddd0..d77ee0a 100644
--- a/FLUTTER_VERSION
+++ b/FLUTTER_VERSION
@@ -1 +1 @@
-a194e59390838dafd659a0a1a45f546d1a997b0f
+9bb9dc0b282deed3022e9c42c49425e51ae2cd05
diff --git a/mdtest/dart-packages/mdtest_tools/lib/src/mobile/android.dart b/mdtest/dart-packages/mdtest_tools/lib/src/mobile/android.dart
index f1e39da..eb03785 100644
--- a/mdtest/dart-packages/mdtest_tools/lib/src/mobile/android.dart
+++ b/mdtest/dart-packages/mdtest_tools/lib/src/mobile/android.dart
@@ -68,14 +68,12 @@
 
   if (!isLocked) return 0;
 
-  Process wakeUpAndUnlockProcess = await Process.start(
+  ProcessResult wakeUpAndUnlockProcessResult = Process.runSync(
     'adb',
     ['-s', '${device.id}', 'shell', 'input', 'keyevent', 'KEYCODE_MENU']
   );
-  wakeUpAndUnlockProcess.stdout.drain();
-  wakeUpAndUnlockProcess.stderr.drain();
 
-  return await wakeUpAndUnlockProcess.exitCode;
+  return wakeUpAndUnlockProcessResult.exitCode;
 }
 
 // Uninstall an Android app
diff --git a/mdtest/examples/chat/mdtest/chat.spec b/mdtest/examples/chat/mdtest/chat.spec
index ba0fd1e..10440d0 100644
--- a/mdtest/examples/chat/mdtest/chat.spec
+++ b/mdtest/examples/chat/mdtest/chat.spec
@@ -1,10 +1,10 @@
 {
   "devices": {
-    "Bot1": {
+    "Alice": {
       "app-root": "..",
       "app-path": "test_driver/chat_alice.dart"
     },
-    "Bot2": {
+    "Bob": {
       "app-root": "..",
       "app-path": "test_driver/chat_bob.dart"
     }
diff --git a/mdtest/examples/chat/mdtest/chat_test.dart b/mdtest/examples/chat/mdtest/chat_test.dart
index 4b9e0c6..ff39d93 100644
--- a/mdtest/examples/chat/mdtest/chat_test.dart
+++ b/mdtest/examples/chat/mdtest/chat_test.dart
@@ -40,129 +40,129 @@
     });
 
     test('Greeting', () async {
-      FlutterDriver bot1 = await driverMap['Bot1'];
-      FlutterDriver bot2 = await driverMap['Bot2'];
-      String textToSend = 'Hi, my name is Steve.  It\'s nice to meet you.';
+      FlutterDriver alice = await driverMap['Alice'];
+      FlutterDriver bob = await driverMap['Bob'];
+      String textToSend = 'Hi, my name is Alice.  It\'s nice to meet you.';
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot1.setInputText(find.byValueKey(inputKey), textToSend);
+      await alice.setInputText(find.byValueKey(inputKey), textToSend);
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot1.tap(find.byValueKey(buttonKey));
+      await alice.tap(find.byValueKey(buttonKey));
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      String textBot1 = await bot1.getText(find.text(textToSend));
-      print('Bot 1: $textBot1');
-      String textBot2 = await bot2.getText(find.text(textToSend));
-      print('Bot 2: $textBot2');
-      expect(textBot1, equals(textBot2));
+      String textAlice = await alice.getText(find.text(textToSend));
+      print('Alice: $textAlice');
+      String textBob = await bob.getText(find.text(textToSend));
+      print('Bob: $textBob');
+      expect(textAlice, equals(textBob));
 
-      textToSend = 'I\'m Jack. It\'s a pleasure to meet you, Steve.';
-      await bot2.setInputText(find.byValueKey(inputKey), textToSend);
+      textToSend = 'I\'m Bob. It\'s a pleasure to meet you, Alice.';
+      await bob.setInputText(find.byValueKey(inputKey), textToSend);
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot2.tap(find.byValueKey(buttonKey));
+      await bob.tap(find.byValueKey(buttonKey));
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      textBot1 = await bot1.getText(find.text(textToSend));
-      print('Bot 1: $textBot1');
-      textBot2 = await bot2.getText(find.text(textToSend));
-      print('Bot 2: $textBot2');
-      expect(textBot1, equals(textBot2));
+      textAlice = await alice.getText(find.text(textToSend));
+      print('Alice: $textAlice');
+      textBob = await bob.getText(find.text(textToSend));
+      print('Bob: $textBob');
+      expect(textAlice, equals(textBob));
 
-      textToSend = 'What do you do for a living Jack?';
+      textToSend = 'What do you do for a living Bob?';
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot1.setInputText(find.byValueKey(inputKey), textToSend);
+      await alice.setInputText(find.byValueKey(inputKey), textToSend);
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot1.tap(find.byValueKey(buttonKey));
+      await alice.tap(find.byValueKey(buttonKey));
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      textBot1 = await bot1.getText(find.text(textToSend));
-      print('Bot 1: $textBot1');
-      textBot2 = await bot2.getText(find.text(textToSend));
-      print('Bot 2: $textBot2');
-      expect(textBot1, equals(textBot2));
+      textAlice = await alice.getText(find.text(textToSend));
+      print('Alice: $textAlice');
+      textBob = await bob.getText(find.text(textToSend));
+      print('Bob: $textBob');
+      expect(textAlice, equals(textBob));
 
       textToSend = 'I work at the bank.';
-      await bot2.setInputText(find.byValueKey(inputKey), textToSend);
+      await bob.setInputText(find.byValueKey(inputKey), textToSend);
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot2.tap(find.byValueKey(buttonKey));
+      await bob.tap(find.byValueKey(buttonKey));
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      textBot1 = await bot1.getText(find.text(textToSend));
-      print('Bot 1: $textBot1');
-      textBot2 = await bot2.getText(find.text(textToSend));
-      print('Bot 2: $textBot2');
-      expect(textBot1, equals(textBot2));
+      textAlice = await alice.getText(find.text(textToSend));
+      print('Alice: $textAlice');
+      textBob = await bob.getText(find.text(textToSend));
+      print('Bob: $textBob');
+      expect(textAlice, equals(textBob));
     }, timeout: new Timeout(new Duration(seconds: 60)));
 
     test('Joking', () async {
-      FlutterDriver bot1 = await driverMap['Bot1'];
-      FlutterDriver bot2 = await driverMap['Bot2'];
+      FlutterDriver alice = await driverMap['Alice'];
+      FlutterDriver bob = await driverMap['Bob'];
       String textToSend = 'Name some countries?';
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot2.setInputText(find.byValueKey(inputKey), textToSend);
+      await bob.setInputText(find.byValueKey(inputKey), textToSend);
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot2.tap(find.byValueKey(buttonKey));
+      await bob.tap(find.byValueKey(buttonKey));
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      String textBot1 = await bot1.getText(find.text(textToSend));
-      print('Bot 1: $textBot1');
-      String textBot2 = await bot2.getText(find.text(textToSend));
-      print('Bot 2: $textBot2');
-      expect(textBot1, equals(textBot2));
+      String textAlice = await alice.getText(find.text(textToSend));
+      print('Alice: $textAlice');
+      String textBob = await bob.getText(find.text(textToSend));
+      print('Bob: $textBob');
+      expect(textAlice, equals(textBob));
 
       textToSend = 'US.';
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot1.setInputText(find.byValueKey(inputKey), textToSend);
+      await alice.setInputText(find.byValueKey(inputKey), textToSend);
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot1.tap(find.byValueKey(buttonKey));
+      await alice.tap(find.byValueKey(buttonKey));
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      textBot1 = await bot1.getText(find.text(textToSend));
-      print('Bot 1: $textBot1');
-      textBot2 = await bot2.getText(find.text(textToSend));
-      print('Bot 2: $textBot2');
-      expect(textBot1, equals(textBot2));
+      textAlice = await alice.getText(find.text(textToSend));
+      print('Alice: $textAlice');
+      textBob = await bob.getText(find.text(textToSend));
+      print('Bob: $textBob');
+      expect(textAlice, equals(textBob));
 
       textToSend = 'That is it?';
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot2.setInputText(find.byValueKey(inputKey), textToSend);
+      await bob.setInputText(find.byValueKey(inputKey), textToSend);
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot2.tap(find.byValueKey(buttonKey));
+      await bob.tap(find.byValueKey(buttonKey));
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      textBot1 = await bot1.getText(find.text(textToSend));
-      print('Bot 1: $textBot1');
-      textBot2 = await bot2.getText(find.text(textToSend));
-      print('Bot 2: $textBot2');
-      expect(textBot1, equals(textBot2));
+      textAlice = await alice.getText(find.text(textToSend));
+      print('Alice: $textAlice');
+      textBob = await bob.getText(find.text(textToSend));
+      print('Bob: $textBob');
+      expect(textAlice, equals(textBob));
 
       textToSend = 'Yes.';
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot1.setInputText(find.byValueKey(inputKey), textToSend);
+      await alice.setInputText(find.byValueKey(inputKey), textToSend);
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot1.tap(find.byValueKey(buttonKey));
+      await alice.tap(find.byValueKey(buttonKey));
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      textBot1 = await bot1.getText(find.text(textToSend));
-      print('Bot 1: $textBot1');
-      textBot2 = await bot2.getText(find.text(textToSend));
-      print('Bot 2: $textBot2');
-      expect(textBot1, equals(textBot2));
+      textAlice = await alice.getText(find.text(textToSend));
+      print('Alice: $textAlice');
+      textBob = await bob.getText(find.text(textToSend));
+      print('Bob: $textBob');
+      expect(textAlice, equals(textBob));
 
       textToSend = 'Aren\'t UK, India, Singapore, Europe countries?';
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot2.setInputText(find.byValueKey(inputKey), textToSend);
+      await bob.setInputText(find.byValueKey(inputKey), textToSend);
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot2.tap(find.byValueKey(buttonKey));
+      await bob.tap(find.byValueKey(buttonKey));
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      textBot1 = await bot1.getText(find.text(textToSend));
-      print('Bot 1: $textBot1');
-      textBot2 = await bot2.getText(find.text(textToSend));
-      print('Bot 2: $textBot2');
-      expect(textBot1, equals(textBot2));
+      textAlice = await alice.getText(find.text(textToSend));
+      print('Alice: $textAlice');
+      textBob = await bob.getText(find.text(textToSend));
+      print('Bob: $textBob');
+      expect(textAlice, equals(textBob));
 
       textToSend = 'Nope, they are not countries, they are Foreign countries...';
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot1.setInputText(find.byValueKey(inputKey), textToSend);
+      await alice.setInputText(find.byValueKey(inputKey), textToSend);
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      await bot1.tap(find.byValueKey(buttonKey));
+      await alice.tap(find.byValueKey(buttonKey));
       await new Future<Null>.delayed(new Duration(milliseconds: waitingTime));
-      textBot1 = await bot1.getText(find.text(textToSend));
-      print('Bot 1: $textBot1');
-      textBot2 = await bot2.getText(find.text(textToSend));
-      print('Bot 2: $textBot2');
-      expect(textBot1, equals(textBot2));
+      textAlice = await alice.getText(find.text(textToSend));
+      print('Alice: $textAlice');
+      textBob = await bob.getText(find.text(textToSend));
+      print('Bob: $textBob');
+      expect(textAlice, equals(textBob));
     }, timeout: new Timeout(new Duration(seconds: 60)));
   });
 }
