# Class: com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapperFactory

A factory for ADB controllers. This object is also used to issue general \(device independent\) adb commands, such as `adb start-server`, `adb devices`, etc. Most methods in this class return null on error. 

 If an adb server exists, it is used as\-is. If one needs to be created, it will be spawned the first time a real adb command is issued \(the client can explicitly request it using [#initialize()](#initialize())\). Default listening settings are used, that is: `tcp:localhost:5037`. 

 Thread\-safe.

## Constructor: AdbWrapperFactory

Description: Create a wrapper with a [standard execution timeout](#STANDARD_TIMEOUT). The constructor will do its best to determine the path to the ADB program.
throws: if ADB cannot be located

## Constructor: AdbWrapperFactory
- parameter: `path`, type: `java.lang.String`

Description: Create a wrapper with a [standard execution timeout](#STANDARD_TIMEOUT).
parameter: path: ADB path, set to null for auto\-determination
throws: if ADB cannot be located

## Constructor: AdbWrapperFactory
- parameter: `path`, type: `java.lang.String`
- parameter: `defaultTimeout`, type: `long`

Description: Create a wrapper.
parameter: path: ADB path, set to null for auto\-determination
parameter: defaultTimeout: default command execution timeout in milliseconds \(0 means infinite\);            do not use negative values
throws: if ADB cannot be located

## Static Field: STANDARD_TIMEOUT
Type: `long`

Constant value: `5000`
Description: Standard command execution timeout is 5 seconds.

## Method: createWrapper
- parameter: `deviceSerial`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`

Description: Create an ADB wrapper to issue command to a specific device, using a default timeout.
parameter: deviceSerial: optional device serial
return: ADB wrapper

## Method: createWrapper
- parameter: `deviceSerial`, type: `java.lang.String`
- parameter: `standardTimeout`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`

Description: Create an ADB wrapper to issue command to a specific device.
parameter: deviceSerial: optional device serial
parameter: standardTimeout: default command execution timeout in milliseconds
return: ADB wrapper

## Method: findDevice
- return type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbDevice`

Description: Find the first available real device or first available emulator.
return: 

## Method: getDefaultTimeout
- return type: `long`

Description: Retrieve the default command timeout.
return: timeout in milliseconds; 0 means infinite

## Method: getPath
- return type: `java.lang.String`

Description: Get the path to the ADB binary wrapped by this object.
return: ADB binary path

## Method: getVersion
- return type: `java.lang.String`

Description: Retrieve the ADB version string.
return: version string, or null on error

## Method: initialize
- return type: `boolean`

Description: Initialize the factory and start the ADB server if needed.
return: true if the factory was initialized

## Method: listDevices
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.adb.AdbDevice>`

Description: List devices known to ADB.
return: device list, or null on error

## Method: setDefaultTimeout
- parameter: `millis`, type: `long`

Description: Set the default command timeout.
parameter: millis: timeout in milliseconds; 0 means infinite

## Method: startServer
- return type: `boolean`

Description: Start the ADB server \(on the local machine\).
return: true on success

## Method: stopServer

Description: Stop the ADB server.

## Method: toString
- return type: `java.lang.String`


## Static Method: createStandardWrapper
- return type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`

Description: Create a standard ADB wrapper using an auto\-detected ADB path.
return: ADB wrapper
throws: if ADB cannot be located

