Common ADB operations for battery benchmarking.
Centralizes ADB command execution to reduce duplication across battery bench and preflight modules.
Summary
Functions
Gets the PID of an app on an Android device.
Auto-detects a connected Android device.
Checks if ADB is available.
Gets the battery level from an Android device.
Checks if an app is installed on an Android device.
Checks if ADB is available and a device is reachable.
Checks if a device is reachable via ADB.
Enables WiFi ADB for a device.
Ensures local Erlang distribution is started.
Runs an ADB command and returns the output.
Runs an ADB command and returns the raw output (including stderr).
Sets up ADB tunnels for device communication.
Gets the WiFi IP for a device.
Functions
Gets the PID of an app on an Android device.
@spec auto_detect_device() :: String.t() | nil
Auto-detects a connected Android device.
@spec available?() :: boolean()
Checks if ADB is available.
@spec battery_level(String.t()) :: {:ok, non_neg_integer()} | {:error, String.t()}
Gets the battery level from an Android device.
Checks if an app is installed on an Android device.
Checks if ADB is available and a device is reachable.
Returns {:ok, serial} if a device is found, {:error, reason} otherwise.
Checks if a device is reachable via ADB.
Enables WiFi ADB for a device.
@spec ensure_local_dist() :: :ok
Ensures local Erlang distribution is started.
Runs an ADB command and returns the output.
Runs an ADB command and returns the raw output (including stderr).
@spec setup_tunnels(String.t()) :: :ok
Sets up ADB tunnels for device communication.
Gets the WiFi IP for a device.