I am building an app for Apple Watch and want to write a simple unit test. I looked around and didn't find a single way to add a unit testing bundle for watchOS code. Xcode supports unit tests for iOS, macOS and even tvOS but not for watchOS. Has anyone ever done it and if yes what is the trick?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
No, watchOS does not currently (as of watchOS 3) support unit or UI testing. What you can do is cross-compile non-watchOS-specific code to a shared library, then unit test that on another platform.