Don't launch simulator when running unittests

前端 未结 6 1432
悲哀的现实
悲哀的现实 2020-12-07 17:44

Some background:

I have iOS application with a target configured to run unitTests. And I am running build automation tool jenkins on my MacBook whic

6条回答
  •  春和景丽
    2020-12-07 18:04

    You can create a Mac OSX Unit Test instead of an iOS unit test. This requires that you not include any iOS specific libraries in the unit tests though. You can do this via the following:

    1. Select the project -> the target drop down -> "Add Target..."
    2. Select "Mac OSX" -> "Other" -> "Cocoa Unit Testing Bundle"
    3. Create the testing bundle as you would a normal project

    You can now add sources to the unit test and run it like an iOS test without launching the simulator.

提交回复
热议问题