ios - How could I launch non-hosted test in Xcode 7.3? -
i have unit test (not ui tests) , launching app along tests undesirable. read so-called non-hosted tests , sounds suitable here. however, trying launch non-hosted test on xcode 7.3 faced 1 serious problem - complains classes in app being tested couldn't found linker.
what have read , tried:
app delegate substitution based on launch arguments - undesirable since forces app know tests (tight coupling, broken encapsulation etc...) , launch app along test (even though doing nothing)
xcode 5 unit testing: starts app - tried every answer here , don't work except changing classes target membership not option since changing target membership manually error-proned , becomes difficult when project grows
apple's outdated guide - nope
xcode test target host application forces wrong target build section of scheme - nope
https://stackoverflow.com/a/22024428/2305175 - nope
manually creating unit test target explicitly setting target tested
none - nope
how run non-hosted tests without changing classes target membership, app delegate substitution , other questionable techniques???
you can achieve using xctool xcode 7
- first go test target settings.
- go general tab
- select none host application
- then install xctool terminal
run tests terminal follows,
xctool -workspace test.xcworkspace -scheme testscheme run-tests -sdk iphonesimulator
Comments
Post a Comment