-
public class AdbConnection.Builder
-
-
Constructor Summary
Constructors Constructor Description AdbConnection.Builder()AdbConnection.Builder(String host, int port)
-
Method Summary
Modifier and Type Method Description AdbConnection.BuildersetHost(String host)Set host address. AdbConnection.BuildersetPort(int port)Set port number. AdbConnection.BuildersetDeviceName(String deviceName)Set a name for the device. AdbConnection.BuildersetApi(int api)Set Android API (i.e. AdbConnection.BuildersetPrivateKey(PrivateKey privateKey)Set generated/stored private key. AdbConnection.BuildersetCertificate(Certificate certificate)Set public key wrapped around a certificate AdbConnectionbuild()Creates a new AdbConnection associated with the socket and crypto object specified. AdbConnectionconnect()Same as connect without throwing anything if the first authenticationattempt fails. AdbConnectionconnect(long timeout, @NonNull() TimeUnit unit, boolean throwOnUnauthorised)Connects to the remote device. -
-
Constructor Detail
-
AdbConnection.Builder
AdbConnection.Builder()
-
AdbConnection.Builder
AdbConnection.Builder(String host, int port)
-
-
Method Detail
-
setHost
AdbConnection.Builder setHost(String host)
Set host address. Default is 127.0.0.1
-
setPort
AdbConnection.Builder setPort(int port)
Set port number. Default is 5555.
-
setDeviceName
AdbConnection.Builder setDeviceName(String deviceName)
Set a name for the device. Default is “Unknown Device”.
- Parameters:
deviceName- Name of the device, could be the app label, hostname or user@hostname.
-
setApi
AdbConnection.Builder setApi(int api)
Set Android API (i.e. SDK) version for this connection. If the ADB daemon and the client are located in thesame device, the value should be SDK_INT in order to improve performance as well assecurity.
- Parameters:
api- The API version, default is BASE.
-
setPrivateKey
AdbConnection.Builder setPrivateKey(PrivateKey privateKey)
Set generated/stored private key.
-
setCertificate
AdbConnection.Builder setCertificate(Certificate certificate)
Set public key wrapped around a certificate
-
build
AdbConnection build()
Creates a new AdbConnection associated with the socket and crypto object specified.
-
connect
AdbConnection connect()
Same as connect without throwing anything if the first authenticationattempt fails.
-
connect
AdbConnection connect(long timeout, @NonNull() TimeUnit unit, boolean throwOnUnauthorised)
Connects to the remote device. This routine will block until the connection completes or the timeout elapses.
- Parameters:
timeout- the time to wait for the lockunit- the time unit of the timeout argumentthrowOnUnauthorised- Whether to throw an AdbAuthenticationFailedException if the peer rejects out first authentication attempt
-
-
-
-