XCTest UITests fails at app launch with Expired token error
Asked Answered
P

1

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!

Pronuba answered 16/1, 2018 at 12:3 Comment(1)
I am facing the same issue , any solution ?Noguchi
U
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.

Ungava answered 30/1, 2020 at 7:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.