How to print on the console in Android Studio?

I just downloaded Android Studio for Linux: http://developer.android.com/sdk/installing/studio.html

I am wondering how to print on the console?

System.out.print(...) and Log.e(...) from android.util.Log do not work.

+75
java android android-studio mobile development-environment
May 27 '13 at 20:40
source share
4 answers

Launch the application in debug mode by clicking

enter image description here

in the top menu of Android Studio.

In the bottom status bar, click the 5: Debug button next to the 4: Run button.

You should now select the Logcat console.

In the search field you can enter a tag for your message, and your message should appear, as in the following figure (where is the CREATION tag):

enter image description here

Read more about this article .

+102
May 28 '13 at 4:30
source share

Android has its own way of printing messages (called logs ) on a console known as LogCat .

If you want to print something in LogCat , you use the Log object and specify the category of the message.

Main settings:

  • DEBUG: Log.d
  • ERROR: Log.e
  • INFO: Log.i
  • VERBOSE: Log.v
  • WARN: Log.w

You print a message using the Log statement in your code, for example, in the following example:

 Log.d("myTag", "This is my message"); 

In Android Studio, you can search for log messages labeled myTag to easily find a message in LogCat . You can also filter logs by category, such as "Debug" or "Warn."

+86
Jan 12 '15 at 4:32
source share

If the above solutions do not work, you can always see the output in Android Monitor .




Android studio screenshot




Be sure to set the filter to Show only the selected application or create your own filter.

enter image description here

+7
Apr 26 '17 at 20:14
source share

You can see println instructions in the Run window in Android Studio. therefore, you can see prinln instructions in this window.

See detailed answer with screenshot here

0
Oct 24 '17 at 4:50
source share