| java.lang.Object | |
| ↳ | 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()). Default listening settings are used, that is:
tcp:localhost:5037.
Thread-safe.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| long | STANDARD_TIMEOUT | Standard command execution timeout is 5 seconds. | |||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
AdbWrapperFactory()
Create a wrapper with a
standard execution timeout. | |||||||||||
|
AdbWrapperFactory(String path)
Create a wrapper with a
standard execution timeout. | |||||||||||
|
AdbWrapperFactory(String path, long defaultTimeout)
Create a wrapper.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| synchronized static AdbWrapper | createStandardWrapper() | ||||||||||
| synchronized AdbWrapper |
createWrapper(String deviceSerial, long standardTimeout)
Create an ADB wrapper to issue command to a specific device.
| ||||||||||
| synchronized AdbWrapper |
createWrapper(String deviceSerial)
Create an ADB wrapper to issue command to a specific device, using a default timeout.
| ||||||||||
| synchronized long | getDefaultTimeout() | ||||||||||
| String |
getPath()
Get the path to the ADB binary wrapped by this object.
| ||||||||||
| synchronized String |
getVersion()
Retrieve the ADB version string.
| ||||||||||
| synchronized boolean | initialize() | ||||||||||
| synchronized List<AdbDevice> | listDevices() | ||||||||||
| synchronized void | setDefaultTimeout(long millis) | ||||||||||
| synchronized boolean |
startServer()
Start the ADB server (on the local machine).
| ||||||||||
| synchronized void |
stopServer()
Stop the ADB server.
| ||||||||||
| synchronized String | toString() | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Standard command execution timeout is 5 seconds.
Create a wrapper with a standard execution timeout. The constructor
will do its best to determine the path to the ADB program.
| IOException |
|---|
Create a wrapper with a standard execution timeout.
| path | ADB path, set to null for auto-determination |
|---|
| IOException |
|---|
Create a wrapper.
| path | ADB path, set to null for auto-determination |
|---|---|
| defaultTimeout | default command execution timeout in milliseconds (0 means infinite); do not use negative values |
| IOException |
|---|
Create an ADB wrapper to issue command to a specific device.
Create an ADB wrapper to issue command to a specific device, using a default timeout.
| deviceSerial | optional device serial |
|---|
Get the path to the ADB binary wrapped by this object.
Retrieve the ADB version string.
Start the ADB server (on the local machine).
Stop the ADB server.