File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,3 +16,15 @@ function validate_components() {
1616function cvdr() {
1717 HOME=${PWD} CVDR_USER_CONFIG_PATH=${CVDR_CONFIG_PATH} ${CVDR_PATH} " $@ "
1818}
19+
20+
21+ function verify_adb_connection() {
22+ # TODO(b/448209030): Retrieve serial of the device from the output of cvdr list.
23+ local cvdr_create_output=" ${1} "
24+ adb_serial=$( echo -e " ${cvdr_create_output} " | grep " ADB:" | grep -oE " [^ ]+$" )
25+ if [[ -z " ${adb_serial} " ]]; then
26+ echo " Device is not adb connected"
27+ exit 1
28+ fi
29+ timeout 30s adb -s ${adb_serial} wait-for-device
30+ }
Original file line number Diff line number Diff line change @@ -13,11 +13,9 @@ cleanup() {
1313}
1414trap cleanup EXIT
1515
16- cvdr create \
17- --host=${HOSTNAME} \
18- --branch=aosp-android-latest-release \
19- --build_target=aosp_cf_x86_64_only_phone-userdebug
16+ out= $( cvdr create \
17+ --host=${HOSTNAME} \
18+ --branch=aosp-android-latest-release \
19+ --build_target=aosp_cf_x86_64_only_phone-userdebug)
2020
21- # Check ADB connection
22- # TODO(b/448209030): Retrieve serial of the device from the output of cvdr list.
23- adb shell uptime
21+ verify_adb_connection " ${out} "
Original file line number Diff line number Diff line change @@ -24,11 +24,9 @@ cleanup() {
2424}
2525trap cleanup EXIT
2626
27- cvdr create \
28- --host=${HOSTNAME} \
29- --local_cvd_host_pkg_src=${CVD_HOST_PKG} \
30- --local_images_zip_src=${IMAGE_ZIP}
27+ out= $( cvdr create \
28+ --host=${HOSTNAME} \
29+ --local_cvd_host_pkg_src=${CVD_HOST_PKG} \
30+ --local_images_zip_src=${IMAGE_ZIP} )
3131
32- # Check ADB connection
33- # TODO(b/448209030): Retrieve serial of the device from the output of cvdr list.
34- adb shell uptime
32+ verify_adb_connection " ${out} "
You can’t perform that action at this time.
0 commit comments