#!/usr/bin/bash
#定义输出的颜色
RST="$(tput sgr0)"
RED="${RST}$(tput setaf 1)"
BRED="${RST}$(tput bold)$(tput setaf 1)"
GREEN="${RST}$(tput setaf 2)"
YELLOW="${RST}$(tput setaf 3)"
BYELLOW="${RST}$(tput bold)$(tput setaf 3)"
BLUE="${RST}$(tput setaf 4)"
CYAN="${RST}$(tput setaf 6)"
BCYAN="${RST}$(tput bold)$(tput setaf 6)"
ICYAN="${RST}$(tput sitm)$(tput setaf 6)"
clear
#在下面的代码中 2>&1中的数值表示,0 – stdin (standard input),1 – stdout (standard output),2 – stderr (standard error) ;
#2>&1是将标准错误(2)重定向到标准输出(&1)以便于捕获异常。
runadb=$(adb connect localhost:5555 2>&1)
#echo runadb: ${runadb} \n\n
error_info="error:"
refused_info="refused"
if_contains_error_info=$(echo ${runadb} | grep "${error_info}")
if_contains_refused_info=$(echo ${r