通通不可说

生命永远充满希望

0%

一个小脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash
ARGS=($*)
ADB="adb"
ANDROID_DEVICES=(`adb devices | sed '1d' | awk '{print $1}'`)
if [[ ${#ANDROID_DEVICES[@]} -gt 1 ]];then
for((j=0;j<${#ANDROID_DEVICES[@]};j++))
do
echo $(expr ${j} + 1).${ANDROID_DEVICES[$j]}
done
while [[ $REPLY == "" || $REPLY == "0" ]];do
read -p "输入序号选择设备:"
done
ADB="adb -s "${ANDROID_DEVICES[$REPLY-1]}
fi
${ADB} ${ARGS[@]}