I get this error when I trying to test an app.
A build only device cannot be used to run this target.
No supported iOS devices are available
I fixed this issue by going to the project settings, and under my 'Targets' section I had to set the Tests target to the correct team.