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
Below is my way
Select project -> General -> Deployment Info -> Deployment Target -> choose a lower version