You may have encountered the "Unlock iPhone to use accessories" message when connecting a cable or peripheral. This isn't a bug: it's part of USB Restriction Mode , an Apple security layer that prevents your iPhone or iPad from communicating with accessories when the screen is locked. The goal is simple: to protect your data from unauthorized access via cable. Let's talk about the iPhone USB Restriction Mode: what it is, how to activate it, and top accessories.
This article explains exactly what the iPhone USB passcode blocker is, how to activate or adjust it for your specific model, what to do when warnings or errors appear, and what options you have if you've forgotten your passcode. You'll also find recommendations for compatible accessories to minimize problems and maintain security without sacrificing convenience.
What is iPhone USB Blocker (USB Restriction Mode)
Apple introduced this system in iOS 11.4.1 and reinforced it in iOS 12 so that, when the device is locked, the port prevents data transfer with wired accessories like USB or Thunderbolt. However, there are some nuances: if you connect the iPhone to an official USB power adapter, it will continue to charge normally even when the screen is locked.
When the iPhone is locked, communication with the accessory is not established, and it may appear to be malfunctioning or not charging when connected to a computer. After unlocking the device, the accessory is authorized for a period of time and will continue to function even if the iPhone is locked again later.
If you find that, despite entering your passcode or authenticating with Face ID/Touch ID, the accessory still doesn't appear, there's a trick that usually solves the problem: disconnect it, unlock your iPhone first, and then reconnect the accessory. It's a simple sequence that re-establishes secure wired negotiation.
Important: With storage accessories (for example, certain USB flash drives or readers), Apple requires that your iPhone or iPad be unlocked before you can use them. By design, these types of peripherals always require prior authentication.
How to turn on, turn off, or adjust Wired Accessories on iPhone and iPad
In current models, Apple has moved the setting to a location more aligned with system security. To review the setting, go to Settings > Privacy & Security > Security > Wired Accessories . Depending on your model and iOS/iPadOS version, you'll see an option to allow or restrict the use of accessories when the device is locked.
On devices with older versions, the switch may appear in Settings > Face ID & Passcode (or Touch ID & Passcode) under the Allow Access When Locked section, as a USB Accessories option . If this path seems familiar, don't worry; Apple has maintained this behavior even though they've reorganized the menus in more recent versions.
Practical recommendation: Unless you have a very specific need, it's not advisable to disable USB Restricted Mode. Keeping it active adds a layer of security against unauthorized wired connection attempts, without preventing your iPhone from charging normally using a USB power adapter.
If the accessory doesn't respond after unlocking your iPhone, try Apple's recommended sequence: disconnect, unlock, and reconnect . This will force a new authorization process. And remember: with storage devices, unlocking is required by system policy.
The message "Unlock iPhone to use accessories" is common when the device has been locked for a long time or if the accessory is untrusted. Once you unlock it, the system allows the connection for a period of time, and if you see the message again later, simply authenticate again.
Pair, trust, and distrust host computers
When you connect an iPhone or iPad to a Mac or PC for the first time, a prompt appears asking you to establish a trust relationship with the computer . If you accept and enter your passcode, all future connections to that same host will be trusted until they are revoked or expire.
If you want to clear these relationships for security reasons, go to Settings > General > Reset > Reset Location & Privacy. Doing so will delete the trusted records for pairing, which also automatically expire if not used within 30 days.
This mechanism is key for processes such as sharing internet access, using self-service kiosks to update software, or performing backups. Controlling which computers your iPhone or iPad can connect to preserves the balance between convenience and security.
A note for iPads with Thunderbolt: the pairing/trust process works the same as with USB. If you reject the trust, the device will not share data with that computer, although it will continue to charge if the source is a charger.
Security on Mac: Restricted Mode for Accessories on macOS

Macs with Apple chips and macOS 13 or later include their own protection for wired accessories (known as Restricted Mode). By default, the system prompts the user for permission to connect new accessories . This policy applies to USB, Thunderbolt, and, starting with macOS 13.3, also to SDXC cards.
If you connect an unknown accessory to a locked Mac , the system will ask you to unlock the computer. Once approved, that accessory can connect to the locked Mac for up to 3 days after the last lock. After that time, you'll see the message: "Unlock to use accessories."
In managed environments, IT departments may need to bypass user authorization. To do this, MDM solutions allow you to control the existing restriction. allowUSBRestrictedMode to always allow the connection of wired accessories.
This consistency between iPhone, iPad, and Mac creates an ecosystem where protection against close-range (wired) attacks is consistent, while also offering centralized management options for businesses.
Advanced management (MDM) and additional protection measures
On supervised devices (managed by an organization), administrators can decide whether iPhones and iPads can trust hosts other than Apple Configurator. If host binding is disabled and appropriate monitoring identities are distributed , only computers with a valid host certificate will be able to access the device via USB or Thunderbolt.
Since iOS 14.5 and iPadOS 14.5, an unpaired computer can no longer reboot a device into recoveryOS or restore it without direct physical interaction. Previously, someone with access to a cable and a computer could erase a device without touching it. This limitation adds a significant barrier against unauthorized restores.
Furthermore, the ability to put an iPhone or iPad into recovery mode from an unlinked host is restricted by default to trusted hosts. Organizations that require this can enable it with the corresponding MDM policy, assuming the risk associated with relaxing this protection.
Another interesting point: If you use a compatible Ethernet adapter, the iPhone or iPad can maintain an active network connection even before the first unlock, as long as the specific restriction is disabled. This is useful for an MDM to send commands (for example, for remote wiping ) when Wi-Fi or cellular data is unavailable.
In any case, the "USB Restricted Mode" setting can be managed from the MDM on supervised devices or by the user, either from Privacy & Security > Security > Wired Accessories or from Face/Touch ID & Passcode > USB Accessories , depending on the iOS/iPadOS version.
Messages, errors and how to solve them

If you see the message "Unlock iPhone to use accessories" when you plug a cable into a computer or hub, it's most likely because your iPhone has been locked for more than an hour or the accessory isn't trusted. Once you unlock it, the system allows access to that peripheral for a limited time, after which it may ask you to authenticate again.
What to do if it's not recognized after unlocking: Try Apple's recommended cycle (disconnect, unlock, reconnect). If the problem persists, confirm that you're using a certified (MFi) cable or hub and avoid accessories of dubious quality that often trigger compatibility warnings.
Why it won't charge when connected to a computer: Charging via a PC/Mac port can be limited when the device is locked and the system doesn't authorize the connection. With an official USB power adapter, the iPhone will still charge even when locked.
Trusting the computer: When you first connect an iPhone to a Mac or PC, unlock the device and accept the trust prompt. If you don't trust it, no data will be transferred; if you trust it, that computer will remain approved until you delete the relationship or it expires due to inactivity (30 days).
Remove trust: Settings > General > Reset > Reset Location & Privacy. Use this if you sell your iPhone, no longer use that PC, or suspect a trusted relationship you don't recognize.
If you forgot your code: official options to recover access
If you don't remember your passcode, you won't be able to disable USB Restricted Mode until you erase or recover your device. The standard way to restore your iPhone is to use Recovery Mode . You'll need a Mac or PC running Windows 8 or later and a working cable to connect your phone.
General steps for recovery mode: Turn off your iPhone, enter recovery mode (the process varies depending on the model), connect it to your computer, and select Restore when the option appears in Finder or iTunes. The process will download the firmware and erase all content . Afterward, you can set up your iPhone again and restore from a backup if you had one.
Important for macOS Catalina and later: iTunes is now separate into Music, Podcasts, and TV. To restore an iPhone on recent macOS, you'll need to do so from Finder, not iTunes. On older Windows or macOS systems, iTunes is still the tool for this process.
Use Find My: If you have Find My enabled and location services turned on, you can erase your iPhone from another Apple device using the same Apple ID or from iCloud.com. Afterward, you can set it up again and restore data from iCloud if you had backups.
Backup tip: Any method that erases your iPhone will delete local data. It's highly recommended to keep backups in iCloud or on a computer to minimize data loss if you forget your passcode.
Third-party tools: what they promise and what you should know
There are third-party utilities that can unlock your screen when you've forgotten your passcode. Among the best-known are Dr.Fone (Screen Unlock Module), AnyUnlock, and FoneLab iOS Unlocker. They are typically compatible with Mac and Windows, support 4- and 6-digit passcodes , Face ID, and Touch ID, and provide guidance on entering Recovery or DFU mode and downloading firmware.
What you should know: These processes remove the lock by erasing or overwriting the system, so it's common to lose local data. Also, in many cases, you'll need your Apple ID to complete the setup if Find My is enabled . There are no magic tools that will preserve everything and bypass authentication when the device is properly secured.
Dr.Fone – Screen Unlock: stands out for its step-by-step wizard. The typical workflow is to install the app, connect your iPhone, select the unlock mode, enter recovery/DFU mode, download the firmware, and then remove the passcode . After restarting, you can set up your device from scratch or restore from backups.
AnyUnlock: focuses on removing various locks (passcode, Face ID/Touch ID, MDM locks, SIM, iCloud, etc.). The approach is similar: connect, detect model, download firmware package, and run the guided unlocking process . It requires keeping the iPhone connected throughout the procedure.
FoneLab iOS Unlocker: In addition to removing the screen passcode, it promises to delete Apple IDs and passwords and manage usage time in seconds. The interface is simple and guides novice users with on-screen instructions, although the same warning about data erasure applies here as well.
Recommendation: Always prioritize official channels (Finder/iTunes or Search) and use these tools only if you understand the implications, accept the loss of data, and do not violate activation lock measures that protect your account.
Best accessories and good practices to avoid problems
Certified cables and chargers: Choosing MFi-certified products reduces incompatibility warnings and improves stability. A reliable cable prevents false "accessory not supported" messages and minimizes the percentage of failed connections to the computer.
High-quality USB/Thunderbolt hubs and adapters: Hubs with their own power supply and clear standards (USB 3.x, Thunderbolt) tend to be less problematic with iOS devices. If you work with audio, video, or external storage , prioritize well-known brands and transparent specifications.
Official or MFi-certified card readers and camera adapters: For importing photos or videos or connecting an iPhone to a projector , Apple's Lightning to USB 3 Camera Adapter or USB-C card readers for iPad offer better compatibility. Remember that your iPhone/iPad must be unlocked to mount or read external storage.
Compatible Ethernet adapters: These can be useful in enterprise deployments, especially if you need the device to receive MDM commands without Wi-Fi or mobile data before the first unlock. Ensure that the relevant policy does not restrict this for security reasons.
Best practices: Unlock your iPhone before connecting accessories that transfer data, only trust computers you know, remove old trust relationships, and avoid disabling USB Restricted Mode unless absolutely necessary. Following these guidelines will reduce warnings like " Unlock iPhone to use accessories " and keep risks at bay.
Quick FAQ
Why won't my iPhone charge when I connect it to my PC? Because when it's locked, the system limits data communication; with an official USB charger, it will continue to charge without any problem even if you don't unlock it.
How do I get rid of the constant warning about using a hub? Unlock your iPhone, disconnect and reconnect the hub; if the problem persists, check if the hub is MFi certified and try a higher-quality cable . Re-authorize the computer if necessary.
Can I disable USB Restricted Mode? You can, but it's not recommended for security reasons. The current path is in Settings > Privacy & Security > Security > Wired Accessories (or Face/Touch ID & Passcode > USB Accessories in earlier versions).
What happens on a Mac with new accessories? On macOS 13+, the system requests permission, and if your Mac is locked, it will ask you to unlock it to use them . Approved accessories will work with a locked Mac for up to 3 days.
The USB blocker on iPhone and iPad is a measure designed for you, not against you: it prevents unauthorized access without hindering charging, gives you fine-tuning options in Settings, and, in business environments, enables robust management with MDM. By properly configuring wired accessories, relying only on secure devices, and using quality accessories , you'll experience fewer alerts, greater compatibility, and the peace of mind that your data remains protected.
Table of Contents
- 1 What is iPhone USB Blocker (USB Restriction Mode)
- 2 How to turn on, turn off, or adjust Wired Accessories on iPhone and iPad
- 3 Pair, trust, and distrust host computers
- 4 Security on Mac: Restricted Mode for Accessories on macOS
- 5 Advanced management (MDM) and additional protection measures
- 6 Messages, errors and how to solve them
- 7 If you forgot your code: official options to recover access
- 8 Third-party tools: what they promise and what you should know
- 9 Best accessories and good practices to avoid problems
- 10 Quick FAQ

