anchor.diff:          return new Future.error(
               '${header.first.substring(header.first.indexOf(' ') + 1)}: $body');
         } else {
  -        httpRequest = _getLaunchRequest(appContainer.project.name);
  -        return device.sendHttpRequest(httpRequest, 2424).timeout(
  -            new Duration(minutes: 5), onTimeout: () {
  -              canceled = true;
  -              return new Future.error(
  -                  'Push timed out: Total time exceeds 5 minutes');
  -            });
  -
  -      }
  -    }).then((_) {
  -      return device.sendHttpRequest(httpRequest, 2424).timeout(
  -          new Duration(minutes: 5), onTimeout: () {
  -            return new Future.error(
  -                'Push timed out: Total time exceeds 5 minutes');
  -          });
  -    }).catchError((_) {
  -      canceled = true;
  +        return body;
  +      }
       }).whenComplete(() {
  -      device.dispose();
  +      if (_device != null) _device.dispose();
       });
     }
   }
  -
  -class _DeployTarget {
  -  AndroidDevice device;
  -  TcpClient client;
  -
  -  Future sendRequest(List<int> httpRequest, [String target]) {
  -    if (device != null) {
  -      return device.sendHttpRequest(httpRequest, 2424).timeout(
  -          new Duration(minutes: 5), onTimeout: () {
  -            return new Future.error(
  -                'Push timed out: Total time exceeds 5 minutes');
  -          });
  -    } else {
  -        client.write(httpRequest);
  -        return client.stream.timeout(new Duration(minutes: 1)).first;
  -    }
  -  }
  -}
  
positive.code: 
    Future _pushViaUSB(ProgressMonitor monitor) {
      List<int> httpRequest;
      AndroidDevice device;
      bool canceled = false;
  
      // Get the device
      return _fetchAndroidDevice().then((deviceResult) {
        device = deviceResult;
      }).then((_) {
        // Build the archive.
        return archiveContainer(appContainer, true);
      }).then((List<int> archivedData) {
        // Send the request for pushing the archive
        monitor.worked(3);
        httpRequest = _buildHttpRequest('localhost', archivedData);
        monitor.worked(4);
  
        // Send this payload to the USB code.
        if (canceled) return null;
        return device.sendHttpRequest(httpRequest, 2424).timeout(
            new Duration(minutes: 5), onTimeout: () {
              return new Future.error(
                  'Push timed out: Total time exceeds 5 minutes');
            });
      }).then((msg) {
        if (canceled) return null;
        monitor.worked(3);
        String resp = new String.fromCharCodes(msg);
        List<String> lines = resp.split('\r\n');
  
negative.code: 
        if (lines.first.contains('200')) {
          monitor.worked(2);
          return true;
        } else {
          return new Future.error(lines.first);
        }
      }).then((_) => _closeClient())
      .catchError((error) => _closeClient().then((_) => throw error));
    }
  
    // Safe to call multiple times. It will open the device if it has not been opened yet.
  