如何在同一時間在多個設備上運行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