Putting iPhone passcode into Xcode, so I wouldn't need to unlock my iPhone for every build?

Is there a way that I could put my iPhone lock code into Xcode, so I wouldn't need to unlock my iPhone for every build?

It gets really frustrating that I need to physically unlock my iPhone before every build.

I know for developing on android they allow you to put the device in dev mode, which restricts the device from sleeping.


Could everyone please report this as a bug?

As it stands, you either put up with it, or much worse, turn off locking. Neither option is good.

If the iOS device is in developer mode, and connected to an active Xcode instance, Xcode should be able to keep the phone unlocked.

That way you not only can leave locking on, but it will re-lock the instant you disconnect.


You can prevent the device from sleeping in Settings → General → Auto-Lock → Never. This means the device will stay unlocked and you won't need to unlock it. As I'm jailbroken, I have this set automatically when my device is connected to a computer with Xcode running, but changing this setting manually will also work fine.

Alternatively, you can set Settings → Passcode → Require Passcode to a longer interval so that your passcode isn't required if you need to unlock it. Don't forget to reset this setting back to its original setting after you finish developing.