At Couple, we found a much simpler solution to debug this exact same bug two days ago, and there was no driving needed:
1. Add lock code to your phone
2. Open the app without a debugger attached and start monitoring for significant location changes
3. Minimize app
4. Turn off iPhone
5. Turn iPhone back on.
Now if you wait 3-5 minutes in the same spot, your app will be woken up and will get a significant location change. Much simpler than driving and easily reproducible in the office.
Now to know when the app actually wakes up while you're in the lock screen, I added a local notification as part of the startup process. Now we just keep the phone locked for a few minutes until it shows the local notification, then you unlock it and see the logout problem.
Nah, it was something between a lucky hunch and laziness. The backup plan was to test it an hour later when leaving the office for lunch but the restart worked. I actually realized it had to do with significant location changes early on since it was the new thing we added.
By the way, in general this isn't a reboot specific bug, the most secure setting is actually not the "allow after unlock" one but the one that gives no access to keychain if your phone is locked at any time. I noticed that keychain starts refusing access 15 seconds after you lock the phone but most apps keep their credentials in memory after they're read and the problem appears at reboots only.
1. Add lock code to your phone
2. Open the app without a debugger attached and start monitoring for significant location changes
3. Minimize app
4. Turn off iPhone
5. Turn iPhone back on.
Now if you wait 3-5 minutes in the same spot, your app will be woken up and will get a significant location change. Much simpler than driving and easily reproducible in the office.
Now to know when the app actually wakes up while you're in the lock screen, I added a local notification as part of the startup process. Now we just keep the phone locked for a few minutes until it shows the local notification, then you unlock it and see the logout problem.
Hope that helps everyone else!