Class AdbResult
java.lang.Object
com.pnfsoftware.jeb.core.units.code.android.adb.AdbResult
Represent a result from the command
adb.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Retrieve the command output bytes.Retrieve the command output as a string.booleanDetermine whether the command completed successfully.booleanDetermine whether the command completed successfully.booleanUnified method to validate that an adb command was executed correctly
-
Field Details
-
ADB_ERROR
Marker appended by shell commands to signal an ADB execution error.- See Also:
-
-
Constructor Details
-
AdbResult
public AdbResult(byte[] output) Create an ADB result.- Parameters:
output- command output bytes
-
-
Method Details
-
getOutput
public byte[] getOutput()Retrieve the command output bytes.- Returns:
- output bytes, or null
-
getOutputString
Retrieve the command output as a string.- Returns:
- decoded output string
-
isSuccess
public boolean isSuccess()Determine whether the command completed successfully.- Returns:
- true on success
-
isSuccess
Determine whether the command completed successfully.- Parameters:
expectOuput- expected output presence, or null to ignore- Returns:
- true on success
-
isSuccess
public boolean isSuccess(Boolean expectOuput, boolean verifyGenericErrors, String... knownErrorMessages) Unified method to validate that an adb command was executed correctly- Parameters:
expectOuput- Indicate if there is an expected output stream result. Set null to bypass, true to check that there is an output message, false to check that there is not.verifyGenericErrors- Indicate if we should verify some common error messages.knownErrorMessages- Specific known error messages raised by this command.- Returns:
- true on success, false on error
-