First, Android has added a logcat window for testing convenience. If this window does not appear in your console, you can enable it in WINDOW> show View> logcat.
After enabling, find a green plus sign and add a filter. If you want to use system. if the output is out, the filter name is system. out, by log tag is system. out.
If you use output like log. I, the name is log. I, and the tag is your log. I tag.
In addition, if you directly connect your Android phone to your computer and the debug mode is enabled on your mobile phone, the simulator on your PC cannot be output unless you unplug your mobile phone.
Another alternative method is to call the android class to output information in logcat, Code As follows:
ImportAndroid. util. log;
Public ClassUtil {
Private Final StaticString tag = "printout ";
Public Static VoidPrinttextlog (string log ){
Log. V (TAG, log );
}
}
Tag is the tag for output information. The call method is log. V (string tag, string message ).
Open the logcat window (window-> show view-> logcat) in debug, add a filter, and set "by log tag" to a custom tag.