AW: run_cts auto-determines device arch

This adds proper logic to to auto-determine the device
architecture, and to throw an error if the device architecture is not
supported. This also adds unit tests (and configures them to run on

Although this is not a significant improvement (we still only support
"arm64"), this gives fast, clear feedback when the device is unsupported
(e.g., emulators), and the logic should generalize as we support more
architectures. This also adds logging (which will be visible with
--verbose, to aid debugging).

This does minor refactoring in the script, to plumb arch where it's used
instead of reassigning to args.arch (which should help with testability
in the future).

Bug: 922854
Test: vpython android_webview/tools/
Test: android_webview/tools/ (script still runs)
Change-Id: I6528ab836f30b5885ede59853acaeee69de26fa2
Commit-Queue: Nate Fischer <>
Reviewed-by: Changwan Ryu <>
Cr-Commit-Position: refs/heads/master@{#625376}
3 files changed