Class ADB


  • public class ADB
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ADB()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.net.Socket connect()  
      static java.net.Socket connect​(java.lang.String host, int port)  
      static byte[] exec​(java.lang.String cmd)  
      static byte[] exec​(java.lang.String cmd, java.io.OutputStream outputStream, java.io.InputStream inputStream)  
      static java.util.List<java.lang.String> getFeatures()  
      static boolean isServerRunning​(java.lang.String host, int port)  
      static java.net.Socket listenForDeviceState​(ADB.DeviceStateListener listener, java.lang.String host, int port)  
      static java.util.List<java.lang.String> listForward​(java.lang.String host, int port)  
      static boolean removeForward​(java.lang.String host, int port, java.lang.String serial, java.lang.String localPort)  
      static boolean startServer​(java.lang.String adbPath, int port)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ADB

        public ADB()
    • Method Detail

      • exec

        public static byte[] exec​(java.lang.String cmd,
                                  java.io.OutputStream outputStream,
                                  java.io.InputStream inputStream)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • exec

        public static byte[] exec​(java.lang.String cmd)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • connect

        public static java.net.Socket connect()
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • connect

        public static java.net.Socket connect​(java.lang.String host,
                                              int port)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • getFeatures

        public static java.util.List<java.lang.String> getFeatures()
                                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • startServer

        public static boolean startServer​(java.lang.String adbPath,
                                          int port)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • isServerRunning

        public static boolean isServerRunning​(java.lang.String host,
                                              int port)
      • listenForDeviceState

        public static java.net.Socket listenForDeviceState​(ADB.DeviceStateListener listener,
                                                           java.lang.String host,
                                                           int port)
                                                    throws java.io.IOException
        Returns:
        a socket connected to adb server, otherwise null
        Throws:
        java.io.IOException
      • listForward

        public static java.util.List<java.lang.String> listForward​(java.lang.String host,
                                                                   int port)
                                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • removeForward

        public static boolean removeForward​(java.lang.String host,
                                            int port,
                                            java.lang.String serial,
                                            java.lang.String localPort)
                                     throws java.io.IOException
        Throws:
        java.io.IOException