Adding Unit Tests to an already existing project?

前端 未结 7 1411
不知归路
不知归路 2020-12-02 16:45

When you create an XCode 4 project, it asks you if you want to include unit testing. But how do you add it to a project that\'s been created without them?

I started

7条回答
  •  爱一瞬间的悲伤
    2020-12-02 17:18

    Xcode 7 update

    Method one

    File > New > Target...

    Choose iOS Unit Testing Bundle. (If you want to add UI Testing then choose the UI Testing Bundle.)

    Method two

    Click your project name in the Project Navigator. You will see TARGETS listed. At the bottom of the screen press the plus (+) button and add the iOS Unit Testing Bundle.

    The test targets in this image have already been added, but you can see where the add button is.

    Related

    • How to do a Unit Test in Xcode
    • Xcode UI Test example

提交回复
热议问题