如何在同一时间在多个设备上运行logcat? “亚行logcat” 命令给出一个错误:如何在多个设备上运行logcat?
error: more than one device and emulator
如何在同一时间在多个设备上运行logcat? “亚行logcat” 命令给出一个错误:如何在多个设备上运行logcat?
error: more than one device and emulator
使用-s
选项adb
:
adb -s <serialnumber>
例
C:\Users\lel>adb devices
List of devices attached
192.168.198.101:5555 device
ABCDEF device
adb -sABCDEF logcat
adb -s 192.168.198.101:5555 logcat
您可以结合grep
白衣这一点,让所有包含它的行。
一个实例是具有System.out
实施例:
adb -s 192.168.198.101:5555 logcat | grep "System.out"
我认为这可能是有用的。我有这个脚本可以帮助我很多。它将每个设备登录到不同的文件。要停止记录,只需按CTRL + C。
#! /bin/bash
devices=`adb devices | grep 'device$' | cut -f1`
pids=""
for device in $devices
do
log_file="$device-`date +%d-%m-%H:%M:%S`.log"
echo "Logging device $device to \"$log_file\""
adb -s $device logcat -v threadtime > $log_file &
pids="$pids $!"
done
echo "Children PIDs: $pids"
killemall()
{
echo "Killing children (what a shame...)"
for pid in $pids
do
echo "Killing $pid"
kill -TERM $pid
done
}
trap killemall INT
wait
使用设备IP:
adb -s device_ip:5555
我想我会更加关注亚行参数下一次......对不起,造就了这样一个明显的问题。 :) – Kostas 2011-06-01 15:12:56
你是如何得到serialnumber的?我试图与亚行的设备但给我连接的设备名单 HT05XPL09783 \t设备 100082a42935 \t设备 和亚行logcat -s 100082a42935不起作用 – Lukap 2011-06-29 11:16:00
我发现我的愚蠢的错误,应该留像亚行-s 100082a42935 logcat的 – Lukap 2011-06-29 11:17:35