anchor.diff:      });
     }
   
  +  Future _pushToAdbServer(AdbClientTcp client, ProgressMonitor monitor) {
  +    // Start ADT on the device.
  +    //return client.startActivity(AdbApplication.CHROME_ADT);
  +
  +    // TODO: a SocketException, code == -100 here often means that the App Dev
  +    // Tool is not running on the device.
  +    // Setup port forwarding to DEPLOY_PORT on the device.
  +    return client.forwardTcp(DEPLOY_PORT, DEPLOY_PORT).then((_) {
  +      // Push the app binary on DEPLOY_PORT.
  +      ADBDeployer dep = new ADBDeployer(appContainer, _prefs);
  +      return dep.deploy(monitor);
  +    });
  +  }
  +
  +  Future _pushViaUSB(ProgressMonitor monitor) {
  +    USBDeployer dep = new USBDeployer(appContainer, _prefs);
  +    return dep.init().then((_) {
  +      return dep.deploy(monitor);
  +    });
  +  }
  +}
  +
  +abstract class AbstractDeployer {
  +  static const int DEPLOY_PORT = 2424;
  +
  +  final Container appContainer;
  +  final PreferenceStore _prefs;
  +
  +  List<DeviceInfo> _knownDevices = [];
  +
  +  AbstractDeployer(this.appContainer, this._prefs) {
  +    if (appContainer == null) {
  +      throw new ArgumentError('must provide an app to push');
  +    }
  +
  +    final List permissions = chrome.runtime.getManifest()['permissions'];
  +
  +    for (final p in permissions) {
  +      if (p is Map && (p as Map).containsKey('usbDevices')) {
  +        final List usbDevices = (p as Map)['usbDevices'];
  +        for (final Map<String, dynamic> d in usbDevices) {
  +          _knownDevices.add(
  +              new DeviceInfo(d['vendorId'], d['productId'], d['description']));
  +        }
  +      }
  +    }
  +  }
  +
     /**
      * Builds a request to given `target` at given `path` and with given `payload`
      * (body content).
  
positive.code:     TcpClient client;
      return TcpClient.createClient(_target, DEPLOY_PORT).then((TcpClient client) {
        client.write(httpRequest);
        Stream st = client.stream.timeout(new Duration(minutes: 1));
        var broadcastStream = st.asBroadcastStream();
        return broadcastStream.first.then((List<int> l1) {
          return broadcastStream.first.then((List<int> l2) {
            List<int> l3 = new List<int>();
            l3.addAll(l1);
            l3.addAll(l2);
            return l3;
          });
        });
  
      }).whenComplete(() {
        if (client != null) {
          client.dispose();
  
negative.code:     }
    }
  
    ///when the deployment is done this function is called to ensure
    ///that the used resources are disposed
    void _doWhenComplete();
  
    ///Defines the deployement flow
    Future deploy(ProgressMonitor monitor) {
      List<int> httpRequest;
  
  