Android 9(API 수준 28) 및 이후 버전을 실행하는 기기에는 시스템 추적이라는 시스템 수준 앱이 포함되어 있습니다. 이 앱은 systrace 명령줄 유틸리티와 유사하지만 이 앱을 사용하면 기기에 전원을 연결하고 adb를 통해 연결할 필요 없이 테스트 기기 자체에서 직접 트레이스를 기록할 수 있습니다. 그런 다음, 이 앱을 사용하여 트레이스 결과를 개발팀과 공유할 수 있습니다.
Android 10 이상을 실행하는 기기는 Perfetto 형식으로 트레이스를 기록하는 반면, 이전 기기는 Systrace 형식으로 기록합니다. Perfetto 트레이스 뷰어를 사용하여 두 형식을 모두 연 후 트레이스를 분석하는 것이 좋습니다.
느린 시작, 느린 전환 또는 UI 버벅거림과 같은 앱의 성능 관련 버그를 해결할 때 트레이스를 기록하면 도움이 됩니다.
시스템 트레이스 기록
시스템 추적 앱을 사용하면 빠른 설정 타일 또는 앱 자체 내의 메뉴를 사용하여 시스템 트레이스를 기록할 수 있습니다. 다음 섹션에서는 이러한 인터페이스를 사용하여 기록 프로세스를 완료하는 방법을 설명합니다.
빠른 설정 타일을 사용하여 기록
일반적으로 빠른 설정 타일은 기기 내 시스템 추적 프로세스를 완료하는 보다 편리한 방법입니다.
타일 설정
테스트 기기에서 처음으로 시스템 추적을 사용하거나 기기의 빠른 설정 패널(그림 2 참고)에 시스템 추적 타일이 표시되지 않는 경우 다음 설정 단계를 완료하세요.
개발자 옵션 설정 화면을 엽니다. 디버깅 섹션에서 시스템 추적을 선택합니다. 시스템 추적 앱이 열립니다.
또는 시스템 추적 타일을 설정하는 경우 이 타일을 길게 탭하여 시스템 추적 앱을 시작할 수 있습니다.
시스템 트레이스에 디버깅이 사용 설정된 앱을 포함하도록 디버그 가능한 애플리케이션 추적이 선택되어 있는지 확인합니다.
선택적으로, 추적할 시스템 및 센서 호출의 카테고리를 선택하고 CPU별 버퍼 크기(KB 단위)를 선택합니다. 테스트 중인 사용 사례에 해당하는 카테고리를 선택합니다(예: 블루투스 작동을 테스트하는 경우 오디오 카테고리, 힙 할당의 경우 메모리 카테고리).
선택적으로, 장기 트레이스를 선택하여 기기 저장소에 지속적으로 저장되는 트레이스를 사용 설정합니다. 이 옵션의 경우 최대 장기 트레이스 크기 및 최대 장기 트레이스 기간에 제한을 설정합니다.
그림 5에 강조 표시된 트레이스 기록 스위치를 사용 설정합니다. 타일이 사용 설정되고, 그림 3에 표시된 것처럼 시스템에서 트레이스를 기록 중임을 알리는 지속적인 알림이 표시됩니다.
그림 5. 시스템 추적 설정의 트레이스 기록 스위치
시스템에서 검사할 앱의 작업을 실행합니다.
트레이스 기록 스위치를 꺼서 추적을 중지합니다.
시스템에서 '트레이스 저장 중'이라는 메시지가 포함된 새로운 알림을 표시합니다. 저장이 완료되면 시스템에서는 알림을 닫고 그림 4에 표시된 것과 같이 트레이스가 저장되었으며 시스템 트레이스를 공유할 준비가 되었음을 확인하는 세 번째 알림을 표시합니다.
시스템 트레이스 공유
시스템 추적 앱은 여러 개의 다른 워크플로의 일부로 시스템 트레이스 결과를 공유하는 데 도움이 됩니다. Android 10(API 수준 29) 및 이후 버전을 실행하는 기기에서는 .perfetto-trace 파일 이름 확장자를 사용하여 트레이스 파일이 저장되며 이 파일을 Perfetto UI에서 열 수 있습니다. 이전 버전의 Android를 실행하는 기기에서는 Systrace 형식을 나타내는 .ctrace 파일 이름 확장자를 사용하여 트레이스 파일이 저장됩니다.
메시지로 공유
시스템 추적을 사용하면 수집된 트레이스를 기기의 다른 앱과 공유할 수 있습니다. 기기를 개발 머신과 연결하지 않고도 이메일 또는 버그 추적 앱을 통해 트레이스를 개발팀에 보낼 수 있습니다.
시스템 트레이스를 기록한 후 기기에 표시되는 알림을 탭합니다(그림 4 참고). 플랫폼의 인텐트 선택 도구가 표시되므로 선택한 메시지 앱을 사용하여 트레이스를 공유할 수 있습니다.
Files 앱에서 공유
Android 10(API 수준 29) 이상을 실행하는 기기에서는 트레이스가 Files 앱에 표시됩니다. 이 앱에서 트레이스를 공유할 수 있습니다.
ADB를 사용하여 보고서 다운로드
adb를 사용하여 기기에서 시스템 트레이스를 추출할 수도 있습니다. 트레이스를 기록하는 데 사용된 기기를 개발 머신에 연결한 후 터미널 창에서 다음 명령어를 실행합니다.
cd /path-to-traces-on-my-dev-machine && \
adb pull /data/local/traces/ .
트레이스 형식 간 변환
Perfetto 트레이스 파일을 Systrace 형식으로 변환할 수 있습니다. 자세한 내용은 트레이스 형식 간 변환을 참고하세요.
HTML 보고서 만들기
트레이스를 공유하는 경우 보고서 자체는 .perfetto-trace 파일(Android 10 및 이후 버전을 실행하는 기기) 또는 .ctrace 파일(모든 다른 버전)에 있습니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-21(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-21(UTC)"],[],[],null,["# Capture a system trace on a device\n\nDevices running Android 9 (API level 28) or higher include a system-level app\ncalled System Tracing. This app is similar to the\n[`systrace`](/topic/performance/tracing/command-line) command-line utility, but\nthe app lets you record traces directly from a test device itself, without\nneeding to plug in the device and connect to it over `adb`. You can then use the\napp to share results from these traces with your development team.\n\nDevices running Android 10 and higher record traces in Perfetto format, whereas\nearlier devices record them in Systrace format. We recommend using the [Perfetto\ntrace viewer](https://ui.perfetto.dev/) to open both formats and\nthen analyze traces.\n\nIt helps to record traces when addressing performance-related bugs in your app,\nsuch as slow startup, slow transitions, or UI jank.\n\nRecord a system trace\n---------------------\n\nThe System Tracing app lets you record a system trace using **Quick Settings\ntile** or a menu within the app itself. The following sections describe how to\ncomplete the recording process using these interfaces.\n| **Note:** As part of your development workflow, you might submit an on-device bug report. It's important to file this type of bug report after you finish recording a system trace. That way, the bug report process itself isn't included in the recorded trace.\n\n### Record using Quick Settings tile\n\n**Quick Settings tile** is usually the more convenient way to complete the\non-device system tracing process.\n\n#### Set up tile\n\nIf you're using System Tracing for the first time on your test device, or if you\ndon't see the **System Tracing** tile in your device's **Quick Settings** panel,\nas shown in figure 2, complete the following setup steps:\n\n1. [Enable developer options](/studio/debug/dev-options#enable).\n2. Open the **Developer Options** settings screen.\n3. In the **Debugging** section, select **System Tracing**. The System Tracing app opens, showing the app menu.\n4. From the app menu, enable **Show Quick Settings tile** , as shown in figure 1.\n The system adds the **System Tracing** tile to the **Quick Settings** panel,\n as shown in figure 2:\n\n **Figure 1.** The **Show Quick Settings tile** switch in the System Tracing app. **Figure 2.** The **System Tracing** tile within the **Quick Settings** panel.\n\n **Note:** By default, the system\n adds the **System Tracing** tile as the first tile in the **Quick\n Settings** panel. If you want the tile to appear in a different position,\n use the panel's edit mode to move the tile.\n\n#### Complete a system trace recording\n\nTo record a system trace using the **Quick Settings** panel, complete the\nfollowing steps:\n\n1. Tap the **System Tracing** tile, which has the label **Record trace**. The\n tile becomes enabled, and a persistent notification appears to notify you\n that the system is recording a trace, as shown in figure 3:\n\n **Figure 3.** Persistent notification that appears after starting an on-device system trace.\n2. Perform the actions in your app that you want the system to inspect.\n\n | **Note:** You can record bugs that are difficult to reproduce by leaving System Tracing running in the background and then stopping System Tracing soon after the bug occurs. System Tracing saves a device's activity to a rolling buffer, which holds 10-30 seconds of events.\n3. Stop tracing by tapping either the **System Tracing** tile in the **Quick\n Settings** panel or on the System Tracing notification.\n\n The system displays a new notification that contains the message \"Saving\n trace\". When saving is complete, the system dismisses the notification and\n displays a third notification, confirming that your trace is saved and that\n you're ready to [share the system trace](#share-trace), as shown in figure\n 4:\n **Figure 4.** Persistent notification that appears after the system finishes saving a recorded trace.\n\n### Record using app menu\n\nThe app menu lets you configure several advanced settings related to system\ntracing and provides a switch for starting and stopping a system trace.\n\nTo record a system trace using the System Tracing app menu, complete the\nfollowing steps:\n\n1. [Enable developer options](/studio/debug/dev-options#enable).\n2. Open the **Developer Options** settings screen. In the **Debugging** section,\n select **System Tracing**. The System Tracing app opens.\n\n Alternatively, if you [set up the **System Tracing** tile](#set-up-tile),\n you can tap and hold the tile to enter the System Tracing app.\n3. Make sure **Trace debuggable applications** is selected to include apps that\n have debugging enabled in the system trace.\n\n4. Optionally, choose the **Categories** of system and sensor calls to trace,\n and choose a **Per-CPU buffer size** in KB. Choose categories that correspond\n to the use case that you're testing, such as the **Audio** category for\n testing Bluetooth operations or the **Memory** category for heap allocations.\n\n | **Note:** These categories serve as app-level settings, so the system uses these categories when [using the **Quick Settings** tile](#quick-settings), too. In addition, these settings persist across device reboots.\n5. Optionally, select **Long traces** to enable traces that are saved\n continuously to device storage. For this option, set limits for the **Maximum\n long trace size** and **Maximum long trace duration**.\n\n6. Enable the **Record trace** switch, highlighted in figure 5. The tile becomes\n enabled, and a persistent notification appears to notify you that the system\n is recording a trace, as shown in [figure 3](#systrace-start).\n\n **Figure 5.** The **Record trace** switch in the System Tracing settings.\n7. Perform the actions in your app that you want the system to inspect.\n\n | **Note:** You can record bugs that are difficult to reproduce by leaving System Tracing running in the background, then stopping System Tracing soon after the bug occurs. By default, System Tracing saves a device's activity to a rolling buffer, which holds 10-30 seconds of events. If **Long traces** is enabled, the device's activity is saved continuously to device storage up to the limits you set.\n8. Stop tracing by disabling the **Record trace** switch.\n\n The system displays a new notification that contains the message \"Saving\n trace\". When saving is complete, the system dismisses the notification and\n displays a third notification, confirming that your trace is saved and that\n you're ready to [share the system trace](#share-trace), as shown in\n [figure 4](#systrace-saved).\n\nShare a system trace\n--------------------\n\nThe System Tracing app helps you share system trace results as part of several\ndifferent workflows. On a device running Android 10 (API level 29) or higher, trace\nfiles are saved with the `.perfetto-trace` filename extension and can be opened\nin the [Perfetto UI](https://ui.perfetto.dev/#!/). On a device\nrunning an earlier version of Android, trace files are saved with the `.ctrace`\nfilename extension, which denotes the Systrace format.\n\n### Share as a message\n\nSystem Tracing lets you share your collected trace with other apps on your\ndevice. You can send the trace to your development team through an email or a\nbug-tracking app without needing to connect a device to your development\nmachine.\n\nAfter you record a system trace, tap on the notification that appears on\nthe device, like the one shown in [figure 4](#systrace-saved). The platform's\nintent picker appears, letting you share your trace using the messaging app of\nyour choice.\n\n### Share from the Files app\n\nOn devices running Android 10 (API level 29) or higher, traces are shown in the\nFiles app. You can share a trace from this app.\n\n### Download report using ADB\n\nYou can also extract a system trace from a device using `adb`. Connect the\ndevice used to record the trace to your development machine, then run the\nfollowing commands in a terminal window: \n\n```\ncd /path-to-traces-on-my-dev-machine && \\\n adb pull /data/local/traces/ .\n```\n\nConvert between trace formats\n-----------------------------\n\nYou can convert Perfetto trace files to the Systrace format. See [Converting\nbetween trace formats](https://docs.perfetto.dev/#/traceconv.md)\nfor more information.\n\nCreate an HTML report\n---------------------\n\nWhen sharing your trace, the report itself is in a `.perfetto-trace` file on\ndevices running Android 10\nor higher, or a `.ctrace` file for all other versions.\n\nCreate an HTML report from the trace file using a [web-based UI](#web-ui) or\nfrom the [command line](#command-line).\n\n### Web-based UI\n\nUse the [Perfetto UI](https://perfetto.dev/#/running.md) to open\nthe trace file and generate the report.\n\nFor a Perfetto file, click **Open trace file** . For a Systrace file, click\n**Open with legacy UI** . The legacy UI has the same look and feel as the\n[**Systrace report**](/topic/performance/tracing/navigate-report).\n\n### Command line\n\nRun the following commands in a terminal window to generate an HTML report\nfrom the trace file: \n\n```\ncd /path-to-traces-on-my-dev-machine && \\\n systrace --from-file trace-file-name{.ctrace | .perfetto-trace}\n```\n\nIf you don't already have the `systrace` command-line program, you can download\nit from the\n[Catapult](https://github.com/catapult-project/catapult/tree/main/systrace)\nproject on GitHub, or directly from the [Android Open Source\nProject](https://android.googlesource.com/platform/external/chromium-trace/+/main/catapult/systrace/systrace/).\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Benchmark in Continuous Integration](/topic/performance/benchmarking/benchmarking-in-ci)\n- [Capture a system trace on the command line](/topic/performance/tracing/command-line)"]]