Shell脚本:

#!/bin/bash
devices=( $(adb devices|grep device$|awk '{print $1}'|xargs echo) )

case ${#devices[@]} in
    0 )
        echo "can't found a android device!"
        ;;
    1 )
        serial=$devices
        ;;
    * )
        select serial in ${devices[@]}; do
            break;
        done
        ;;
esac

if [[ -z $serial ]]; then
    echo "Not select a android device, exit not"
    exit 1
fi

adb -s $serial shell echo OK

 

相关文章:

  • 2021-12-08
  • 2022-01-07
  • 2021-08-20
  • 2021-08-17
  • 2021-12-09
  • 2022-12-23
  • 2021-07-26
  • 2022-02-08
猜你喜欢
  • 2022-02-11
  • 2021-11-20
  • 2022-12-23
  • 2021-03-31
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案