How to automatically disable iPhone lockscreen when charger is connected

This tip only works with jailbroken phones, sorry.

Android has this cool panel where you can let your device screen stay awake if and while the charger is connected. This is pretty nifty when writing an app and you want to keep the screen on while observing changes. Of course you only want this while connected to the AC adapter so the screen won't drain your battery.

However, iOS does not have this setting anywhere on a clean iOS setup or  even on a default jailbroken device. Follow these steps to allow your device to keep the screen lit up while connected to the charger:

  1. Jailbreak your device.
  2. Open Cydia and install the following packages:
    • Activator
    • SBSettings
  3. After the reboot, open Activator app.
  4. The first screen of Activator shows you context of where you are in the device. Tap on Anywhere.
  5. The next screen is a list of events you want to add an action to. Scroll down to the Power section and tap Connected
  6. The next screen is a list of actions you can run when the Power is Connected. Scroll down to the Switches (Deactivate) section and select Auto Lock.

    Make sure to select the deactive version with the red icon under Switches (Deactivate), not the green one under Switches (Activate).

Voila! Now, when you connect your charger, your iPhone's screen will stay awake unless you explicitly put it to sleep using the power button. We also need to restore the screen lock setting when the power is disconnected. I'll leave that as an exercise for you. It should be pretty similar to steps 4-6 above.

This is just a taste of the power of Activator and SBSettings together. Combined, they can automate a lot of stuff (settings toggle, app shortcuts, music controls, etc) triggered by device events (shake, pinch or swipe, status bar tap, etc). Have fun exploring!