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