20

I'm trying to play with debug in Android app and, when a breakpoint is encountered, Eclipse shows me a lot of windows, one of which is the "Interactive Console" with a prompt: I think to be able to enter statements and/or other stuff, but it seems to be disabled. How can I work with it?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Cris
  • 12,124
  • 27
  • 92
  • 159
  • @ Cris There is another view `Expressions` where you can enter some statements that are inscope on the current execution point and do some computations. – Varun Sep 11 '13 at 23:37

5 Answers5

7

Window - Show View - Debug - Display

That will provide you with a window to enter statements and execute/inspect them. This is a feature that's available in core eclipse platform. It works in most cases for Android based projects as well.

More info on the display view can be found here : http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/views/debug/ref-debug_view.htm

For a nice overview of the debugging features of Eclipse, check out this post : http://www.cavdar.net/2008/09/13/5-tips-for-debugging-java-code-in-eclipse/

ddewaele
  • 22,363
  • 10
  • 69
  • 82
  • 1
    this is an alternative way to solve the problem, but doesn't answer the question of why the Interactive Console is disabled. The same thing is happening for me. Thanks for the tip about the display view though! – killdash9 Aug 03 '11 at 01:29
  • Still doesn't directly answer the question, but at least you answered what appears to be the underlying need: a debug display console. Thank you sir, you have my +1. – JMTyler Jan 16 '13 at 19:32
  • just to clarify re execute/inspect, the interactive part is found by opening the debug perspective (e.g. add breakpoint, run program and wait for it to hit the breakpoint), then open the display view if not already there (window / show view / display) and it should appear as a tab along the bottom. it's a bit clumsy (e.g. have to highlight the code to run then issue a keyboard shortcut or select from context menu with a right click of the mouse) but it works. – Moika Turns Jun 23 '17 at 11:39
1

The "Interactive Console" within the Debug View of Eclipse is used whenever the debugged program expects some input from the console.

Jonathan Heinen
  • 606
  • 6
  • 9
0
  1. You can use Logcat for and can see your check points using

    android.util.Log.e("","CheckPoint");

  2. You can toast your check points using Toast like:

    Toast.makeText(this, "Write here what you want see",1 or 0).show();

    1-> long time displaying and 0 for short time.

    This toast display in your device screen when programe running.

  3. You can use console screen for seeing output like print statements Ex---

    java.lang.System.out.print("Checking");

Varun
  • 33,833
  • 4
  • 49
  • 42
  • 7
    Too primitive, slow and not flexible way to debug. We're on 21th century and using Java and modern IDEs, not in the 70s programming with C. – m0skit0 Nov 30 '12 at 15:54
  • @ArunChandravanshi you probably meant `android.util.Log` and also missed the `show()` on `Toast`. Editing! – Varun Sep 11 '13 at 23:26
0

It's possible you have other plugins installed that provide that view, and it's not meant to be used by Android Java code. See here (not accepted answer, but community-favored one).

Community
  • 1
  • 1
Brian Henry
  • 3,161
  • 1
  • 16
  • 17
-1

use try{ statements...; } catch(Exception e){ System.out.println("the error message "+e); } will show the error messages.

Arun
  • 385
  • 3
  • 7
  • 16