Automatically clearing LogCat on each Eclipse Debug/Run?
Asked Answered
J

2

36

I expected this to be a simple task, but I'm surprised to find no answers for this.

Let me clarify:

  • I do not want to call adb logcat -c manually. In fact, I'm not even using the command line to view LogCat, so I don't think this is possible (edit: actually, it is, by running the command in a separate command line...but I don't want to do that). I'm using Eclipse to view LogCat.

  • I do not want to click button Clear Log each time. That's what I'm doing now.

  • I do, programatically or through Eclipse's Run/Debug configurations or however, want a way to automatically clear LogCat each time I hit Ctrl+F11 to run my Android project. My LogCat is getting cluttered. Ctrl+F11 isn't important - it's just my shortcut to Debug. I'd like to clear LogCat on Debug/Run.

  • I'm using Eclipse on Windows 7 and debugging with a Nexus One (not an emulator).

I've tried:

  • Modifying Debug/Run configurations. (Project -> Properties -> Run/Debug Settings -> Edit Launch Configurations) Running from the emulator is the only way to add Additional Emulator Command Line Options. But I'm running from the actual Android device, so I can't access those options.

  • Builders? I wasn't sure how to use this. (Project -> Properties -> Builders). How would I use this to clear LogCat each time I run?

I'm beginning to think I have to write a macro program to hook Ctrl+F11 when the active foreground process is eclipse.exe to move my cursor to the Clear Log button and click it. I guess clearing LogCat automatically is too much to ask for.

Jerrold answered 2/3, 2012 at 23:8 Comment(1)
+1 on your question. How can a development environment not think of this? I want to slap someone.Neume
B
-1

If you're not locked to Eclipse because of some strong reasons, you can try IntelliJ IDEA as IDE. Here is option for run configuration for clear log on app run. Unfortunately, following http://youtrack.jetbrains.com/issue/IDEA-80976 it is broken right now, but I think it'll be fixed in near future.

Brittneybrittni answered 3/3, 2012 at 0:34 Comment(5)
Thanks, but I am tied to Eclipse ;/Jerrold
I change my mind - I think I've had it with Eclipse for a while. Let's hope Intellij IDEA is better. Maybe I'll try console LogCat too.Jerrold
@Brittneybrittni Is there no other way to handle this issue? I dont want to switch IDE. I've just got familiar with Eclipse. Also, because there are more plugins on eclipse. I'm also planning to do arduino programming on eclipse.Unshod
Went back to Eclipse almost immediately; still, as far as I know, there is no way to automatically clear LogCat, although LogCat has improved.Jerrold
A year later, I've moved to IntelliJ as my IDE. It's the official platform behind Android Studio (actually I am using Android Studio) and it's very very nice.Jerrold
S
2

Some commercial releases of Eclipse (e.g. Adobe's Flash Builder) have this as an option in the preferences panel. It's probably a relatively trivial thing to implement, they just didn't bother.

You should request this feature, if enough people do it they might add it to the next release:

http://www.eclipse.org/contribute/

Subdivision answered 8/11, 2012 at 15:20 Comment(1)
@Pacerier The Eclipse platform does not provide the LogCat support, that comes from the Android toolkit (developer.android.com/tools/help/logcat.html). I would suggest filing your request with them.Rueful
B
-1

If you're not locked to Eclipse because of some strong reasons, you can try IntelliJ IDEA as IDE. Here is option for run configuration for clear log on app run. Unfortunately, following http://youtrack.jetbrains.com/issue/IDEA-80976 it is broken right now, but I think it'll be fixed in near future.

Brittneybrittni answered 3/3, 2012 at 0:34 Comment(5)
Thanks, but I am tied to Eclipse ;/Jerrold
I change my mind - I think I've had it with Eclipse for a while. Let's hope Intellij IDEA is better. Maybe I'll try console LogCat too.Jerrold
@Brittneybrittni Is there no other way to handle this issue? I dont want to switch IDE. I've just got familiar with Eclipse. Also, because there are more plugins on eclipse. I'm also planning to do arduino programming on eclipse.Unshod
Went back to Eclipse almost immediately; still, as far as I know, there is no way to automatically clear LogCat, although LogCat has improved.Jerrold
A year later, I've moved to IntelliJ as my IDE. It's the official platform behind Android Studio (actually I am using Android Studio) and it's very very nice.Jerrold

© 2022 - 2024 — McMap. All rights reserved.