7

I am unable to run UI tests for a few days. It is failing while app launch portion with error

Expired token: no operation still exists for this token`.

If i run the whole class which contains more tests, most of them will fail for the same reason.

Has anyone else had this problem? And, more important, found a way to fix this? Thanks!

Mahmud Riad
  • 1,169
  • 1
  • 8
  • 19
ioana
  • 93
  • 4

1 Answers1

0

In my case, the problem was in code signing options for the test bundle itself.

When you enable "Automatically manage signing" checkbox within "Signing & Capabilities" tab of target settings in Xcode 11, it will modify your project settings by adding the following keys:

CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
PROVISIONING_PROFILE_SPECIFIER = "";

My solution was to remove all custom keys except:

CODE_SIGN_IDENTITY = Mac Developer
DEVELOPMENT_TEAM = <Your team identifier>

Here's more visual instruction: Code signing settings for UI Tests target

After that, I was able to run my UI Test for my Mac app.

Andriy
  • 2,767
  • 2
  • 21
  • 29