Testing Core Bluetooth Suspended Operation

It seems apps will never truly be suspended when debugging.

Is this true? Is there ANY way to accurately test apps that need to go through full suspended + wakeup states while connected to XCode debugger?

Answered by Engineer in 822995022

It will depend on what exact APIs you are using, but in general things in the background run better if you run your app with a debugger attached.

This allows you to test that your background code behaves correctly, but should only be considered a best-case scenario.

To truly test the behavior of your app in the background, you would want to test on real use devices (not just ones used for debugging, because real life use also effects background behavior), and use old school debugging techniques like writing to logs, showing notifications or in your UI once the app is foregrounded again.


Argun Tekant /  DTS Engineer / Core Technologies

Accepted Answer

It will depend on what exact APIs you are using, but in general things in the background run better if you run your app with a debugger attached.

This allows you to test that your background code behaves correctly, but should only be considered a best-case scenario.

To truly test the behavior of your app in the background, you would want to test on real use devices (not just ones used for debugging, because real life use also effects background behavior), and use old school debugging techniques like writing to logs, showing notifications or in your UI once the app is foregrounded again.


Argun Tekant /  DTS Engineer / Core Technologies

Thanks Argun, that aligns with my experience. Was hoping there might be some way to force my app into a deep suspended state while debugging but its nice to get a confirmation that this is simply not possible.

Testing Core Bluetooth Suspended Operation
 
 
Q