Running unit test without simulator

Is it possible to run business logic (e.g. non-UI) unit tests without triggering the simulator?
Someone said if I add all the tests into a framework, then it won't trigger the simulator. As a Swift beginner, not sure what that means. A framework in Swift is like a library in Java/.net?

UI tests involve simulators. Unit tests do not. You need to add a unit test target to your project. That's where you put your non-UI tests.

My unit tests do have a test target; when I created a new project in xcode, I choose "include test" option and it automatically created two test targets; one for unit test and one for UI tests. But even when I am running the unit tests, it still loads the simulator.

Whatever kind of target you have, running tests on iOS, unit or UI, necessarily involves running the simulator. If you want to make your framework cross platform and support macOS, you can run on that platform instead, but that's usually not a viable approach to the problem.

Terms of Service

Privacy Policy

Cookie Policy