Skip to content

Improve quality of "Device is attached check." #10

Description

@a-t-0

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions