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

Useful routines when debugging Android devices.

## Constructor: AndroidDeviceUtil


## Static Method: executeCommandAsRoot
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- parameter: `command`, type: `java.lang.String`
- return type: `boolean`

Description: Attempt to execute a single ADB command as root, with a prior root verification.

## Static Method: executeCommandAsRoot
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- parameter: `rootVerification`, type: `boolean`
- parameter: `command`, type: `java.lang.String`
- return type: `boolean`

Description: Attempt to execute a single ADB command as root.

## Static Method: executeCommandsAsRoot
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- parameter: `commands`, type: `java.lang.String[]`
- return type: `boolean`

Description: Attempt to execute a sequence of ADB commands as root, with a prior root verification.

## Static Method: executeCommandsAsRoot
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- parameter: `rootVerification`, type: `boolean`
- parameter: `commands`, type: `java.lang.String[]`
- return type: `boolean`

Description: Attempt to execute a sequence of ADB commands as root.

## Static Method: getAndroidApiLevel
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- return type: `int`

Description: Retrieve the numerical API level \(eg, 29 on Android Q\) of the target.
parameter: adb: 
return: 0 on error

## Static Method: getBestABIForApp
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- parameter: `apk`, type: `com.pnfsoftware.jeb.core.units.code.android.IApkUnit`
- return type: `com.pnfsoftware.jeb.core.units.code.android.adb.AndroidPlatformABI`

Description: Get the best ABI to run a given Android app on a given device. This method is a heuristic and may fail.
parameter: adb: 
parameter: apk: 
return: the ABI that should be selected when running the app; null on error if if no         compatible ABI was found

## Static Method: getPreferredABI
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- return type: `com.pnfsoftware.jeb.core.units.code.android.adb.AndroidPlatformABI`

Description: Get the preferred ABI supported by a device.
parameter: adb: 
return: an ABI, null on error

## Static Method: getProcessesByName
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- parameter: `processName`, type: `java.lang.String`
- return type: `java.util.List<java.lang.Integer>`

Description: Get a list of PIDs by process name
parameter: adb: 
parameter: processName: 
return: 

## Static Method: getSupportedABIs
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.android.adb.AndroidPlatformABI>`

Description: Get the ABIs supported by a device.
parameter: adb: 
return: a list of ABIs, never null, but empty on error

## Static Method: isDebuggableApp
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- parameter: `pname`, type: `java.lang.String`
- return type: `boolean`

Description: Determine whether an installed app is debuggable. An app is debuggable if its manifest has the 'debuggable' attribute explicitly set to true.
parameter: adb: 
parameter: pname: application package name
return: 

## Static Method: isRootDevice
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- return type: `boolean`

Description: Heuristic to determine if the device appears to be rooted \- and has a copy of `su` installed.
parameter: adb: 
return: 

## Static Method: pullFile
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- parameter: `remotePath`, type: `java.lang.String`
- parameter: `localPath`, type: `java.lang.String`
- return type: `boolean`

Description: Attempt to pull a file from a device using a variety of methods. Ultimately, if the device is rooted, this method may resort to using super\-user capabilities to download the file.
parameter: adb: 
parameter: remotePath: file path on device
parameter: localPath: local destination path
return: true on success

## Static Method: uploadFileToDeviceTemp
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- parameter: `name`, type: `java.lang.String`
- parameter: `platformAbi`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AndroidPlatformABI`
- return type: `java.lang.String`

Description: Upload a JEB Android asset file to an Android device.
parameter: adb: 
parameter: name: 
parameter: platformAbi: 
return: 
throws: 

## Static Method: uploadFileToDeviceTemp
- parameter: `adb`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AdbWrapper`
- parameter: `name`, type: `java.lang.String`
- parameter: `platformAbi`, type: `com.pnfsoftware.jeb.core.units.code.android.adb.AndroidPlatformABI`
- parameter: `version`, type: `java.lang.String`
- parameter: `extension`, type: `java.lang.String`
- return type: `java.lang.String`

Description: Upload a JEB Android asset file to an Android device.
parameter: adb: mandatory
parameter: name: mandatory
parameter: platformAbi: optional
parameter: version: optional
parameter: extension: optional
return: the path of the copied file on the target device, NOT containing         `platform/version/extension` information
throws: 

