How to Stop USB Devices from Waking a MacBook

Illustration for How to Stop USB Devices from Waking a MacBook

USB devices such as keyboards, mice, hubs, storage drives, and audio interfaces can sometimes wake a MacBook from sleep. To stop this, disconnect USB accessories one at a time to identify the device, disable relevant wake settings with Terminal if necessary, and check for connected hubs or peripherals that may be generating activity.

Quick Answer

  1. Disconnect all USB devices and put your MacBook to sleep.
  2. Reconnect the devices one at a time until the waking returns.
  3. Replace or disconnect the device that causes the problem, especially USB hubs, keyboards, mice, and external drives.
  4. In Terminal, check and change macOS power-management settings if USB devices continue waking the MacBook.
  5. If the Mac wakes immediately after sleeping, inspect the lid, charger, network-wake settings, and Bluetooth accessories too.

A USB device can wake a MacBook because it sends an input signal, reconnects through a hub, mounts a drive, or repeatedly loses and restores its connection. The exact cause is not always obvious, so testing the accessories separately is the safest first step.

Why USB Devices Wake a MacBook

A MacBook may wake when macOS detects activity from a connected accessory. Common examples include:

  • A mouse or keyboard registering movement or a key press
  • A USB hub repeatedly disconnecting and reconnecting
  • An external drive becoming available again
  • A device drawing power or changing its connection state
  • A faulty cable, adapter, or peripheral sending spurious signals
  • A monitor or dock waking and reestablishing its USB connection

A device does not necessarily need to be actively used to cause a wake event. A damaged cable, unstable dock, or sensitive mouse can create activity while the MacBook appears idle.

Before changing system settings, determine whether the problem follows a particular accessory. This avoids disabling useful power features or changing settings that do not address the actual cause.

Find the USB Device Causing the Wake

The most reliable approach is an isolation test. You do not need to install software or change system files.

1. Disconnect USB accessories

Save your work before disconnecting any device that may be in use.

  1. Eject external storage in Finder before unplugging it. In Finder, select the drive under Locations, then click the Eject button.
  2. Disconnect USB drives, hubs, docks, keyboards, mice, audio devices, card readers, printers, and other USB accessories.
  3. If you use a USB-C dock, disconnect the dock itself rather than removing every device connected to it.
  4. Close the lid or choose Apple menu > Sleep.
  5. Wait several minutes to see whether the MacBook remains asleep.

If the MacBook stays asleep with everything disconnected, a USB accessory, cable, adapter, or dock is probably involved.

2. Reconnect devices one at a time

Reconnect one accessory, then put the MacBook to sleep again. Allow enough time for the problem to appear before adding another device.

A useful order is:

  1. Keyboard or mouse
  2. USB hub or dock
  3. External storage
  4. Monitor or display adapter
  5. Printer, audio interface, camera, or card reader
  6. Any remaining accessory

When the MacBook starts waking again, disconnect the most recently connected item and test once more. If the wake behavior stops, that device or its connection is the leading suspect.

3. Test the cable and port

A device may be reliable with one cable or port but unstable with another.

  • Replace the USB cable with a known-good cable.
  • Connect the device directly to the MacBook instead of through a hub.
  • Try a different USB-C port.
  • Remove unnecessary adapters.
  • If a drive is bus-powered, connect it to a powered hub or use its own power adapter, if available.
  • Check the connectors for dust, bent pins, looseness, or visible damage.

If moving the device to another port fixes the problem, the original port, cable, or adapter may be involved.

Check Common Problem Devices

Some accessories are more likely than others to wake a MacBook.

Keyboards and mice

A mouse may send movement signals because of a sensitive sensor, vibration, or an uneven surface. A keyboard can also produce input if a key is stuck or the device is malfunctioning.

Test these accessories by:

  • Turning off a wireless mouse or keyboard
  • Disconnecting a wired keyboard or mouse before sleep
  • Moving the mouse to a stable surface
  • Replacing batteries in wireless accessories
  • Testing a different keyboard or mouse

If the MacBook sleeps normally without the mouse, keyboard, or receiver connected, replace or repair the accessory.

USB hubs and docks

Hubs and docks can cause repeated connection changes, particularly when several devices share one USB-C connection. A dock may also react when an external monitor, charger, network adapter, or storage device changes state.

To test a dock:

  1. Disconnect every device from the dock.
  2. Disconnect the dock from the MacBook.
  3. Put the MacBook to sleep.
  4. Reconnect the dock by itself and test again.
  5. Add the dock’s connected devices individually.

A dock that wakes the MacBook by itself may need a firmware update, a different power supply, or replacement.

External drives

External hard drives and solid-state drives can wake a MacBook when they spin up, remount, or briefly lose power. This is especially possible with bus-powered drives and loose cables.

Before disconnecting a drive, eject it in Finder. If the drive is the cause, try another cable, connect it directly to the MacBook, or use a powered hub. Do not unplug an actively used drive without ejecting it first, because doing so can corrupt open files or interrupt a transfer.

Review macOS Sleep and Wake Settings

The exact settings available can vary by Mac model and macOS release. Open System Settings, select Battery, and review the options under Options or related battery settings.

Look for options associated with:

  • Waking for network access
  • Power Nap
  • Preventing automatic sleep
  • Allowing accessories to connect while the Mac is locked or asleep

Turn off a setting only if it matches the behavior you are seeing. For example, a network-wake option is more relevant when the Mac wakes because of network activity, not when a physical keyboard or mouse sends input.

On some Mac models, settings may appear under System Preferences instead of System Settings. Do not change several unrelated options at once; changing one setting at a time makes the result easier to identify.

Use Terminal to Inspect Wake Settings

Terminal can show macOS power-management settings and help identify whether USB-related wake behavior is enabled. These commands do not delete files, but they display and change system power settings, so enter them carefully.

View the current power settings

  1. Open Terminal from Applications > Utilities.
  2. Enter:
pmset -g custom
  1. Press Return.

This displays power settings for available power profiles, such as battery power and power adapter use. Look for entries including womp, powernap, tcpkeepalive, and usbwake.

To view a summary of active power-management settings, use:

pmset -g

The output may also show recent sleep and wake information.

Check recent wake events

Run:

pmset -g log | grep -i "wake"

This filters the power-management log for lines containing “wake.” Depending on the Mac and macOS version, the output may identify a wake reason or show a device-related event. Log entries are clues, not always definitive proof of which accessory caused the wake.

You can also search for USB references:

pmset -g log | grep -i "usb"

If the results repeatedly show USB activity near the time of the unwanted wake, disconnect USB devices and repeat the isolation test.

Disable USB Wake with pmset

On some Macs, pmset exposes a setting named usbwake. If it appears in your configuration, you can try disabling it.

Warning: This changes system power behavior and may prevent some USB keyboards, mice, or other devices from waking the MacBook. Save your work first, and make sure you can wake and unlock the MacBook using its built-in keyboard, trackpad, lid, or power button.

Run:

sudo pmset -a usbwake 0

Enter your administrator password when prompted. The password will not appear on screen while you type it. Press Return when finished.

The -a option applies the setting to all power sources. The usbwake 0 portion disables the setting, if supported by the Mac.

Restarting the MacBook is not always required, but sleep and wake behavior may be easier to test after closing Terminal and choosing Apple menu > Sleep.

Restore the previous setting

To re-enable USB wake, run:

sudo pmset -a usbwake 1

If usbwake does not appear when you run pmset -g custom, the setting may not be available or may not control the behavior on your Mac. Do not add unrelated pmset options simply because they appear in examples online.

Disable Other Wake Features Carefully

If the MacBook wakes even with all USB devices disconnected, the cause may not be USB. Network access, Bluetooth accessories, a connected display, scheduled maintenance, or a lid sensor can also be involved.

You can inspect scheduled power events with:

pmset -g sched

This command only displays scheduled events. It does not change anything.

Some users try disabling several features at once, such as network wake, Power Nap, and TCP keep-alive. That makes troubleshooting harder and may remove useful functions. Change only the setting that matches the evidence from your testing.

If you decide to disable a setting, first record its current value with:

pmset -g custom

Then change only that setting and test sleep again. Restore the original value if the change does not help.

Troubleshooting USB Wake Problems

The MacBook wakes immediately after choosing Sleep

Disconnect every external accessory, including a dock, monitor adapter, and charger if practical. Then choose Apple menu > Sleep again.

If the MacBook still wakes:

  1. Check whether the lid is fully closed.
  2. Remove objects that could press against the keyboard or trackpad.
  3. Disconnect Bluetooth keyboards, mice, and controllers.
  4. Check for scheduled events with pmset -g sched.
  5. Review System Settings > Battery for wake-related options.

If it sleeps normally without accessories, reconnect them individually.

The MacBook wakes only when connected to a dock

Test the MacBook with the dock disconnected. Then update the dock’s firmware if the manufacturer provides an update, replace its cable, and test it with fewer attached devices.

A dock may also wake the MacBook when an external monitor changes input or when the dock’s power supply briefly resets. Testing the dock without the monitor and other peripherals can help separate these causes.

The MacBook wakes when an external drive is connected

Eject the drive and reconnect it directly to the MacBook with another cable. If the drive requires more power than the port can provide, use its dedicated power adapter or a suitable powered hub.

Do not disable USB wake as the first response if you regularly need a keyboard or other accessory to wake the MacBook. Fixing the drive’s connection is usually less disruptive.

The MacBook still wakes with USB wake disabled

The wake event may not be caused by USB. Disconnect Bluetooth accessories and displays, review network-wake settings, and check scheduled events.

For broader sleep and wake diagnostics, see How to Fix a Mac That Sleeps or Wakes Unexpectedly.

The MacBook runs hot after waking

A MacBook that wakes repeatedly may consume battery power and remain warm. Check Activity Monitor for apps using unusually high CPU after the wake, and close apps you recognize as unnecessary.

If a system process is consuming substantial CPU, avoid repeatedly forcing it to quit. Investigate the underlying sleep, peripheral, or software problem first. Persistent heat and performance issues may require separate troubleshooting, such as the steps in The kernel_task process overloads the MacBook.

Frequently Asked Questions

Can a USB keyboard wake a MacBook?

Yes. A USB keyboard can wake a MacBook when macOS is configured to respond to USB input. A stuck key, damaged cable, or failing keyboard can also produce unwanted wake events.

Should I unplug all USB devices before sleep?

You do not normally need to unplug every device. Disconnect accessories temporarily when diagnosing unexpected wakes or when a particular device repeatedly prevents the MacBook from staying asleep.

Will disabling USB wake stop all unwanted wakes?

No. It affects USB-related wake behavior only. Bluetooth devices, network activity, scheduled events, displays, lid sensors, and software can also wake a MacBook.

Is it safe to use sudo pmset?

pmset is an Apple command-line utility for power-management settings, but sudo gives the command administrative permission. Use only the specific command you understand, record the original setting, and restore it if necessary.

Why does a MacBook wake when a USB drive is connected?

The drive may reconnect, remount, spin up, or briefly lose and regain power. A faulty cable, overloaded hub, or insufficient power can make this more likely.

Final Thoughts

Start by disconnecting USB devices and reconnecting them one at a time. This usually identifies the problem without changing macOS settings. If the issue continues, test cables, hubs, docks, and external drives, then inspect power-management settings with pmset. Disable USB wake only when necessary, and restore the original setting if it does not solve the problem.