"Test under adverse device conditions (iOS) - Xcode Help"
``
Test your app on a connected device under a variety of device conditions while you profile your app.
Enable a network device condition and measure app metrics, such as time to launch the app, time for a user to sign in, and app responsiveness while fetching new content. To test how your app responds to changes in network quality, start an operation like streaming a video, and then enable or disable the condition.
Enable a thermal device condition and test as follows:
- Under the Fair profile, confirm that your app defers work that’s not immediately needed by the user, such as background threads and prefetching content. Don’t profile your app under the Fair profile—because the system also reduces background work, the performance measurements aren’t generally useful.
- Under the Serious profile, measure app metrics like frames per second during gameplay or while scrolling. Optimize your code until you’re able to meet your goal for each metric.
- Under the Critical profile, confirm that your app responds by quickly reducing its resource usage. For the signs of excessive energy use, go to Observe Signs of Energy Leaks in Energy Efficiency Guide for iOS Apps.
Your app’s response to thermal state is a balance between reducing its use of resources that produce heat or consume power, such as the CPU, GPU, and network, and maintaining the quality of your user experience. Apps that are resource intensive by nature, like games, can choose to reduce resource use enough to avoid a Critical thermal state and ensure that the app continues to be responsive, but not necessarily enough to return to the Nominal state. Apps that aren’t resource intensive and aren’t expected to cause a Fair or Serious thermal state can still encounter thermal constraints—for example, because the user has been running a resource-intensive app—and should still be tested under thermal device conditions.
Enable the device conditions you test under on a representative set of devices that matches the devices you support. Different hardware has different thermal characteristics, and needs different profiling work to optimize it. Optimizations that improve performance on one model of iPhone or iPad don’t necessarily have the same effect on other models.
When testing under a device condition, control the real-world conditions your test devices experience. You don’t want the real world to actually have a harsher condition than what the device condition is simulating. For example, ensure that devices have space around them so they can cool normally, rather than stacking devices on top of each other.
-"Test under adverse device conditions (iOS) - Xcode Help"