0

Does anyone know how to programmatically lock the iPhone on iOS? I don't care if it involves using private API or framework as it's for personal use.

I have tried using https://github.com/neuroo/LockMeNow but it doesn't work on my device (running iOS 10). I guess it's for iOS 5 and below only. Does anyone have an updated method that works on newer versions of iOS?

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

My iPhone 5 lock button is not working properly, so I wrote this application.

If that is the issue, there is a better way. Turn on AssistiveTouch.

You'll find it in

General -> Accessibility -> AssistiveTouch

I use that because all my buttons aren't working and it's very easy to get used to. I know this doesn't strictly answer your question, but it may solve your problem. I hope it helps.

Erik B
  • 40,889
  • 25
  • 119
  • 135
  • Question says `how to *programmatically* lock the iPhone...` – SomeAndroidProgrammar Jan 26 '17 at 12:15
  • Yes, but the only reason I could think of for doing that is that the lock button isn't working. Especially since you said that it was for personal use only. Why else would you need to lock your phone programmatically? – Erik B Jan 26 '17 at 17:48