If you accidently deleted the UITest target, you can use this method to restore the target.
XCode > File > New > Target, choose UI Testing Bundle
.
Then it will create the UITest folder and target.

If you accidently deleted the UITest target, you can use this method to restore the target.
XCode > File > New > Target, choose UI Testing Bundle
.
Then it will create the UITest folder and target.