[null,null,["最后更新时间 (UTC):2025-08-21。"],[],[],null,["# Use wake locks\n\nWhen it's necessary, you can use wake locks to keep the device from going to\nsleep.\n\nUnder some circumstances, you may need to keep the device awake even when your\napp is in the background. To do this, you can create a *wake lock*.\n\nYour feedback is a crucial part of improving our documentation. Please give us\nyour feedback using the following link:\n\n\n[Give feedback](https://docs.google.com/forms/d/e/1FAIpQLSc0OMFG-G88ZyHh_xwauaM2gimwP9-MFvRd6C49q0atZNpZ9w/viewform?usp=dialog)\n| **Note:** Creating and holding wake locks can have a dramatic impact on the device's battery life. You shouldn't use wake locks if there are any suitable alternatives. For other options, see the [Choose the right API to keep the device awake](/develop/background-work/background-tasks/awake) documentation. If you do need to use a wake lock, make sure to hold it for as short a time as possible.\n\nThis guide explains the following areas:\n\n- [Set a wake lock](/develop/background-work/background-tasks/awake/wakelock/set)\n- [Release a wake lock](/develop/background-work/background-tasks/awake/wakelock/release)\n- [Follow wake lock best practices](/develop/background-work/background-tasks/awake/wakelock/best-practices)\n- [Debug wake locks locally](/develop/background-work/background-tasks/awake/wakelock/debug-locally)\n- [Identify wake locks created by other APIs](/develop/background-work/background-tasks/awake/wakelock/identify-wls)\n\nThis guide assumes you're familiar with the following topics:\n\n- [Choose the right API to keep the device awake](/develop/background-work/background-tasks/awake)\n- [Request runtime permissions](/training/permissions/requesting)"]]