Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: how to run XCTest on device?

I currently learning XCTest for the purpose of unit testing. I was able to run the default template XCtest on the simulator without any problem. I could all the green ticks in the test navigation view. However, when I ran them on the device with my app as host application, nothing happens. My app was launched on the device and the XCTest did not seem to run. I even put a break point in the test and it did not break. Also, in the simulator, the app automatically stops when tests finish, however, when running on device, my app was just kept running and never put to a stop. Am I doing something incorrect?

like image 847
crab oz Avatar asked Mar 17 '23 17:03

crab oz


1 Answers

xCode should show this message when running XCTest on a physical device.

Logic Testing on iOS devices is not supported. You can run logic tests on the Simulator.

like image 78
ajmccall Avatar answered Mar 27 '23 17:03

ajmccall