This solved it for me:
You must be signed in to the App Store with the same user as specified in:
Menu: Product > Scheme > Edit Scheme > Test > info > Debug Process as: appstoreusername
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: