How do I get Logcat for multiple devices running at the same time in Eclipse
Asked Answered
T

5

21

I have two android devices connected to the same station. I would like to view the logcat for both while running them in debug mode in eclipse.

I have had SOME luck with the following steps:

  1. Run the app on Device 1
  2. Run the app on Device 2
  3. Open a new window (window/new)
  4. In the new window, open view logcat

About 40% of the time this results in in each eclipse window showing data from a different phone... but not always. It seems to be almost a luck-of-the-draw kind of thing. More often than not both windows show the same device. If I open device viewer and select a device in either window both change.

How can I do this all the time?

Trichosis answered 4/1, 2013 at 18:5 Comment(0)
M
41

This is a very late reply but probably you didn't find a solution.

Solution:

Click Window ---> Show View ---> Other ---> Android ---> Devices.

Simply click on a device to switch to its logcat.

Mistress answered 3/6, 2013 at 17:45 Comment(2)
I had to select the device filter I wanted the logcat to display, but this works just fine!Franklynfrankness
Aaah, finally, much easier than unplugging and plugging in the device I want to show in LogCat, thanks!Bushcraft
D
7

You can try to use adb in two different console windows to get the logcat for each one.

Example:

in console window 1: adb -s <device01_serial> logcat
in console window 2: adb -s <device02_serial> logcat
Disburden answered 4/1, 2013 at 18:12 Comment(1)
That's not exactly what I'm shooting for. I'd like to be able to tell eclipse's logcat viewer which serial number to monitor.Trichosis
R
1

As takecare said.

This is how you can do it:

  1. Find the device id's of Device 1 and Device 2. Do this by opening a shell prompt and typing the command adb devices You'll get a list of connected devices and their id's.
  2. Run the command adb -s [device_1_id] logcat Where [device_1_id] is the device id of your Device 1 which you obtained in the first step.
  3. Open another shell and do the same as in step 2, but for you Device 2.
Ric answered 4/1, 2013 at 18:16 Comment(1)
That gets me two shells running logcat, but not within the eclipse environment. My goal is to achieve what I am currently getting by luck by choice. In short, I know eclipse can route two different streams of output to two different windows. I've done it. But I am currently relying on it 'just working' when I launch the 2nd window and sometimes it doesn't. How do I tell the 2nd window which output to monitor?Trichosis
P
1

I don't believe there's a good way to do this. You can approximate it though. One option is (as other answers have suggested) to use logcat from adb. This obviously isn't as pretty. Another is to run DDMS directly (instead of through Eclipse) for your second window. This gets you pretty close and gives you two logcat windows each with their own device selectors. The DDMS executable is found in the tools folder of your Android installation.

Prune answered 4/1, 2013 at 20:8 Comment(0)
S
1

Here's the way I handle switching between device's logcat output using Juno M20120914-1800.

Unfortunately it is not automatic, but it is at least the most reliable way I've found yet, and once you get used to doing it, it's not that bad.

I click on the device icon in the toolbar.

I click on the device name.

Then I click on logcat again and it will show the device I selected.

It seems like this should be a feature, to be able to monitor more than one device/AVD at a time.

Saccule answered 4/1, 2013 at 20:41 Comment(1)
I've tried this. Unfortunately it switches both eclipse windows (and both logcat views) to the new device, instead of on a window by window basis.Trichosis

© 2022 - 2024 — McMap. All rights reserved.