Unlock your device
Starting with iOS and iPadOS, if you use USB accessories with your iPhone, iPad, or iPod touch, or if you connect your device to a Mac or PC, you might need to unlock your device for it to recognize and use the accessory. Your accessory then remains connected, even if your device is subsequently locked.
If you don’t first unlock your password-protected iOS or iPadOS device—or you haven’t unlocked and connected it to a USB accessory within the past hour—your iOS or iPadOS device won’t communicate with the accessory or computer, and in some cases, it might not charge. You might also see an alert asking you to unlock your device to use accessories.
If the USB accessory is still not recognized after you unlock your device, disconnect your device from the accessory, unlock your device, and then reconnect the accessory.
Your iPhone, iPad, or iPod touch charges as usual when it’s connected to a USB power adapter.
Allow access to USB accessories
You can allow your iOS or iPadOS device to always access USB accessories, for example, if you use a USB assistive device to enter your passcode on your locked iPhone. Many assistive devices will automatically turn on the setting to allow USB devices the first time they’re connected.
If you don’t connect to USB accessories regularly, you might need to turn on this setting manually.
In Settings, go to Face ID & Passcode or Touch ID & Passcode, and turn on USB Accessories under Allow Access When Locked.
When the USB Accessories setting is off, as in the image above, you might need to unlock your iOS or iPadOS device to connect USB accessories.
Administrators can control the USB Accessories setting on supervised iOS or iPadOS devices using Apple Configurator or mobile device management.