There are some iPhone access methods that use a USB connection, downloading data from your iPhone (or iPad) through the Lightning connector to crack the passcode.
iOS 12 prevents this by disabling data access to the Lightning port if it's been more than an hour since your iOS device was last unlocked.
This feature is enabled by default, but there are some situations where you might want to turn it off, such as when using CarPlay to drive long distances when you might not be able to unlock your iPhone for a few hours. Here's how to access the setting:
- Open the Settings app.
- Choose Touch ID & Passcode or Face ID & Passcode, depending on the device.
- Enter your passcode to access the settings.
- Scroll down to the bottom of the app where it says "USB Accessories."
- Leave it toggled off to disable access to your iOS device if you want it to refuse USB connections if it's been more than an hour since the iPhone or iPad was unlocked.
- Toggle it on if you want USB accessories to be able to connect even if it's been more than an hour since the iPhone or iPad was unlocked.
In normal usage, most of us unlock our iPhones every hour or two, and if you do need to plug your iPhone or iPad into a computer to access it, you can just enter your passcode to allow data access if it's been over an hour since the iPhone was last unlocked.
Right now, in the iOS 12 beta, these USB restrictions do appear to shut down access to a wired CarPlay interface after an hour, so that's one exception where people might want to turn this setting on to disable the restrictions on the USB port. From the iOS 12 beta notes:
"If you use iPod Accessory Protocol (iAP) USB accessories over the Lightning connector (such as CarPlay, assistive devices, charging accessories, or storage carts) or you connect to a Mac or PC you might need to unlock your device to recognize the accessory."Note: Even if data access to USB port has been disabled because it's been over an hour since an iPhone was last unlocked, it continues to be able to charge through a standard Lightning cable because the power connection is not disabled.