Automating/scripting login for iOS Simulator

We’re using XCode, Apple’s iOS Simulator, and Appium/Selenium for our testing. Things work reasonably well, albeit rather slowly.

Regularly, the iOS Simulator wants to be logged in again, requiring id and password. Of course, I can’t get there quite in time, so the test fails (can’t create session) and I have to start things over, wasting another few minutes.

Has anyone found a way to script this? If so, I could just run the script every few hours and avoid the hassle and interruptions in flow.