I working on Xcode 6. When I coding XCTest, Xcode has been crash. When I reopen my Xcode, and it lost little diamond run button.
It should be:
But it got:
I open other project and it don't have this error. But when I create new target, it get same error (in other project).
I checked Target Membership, but it checked in target name. When I choose Test in Product>Test it run but the button not show.
Thank a lot, sorry for my bad english.
1.Click on the test file(unit test or UI test file) 2.Go to right panel and You'll see target membership. 3.Select Unit test and all would be good to go.
In case you disabled indexing earlier,
Close all Xcode and Simulator instances
Delete this setting
defaults delete com.apple.dt.Xcode IDEIndexDisable
Restart Xcode
This should reenable indexing and should bring back the individual test button (diamond shaped) in the subsequent Xcode launch.
A possible answer for some - I had added a new scheme in my XCode, but the tests were only in the original scheme. Switching back to the original scheme re-instated my tests.
My issue was file was not included in the workspace. If not included, go to finder and drag and drop to that folder.
Solution that is working for me in Xcode 13 , SWIFT 5 :
Open another Xcode file and then open the file wth your function again, the button should appear then.
I just re-started my Xcode and it worked. as everything was set-up the way it should be !!
Prefix func name with test
example test function name:
secondExample() must be **testSecondExample()**
then clean the build file use this shortcut key command + shift + k
Need More description? But Try following troubleshooting... check Target Membership of test file
Go to,
Xcode > Window > Projects
click on the delete button for derived data. Close XCode and open again. You should be good to go.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.