Example #1
0
 public void DisconnectPhone(string Serial)
 {
     StartServer();
     if (DevicesConnected.ContainsKey(Serial))
     {
         AdbClient.Disconnect(DevicesConnected[Serial]);
         DevicesConnected.Remove(Serial);
     }
     else
     {
         var dns = DeviceInfo.CreateDnsEndPoint(Serial);
         AdbClient.Disconnect(dns);
         // Remove the dns from the list
         var item = DevicesConnected.Where(x => x.Value.Host == dns.Host).FirstOrDefault();
         if (item.Key != null)
         {
             DevicesConnected.Remove(item.Key);
         }
     }
 }
Example #2
0
 /// <summary>
 /// Disconnect a device that was connected over a wireless connection
 /// </summary>
 /// <param name="ipAddressDevice"> The ip address of the device </param>
 public static void DisconnectWirelessClient(String ipAddressDevice)
 {
     try
     {
         Client.Disconnect(new DnsEndPoint(ipAddressDevice, 5555));
     }
     catch (Exception)
     {
         Console.WriteLine("Client could not be disconnected ... continuing");
     }
 }
Example #3
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     try
     {
         if (devices.Count > 0)
         {
             foreach (var item in devices)
             {
                 if (item.Serial.Contains(":5555"))
                 {
                     adbClient.Disconnect(new DnsEndPoint(item.Serial.Replace(":5555", ""), 5555));
                 }
             }
         }
     }
     catch (Exception)
     {
         return;
     }
 }