diff --git a/lite/tools/ci_build.sh b/lite/tools/ci_build.sh index 7ae0a4fbbde9d8d17fe5b371ddc2d2a682082263..0fdb472d784995dd73eafd307274597c9f0f15d3 100755 --- a/lite/tools/ci_build.sh +++ b/lite/tools/ci_build.sh @@ -47,10 +47,10 @@ function prepare_adb_devices { device_armv8=emulator-$port_armv8 device_armv7=emulator-$port_armv7 else - adb_devices_num=($(adb devices |grep -v devices |grep device | awk -F " " '{print $1}')) + adb_devices=($(adb devices |grep -v devices |grep device | awk -F " " '{print $1}')) # adbindex is the env variable registered in ci agent to tell which mobile is to used as adb adbindex_pos=`expr ${adbindex} + 1` - if [ ${adbindex_pos} -gt ${adb_devices_num} ]; then + if [ ${adbindex_pos} -gt ${#adb_devices[@]} ]; then echo -e "Error: the adb devices on ci agent are not enough, at least ${adbindex_pos} adb devices are needed." exit 1 fi