iOS 12 not supported by Xcode 9.4 : Could not locate device support files
iOS 12 is only supported by the beta of Xcode 10 or higher.
If you want to use your iPhone 8 with this iOS version (NOT RECOMMENDED) with your Xcode 9.4 you can try to download the last beta of Xcode 10 and after connecting the iPhone to the mac go to this folder:
/Applications/Xcode10.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
You can see the iOS version folder of the iPhone, copy and past it to the same location in your Xcode 9.4 folder.
After this you should be able to deploy to your iPhone 8.
As answered by @Kerberos you can copy the iOS 12 device support files to:
/Applications/Xcode10.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
ð https://github.com/Yatko/iOS-device-support-files
Another convenient way to achieve this without downloading Xcode 10.
https://github.com/sauravexodus/xcode-9-ios-12-support
Note: If you have multiple Xcode versions then be careful with the path written in install.sh
file.
The link provided by Yatko is not supporting the newest iOS 12 versions (public release).
This repository has more iOS versions to offer: https://github.com/iGhibli/iOS-DeviceSupport
Copy the files to the same path as described by Kerberos.