IT박스

Android Studio에서 콘솔로 인쇄하는 방법은 무엇입니까?

itboxs 2020. 6. 28. 19:23
반응형

Android Studio에서 콘솔로 인쇄하는 방법은 무엇입니까?


http://developer.android.com/sdk/installing/studio.html 에서 Linux 용 Android Studio를 다운로드했습니다.

콘솔에 인쇄하는 방법이 궁금합니다.

어느 쪽 System.out.print(...)Log.e(...)에서 android.util.Log제대로 작동하지 않습니다.


를 클릭하여 디버그 모드 에서 애플리케이션을 실행하십시오 .

여기에 이미지 설명을 입력하십시오

Android Studio의 상단 메뉴에서

하단 상태 표시 줄에서 5: Debug버튼 옆에있는 4: Run버튼 클릭하십시오 .

이제 Logcat콘솔을 선택해야합니다 .

검색 창에 메시지 태그입력 하면 다음 그림과 같이 메시지가 나타납니다 (태그가있는 위치 CREATION).

여기에 이미지 설명을 입력하십시오

자세한 내용은 이 기사확인 하십시오.


Android has its own method of printing messages (called logs) to the console, known as the LogCat.

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

The main options are:

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

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

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

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


If the above solutions don't work, you can always see the output in the Android Monitor.


안드로이드 스튜디오 스크린 샷


선택한 애플리케이션 만 표시 하도록 필터를 설정 하거나 사용자 정의 필터를 작성하십시오.

여기에 이미지 설명을 입력하십시오


RunAndroid Studio의 창에서 println 문을 볼 수 있습니다 . 해당 창에서 prinln 문을 볼 수 있습니다.

스크린 샷으로 자세한 답변을 보려면 여기를 클릭하십시오.


앱이 IDE가 아닌 장치에서 시작된 경우 나중에 메뉴에서 수행 할 수 있습니다 : Run- Attach Debugger to Android Process.

닫힌 응용 프로그램에서 알림을 디버깅 할 때 유용 할 수 있습니다.

참고 URL : https://stackoverflow.com/questions/16780294/how-to-print-to-the-console-in-android-studio

반응형