I am having this issua also, Unit Tests work fine, UI tests wont' run. I've spent 6 hours now trying these below in various combinations.
- cleaning, cleaning build folder, deleting derived data
- restarted xcode
- deleted app from phone or from simulator
Targets:
- deleted unit test and ui test targets from project,
- recreate just unit test target in project
- recreate just ui test target in project
- change tons of uitest target build settings
- change uitest targets target application to none or to my app
Scheme
- in scheme test -> info, run test with just uitest tests or with uitest + unittest in tests
- in scheme test -> options,enable code coverage or disable code coverage
- in scheme test -> options, set my app as target, set unit test app as target, set ui test app as target, try all 3, try 2 of each
- disable screen shots, enable screen shots
In UITests
- in uitest try to init xcuiappicatoin with bundle id or without bundleid
- try without setup/teardown, try with
The one thing I can't figure out is why the errors shows that myapptests.app is trying to be located, and not myapp.app. myapptests.app is from the unit test target. For every combo above, this still showed as the error. Could not obtain the bundle identifier for '/Users/Me/Library/Developer/Xcode/DerivedData/MyApp-dudugrpbakytmgcypgfwpkusurxt/Build/Products/Development-iphoneos/MyAppTests.app'
In an attempt to change the error message to say anything other than MyAppTests.app, I've changed bundle id and bundle name and produt name on main target, unit test target, ui test target, cleaned, cleaned build folder and deleted dervied data and apps from device, error message remains the same???
I've also noticed the last step in Xcode status bar displays "Fetching Runtime Profiles (0/1)" right before the error appears.
I also tried setting Test_Host, but that doesn't seem to be allowed on UITests.