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.
선택한 애플리케이션 만 표시 하도록 필터를 설정 하거나 사용자 정의 필터를 작성하십시오.
Run
Android 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
'IT박스' 카테고리의 다른 글
MongoDB에서 Elasticsearch를 사용하는 방법은 무엇입니까? (0) | 2020.06.28 |
---|---|
Eclipse에서 Android 프로젝트의 패키지 이름을 변경하는 방법은 무엇입니까? (0) | 2020.06.28 |
node.js TypeError : 경로는 절대적이거나 res.sendFile에 루트를 지정해야합니다 [JSON 구문 분석에 실패했습니다] (0) | 2020.06.28 |
replace를 사용할 때 Javascript가 첫 번째 인스턴스 만 대체하는 이유는 무엇입니까? (0) | 2020.06.28 |
PHP_excel의 대안 (0) | 2020.06.28 |