로컬에서 wake lock 디버그
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
절전 모드 해제 잠금을 사용하는 로컬 실행 앱을 디버그하는 데 사용할 수 있는 여러 도구가 있습니다. 이러한 도구를 사용하면 성능 문제를 식별하고 해결할 수 있습니다.
다음 도구를 사용하면 절전 모드를 디버그하거나 최적화할 수 있습니다.
- dumpsys는 기기의 시스템 서비스 상태에 관한 정보를 제공합니다.
- 시스템 추적을 실행하면 시스템 보고서를 생성하는 데 사용할 수 있는 트레이스 파일이 생성됩니다.
- Android 스튜디오 Background Task Inspector를 사용하면 WorkManager와 같은 라이브러리에서 획득할 수 있는 절전 모드 해제 잠금을 비롯한 절전 모드 해제 잠금을 모니터링할 수 있습니다.
dumpsys
dumpsys는 Android 기기에서 실행되는 도구로, 기기의 시스템 서비스에 관한 정보를 제공합니다.
다음 명령어는 절전 모드 해제 잠금 디버깅에 특히 유용합니다.
adb shell dumpsys batterystats
는 각 앱에서 보유한 절전 모드 해제 잠금의 자세한 기록을 제공합니다. 자세한 내용은 dumpsys 배터리 진단 검사 문서를 참고하세요.
시스템 추적
시스템 추적은 짧은 기간 동안 다양한 기기 활동을 기록합니다. 시스템 추적을 실행하면 시스템 보고서를 생성하는 데 사용할 수 있는 트레이스 파일이 생성됩니다. 이 보고서는 앱의 성능을 개선하는 방법을 파악하는 데 도움이 됩니다.
시작하는 방법은 이 시스템 추적 빠른 시작 가이드를 참고하세요. Android 배터리 효율성 개선에 관한 이 동영상을 시청할 수도 있습니다.
Background Task Inspector
Android 스튜디오의 Background Task Inspector를 사용하여 절전 모드 해제, 알람, 작업을 모니터링할 수 있습니다.
특히 WorkManager 라이브러리는 JobScheduler를 사용하여 작업을 예약하고 실행합니다. 이러한 작업이 실행되는 동안 앱에 기여한 절전 모드가 유지됩니다. Background Task Inspector를 사용하여 백그라운드에서 실행되는 작업자와 작업을 모니터링하고 작업에 관한 세부정보를 확인할 수 있습니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 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,["# Debug wake locks locally\n\nThere are a number of tools you can use to debug a locally-running app that uses\nwake locks. These tools can help you identify and fix performance issues.\n| **Note:** [Some APIs acquire wake locks that are attributed to your app](/develop/background-work/background-tasks/awake#actions-keep). This means your app might be using wake locks even though you aren't writing that code explicitly. If your app has mysterious performance issues, it can be helpful to check if there are misbehaving wake locks. If your app is holding wake locks and you don't recognize the names, [Identify wake locks created by other APIs](/develop/background-work/background-tasks/awake/wakelock/identify-wls) can help you identify the API that might have created them.\n\nThe following tools can help you debug or optimize your wake locks:\n\n- [dumpsys](#dumpsys) provides information about the status of system services on a device.\n- [System tracing](#system-tracing) produces a trace file that you can use to generate a system report.\n- The Android Studio [Background Task Inspector](#bg-task) helps you to monitor wake locks, including wake locks that might be acquired by libraries like WorkManager.\n\n### dumpsys\n\n[dumpsys](/tools/dumpsys) is a tool that runs on Android devices and provides\ninformation about the device's system services.\n\nThe following command is particularly useful for debugging wake locks:\n\n- `adb shell dumpsys batterystats` provides a detailed history of wake locks held by each app. For more information, see the dumpsys [Inspect battery\n diagnostics](/tools/dumpsys#battery) documentation.\n\n### System tracing\n\n[System tracing](/topic/performance/tracing) records a wide range of device activity\nover a short period. System tracing produces a *trace file* that you can use to\ngenerate a system report. This report helps you identify ways to improve your\napp's performance.\n\nFor information on how to get started, see this [system tracing quickstart\nguide](https://perfetto.dev/docs/quickstart/android-tracing). You can also watch [this video on improving\nAndroid battery efficiency](https://youtu.be/jS46zP8kQ3k?si=BCteWawO-rK7EAGl).\n\n### Background Task Inspector\n\nYou can use Android Studio's\n[Background Task Inspector](/studio/inspect/task) to monitor [wake locks,\nalarms and jobs](/studio/inspect/task#inspect-jobs-alarms-wakelocks).\n\nIn particular, the WorkManager library uses JobScheduler to schedule and execute\njobs. While these jobs are running, they hold a wake lock that is attributed\nto the app. You can use Background Task Inspector to monitor workers and jobs\nthat execute in the background and see details about their work."]]