shell杀死进程, adb server is out of date. killing
来源:互联网 发布:单片机与modbus 编辑:程序博客网 时间:2024/06/05 03:34
解决问题adb server is out of date. killing
Android在用运行logcat的时候,会出现上面错误,是因为adb端口5037被占用了,运行如下脚本之后,再也不会担心出现同样的错误了。
原理是通过netstat命令找到占用5037端口的进程号,然后kill该进程号,最后在运行logcat命令就ok了。
### Solve the problem: "adb server is out of date. killing"### Must input a string### Example: ./logcat.sh adbfunction help_print(){ echo "################################################" echo "" echo "######## Please Input a String For Search.." echo "######## Usege: $0 Logcat_string" echo "" echo "################################################"}##### main### If have a Input String for logcat#if [ ! -n "$1" ]; then#if [[ "$1" == "" ]]; then# Be carefull, have a spaceif [[ ! $1 ]]; then help_print exitfiadb_pids=`netstat -anp|grep '5037'|awk '{print $7}'`echo $adb_pids### get adb's pid numfor pid in $adb_pids; do echo ${pid%/*} # trunck the left string if [[ "$pid" == +([0-9]) ]]; then PID_ADB=${pid%/*} echo "killing adb pid=$pid" ### if have pid num ,kill adb's pid, else logcat if [[ $PID_ADB != '' ]]; then kill $PID_ADB fi fidoneadb logcat|egrep $1 --color
阅读全文
0 0
- shell杀死进程, adb server is out of date. killing
- >adb shell 提示:adb server is out of date. killing...
- adb server is out of date. killing
- adb server is out of date. killing..
- adb server is out of date. killing...
- adb server is out of date. killing...
- adb server is out of date. killing...
- adb server is out of date. killing...
- adb server is out of date killing
- adb server is out of date. killing...
- adb server is out of date. killing
- adb server is out of date. killing...
- adb server is out of date. killing...
- adb server is out of date. killing...
- adb server is out of date. killing...
- adb server is out of date. killing...
- adb server is out of date.killing...
- adb server is out of date. killing...
- web.config 中SessionState的配置
- 几个问题
- day4_字符串反转问题
- 修改ternimal个性化设置
- Python:获取当前脚本路径的姿势对比
- shell杀死进程, adb server is out of date. killing
- 脱敏数据整理
- win7 VS2013 新建工程 编译lua5.1 静态库
- csuoj1163寒衣调(乘法逆元)
- 对一个double四舍五入,返回int
- 湖南省第十一届大学生计算机程序设计竞赛 简单的图论问题?
- 动态规划/leetcode/直接推导递推公式
- spring 基本依赖
- luogu1125【2008提高】笨小猴(素数)