HiveMinds / HiveMinds/appcommander
Improve quality of "Device is attached check."
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
@typechecked
def assert_phone_is_connected() -> None:
"""Throws error if phone is not connected via ADB."""
# Launc the app on phone.
command = "adb devices"
output = run_bash_command(
await_compilation=True, bash_command=command, verbose=False
)
lines = output.split("\n")
# TODO: make more robust check, e.g. eat "List of devices attached" and see
# whether any a-Z 0-9 characters exist in output.
if len(lines) <= 3:
raise Exception("Error, no adb device is found.")
# TODO: check if more than one devices are connected, and if yes, raise
# exception if user did not specify the desired device name.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.