UITest on device seems very slow

I have a simple UITest that excercises some simple functionaltiy of my app. Due to the dynamic nature of the app, I scan for an array of tappable elements with specific accessibilityIdentifer prefix, tap one, scroll its content some random number of times, tap the next one, scroll its content, etc.


In 10.3 Simulator (running in Xcode 9.1 on a Mac Mini), this test finishes in about 10 minutes.

On 10.3 device (iPad 2, in this case), this test finished in 1 hour 10 minutes.

This time differential seems excessive to me.

Object discovery appears to be the main culprit in the slowness.

What are ways to ensure on-device testing is efficient?

Any specific API calls that should be avoided?

I'm sure there are optimizations I can perform on my test code, but given the relative quickness of Simulator runs I have been opting for correctness over speed. Are hardware UITest runs more susceptible to inefficiencies in testing code?