In the interests of enhanced privacy, some third-party iOS apps include an option to require passcode or Face ID authentication before they can be opened, even though the iPhone is already unlocked. This puts the app's contents behind an additional layer of security, but not all apps offer the same facility.

iphone passcode green
Until recently, Apple did not offer a way to individually lock sensitive apps like Photos, and iPhone users had to resort to Screen Time's App Limits as a workaround. Fortunately however that's no longer the case, because you can now create an additional security barrier for any app on your iPhone using a shortcut action that's included in iOS 16.4 and later.

Apple has added several more actions to the Shortcuts app, and the one that interests us here is Lock Screen. The Lock Screen action essentially allows you to set up a personal automation that automatically locks your iPhone when a specified app is opened.

Of course, this action should pose no access issues for you as the iPhone owner, but it does mean that anyone else trying to open the app first needs to pass facial authentication or enter your passcode even though your iPhone was unlocked when they tapped the app icon.

The following steps guide you through the process of setting up a personal automation that will instantly lock your iPhone when the app of your choosing is opened.

  1. Launch the Shortcuts app, tap the Automation tab at the bottom of the screen.
  2. Tap the + button in the top-right corner, then scroll down the menu of options and choose App.
  3. On the next screen, tap Choose to select an app from the list of apps, then tap Done.
  4. Make sure Is Opened and Run Immediately are selected, then tap Next.
    shortcuts

  5. Start typing "Lock Screen" into the text field and select Lock Screen when it appears in the results below.
  6. You should see your new automation "When [app] is opened, Lock screen" added to the Automations list.
    shortcuts

Your personal automation is now complete and should automatically spring into action the next time you open the chosen app.

Top Rated Comments

multipasser Avatar
27 months ago
oh waw!!!! so easy and userfriendly.

Ffs.. without a how-to not a single user will ever figure this out.
Score: 29 Votes (Like | Disagree)
klasma Avatar
27 months ago
Hopefully Apple will add this as a simple app toggle in Settings at some point.
Score: 29 Votes (Like | Disagree)
klasma Avatar
27 months ago
You’d probably also want to do this for the Shortcuts app itself, to prevent someone from disabling the automation.

Edit: And it turns out you can’t do that, see downthread.
Score: 23 Votes (Like | Disagree)
klasma Avatar
27 months ago

This workaround sounds promising -- but doesn't it just use the same spied passcode that thieves used to unlock the phone in the first place?
The use case here is when you give someone your unlocked phone, e.g. to play a game, that they don’t also get access to your sensitive data. Or when you leave your phone unlocked for a minute somewhere by accident.

This will be fun for law enforcement trying to inspect your phone, by the way.
Score: 18 Votes (Like | Disagree)
ignatius345 Avatar
27 months ago
This workaround sounds promising -- but doesn't it just use the same spied passcode that thieves used to unlock the phone in the first place?
Score: 16 Votes (Like | Disagree)
smythey Avatar
27 months ago
Must get my head around shortcuts sometime.....
Score: 15 Votes (Like | Disagree)

Popular Stories

maxresdefault

No iOS 19: Apple Going Straight to iOS 26

Wednesday May 28, 2025 11:56 am PDT by
With the design overhaul that's coming this year, Apple plans to rename all of its operating systems, reports Bloomberg. Going forward, iOS, iPadOS, macOS, tvOS, watchOS, and visionOS will be identified by year, rather than by version number. We're not going to be getting iOS 19, we're getting iOS 26. Subscribe to the MacRumors YouTube channel for more videos. iOS 26 will be accompanied by...
iPhone 17 Pro Blue Feature Tighter Crop

iPhone 17 Pro Launching Later This Year With These 12 New Features

Tuesday May 27, 2025 9:10 am PDT by
While the iPhone 17 Pro and iPhone 17 Pro Max are not expected to launch until September, there are already plenty of rumors about the devices. Below, we recap key changes rumored for the iPhone 17 Pro models as of May 2025: Aluminum frame: iPhone 17 Pro models are rumored to have an aluminum frame, whereas the iPhone 15 Pro and iPhone 16 Pro models have a titanium frame, and the iPhone X ...
Generic iPhone 17 Feature With Full Width Dynamic Island

iPhone 17 Display Sizes: What to Expect

Thursday May 29, 2025 11:38 am PDT by
Apple's iPhone 17 lineup will include four iPhones, and two of those are going to get all-new display sizes. There's the iPhone 17 Air, which we've heard about several times, but the standard iPhone 17 is also going to have a different display size. We've heard a bit about the updated size before, but with most rumors focusing on the iPhone 17 Air, it's easy to forget. Display analyst Ross...
28 years later iphone 1

Filmmakers Used 20 iPhones at Once to Shoot '28 Years Later'

Friday May 30, 2025 7:27 am PDT by
Sony today provided a closer look at the iPhone rigs used to shoot the upcoming post-apocalyptic British horror movie "28 Years Later" (via IGN). With a budget of $75 million, Danny Boyle's 28 Years Later will become the first major blockbuster movie to be shot on iPhone. 28 Years Later is the sequel to "28 Days Later" (2002) and "28 Weeks Later" (2007), which depict the aftermath of a...
macOS 26 visionOS Inspired Feature

macOS 26 Rumored to Drop Support for These Five Macs

Thursday May 29, 2025 5:31 am PDT by
The next major version of macOS, now dubbed "macOS 26," is rumored to drop support for several older Intel-based Mac models currently compatible with macOS Sequoia. According to individuals familiar with the matter cited by AppleInsider, the following Macs will not be supported by the next version of macOS: MacBook Pro (2018) iMac (2019) iMac Pro (2017) Mac mini (2018) MacB...
iOS 26 Mock Rainbow Feature

With iOS 18 Jumping to iOS 26, Will Apple Renumber iPhones Too?

Thursday May 29, 2025 1:59 pm PDT by
With the next-generation version of iOS and other 2025 software updates, Apple is planning to change its numbering scheme. Rather than iOS 19, which would logically follow iOS 18, Apple is instead going to call the update iOS 26. Apple plans to use 26 across all of its platforms (the number representing the upcoming year), which will presumably be less confusing than having iOS 19, macOS 16,...
iPhone Top Left Hole Punch Face ID Feature 2

Apple Rumored to Redesign the iPhone Every Year Through to 2027

Tuesday May 27, 2025 5:17 am PDT by
Apple is reportedly preparing to implement significant iPhone hardware redesigns each year for the next three generations. According leaks from the Chinese supply chain disclosed by Weibo user "Digital Chat Station," Apple plans to carry out a series of phased industrial design changes affecting different parts of the iPhone across three consecutive years: 2025, 2026, and 2027. The changes...