HiveMinds / HiveMinds/appcommander

Improve quality of "Device is attached check."

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.