Automatic appended .xctrunner in my XCUITest bundle id while running on device
Asked Answered
I

2

6

After updating to Xcode 11.3, my all test cases stopped working because of the unnecessary text .xctrunner appended with bundle id.

Example- If I am giving bundle id as abc.com then it's showing abc.com.xctrunner at run time.

enter image description here

Interdisciplinary answered 27/7, 2020 at 11:41 Comment(4)
do you mean 11.3 / 12 beta 3?Counterpart
XCode 11.3 updated my answer.Interdisciplinary
did you ever find a solution for this?Masterful
@Masterful Did not find the solution and created a wild card provisioning profile to overcome the problem.Interdisciplinary
C
0

XCode 11 changed the format for building xcuitest. To run UI test on device create AppId and Profiles for "$YOUR_TEST_BUNDLE_ID.xctrunner".

Set bundle Id for test target without xctrunner like "$YOUR_TEST_BUNDLE_ID"

Here is my Fastlane match config for iOS and Catalyst.

PRODUCT_BUNDLE_IDENTIFIER = com.test
PROVISIONING_PROFILE_SPECIFIER[sdk=*] = match Development com.test.xctrunner
PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] = match Development com.test.xctrunner catalyst

One Annoying Xcode issues is, Signing & Capabilities for UITest target shows status error. Because profiles don't match but no build error and UI test works just fine. Status error is bit hidden but love to resolve it.

Counterpart answered 7/8, 2020 at 16:34 Comment(0)
W
0

Set UI tests provisioning profile to None.

When Xcode launches UI tests there are two process running:

  • The "com.abc" app that may need a provisioning profile to access system features.
  • The "com.abc.xctrunner" that interacts with the app simulating an user.

Xcode adding the xctrunner satisfies the macOS security model requirement of having a different bundle id for each process. Signing the UI tests with a provisioning profile created for "com.abc" would require your tests having bundle id "com.abc" therefore preventing the launch of your app.

Granted, Xcode could be more helpful here, explaining all this. The solution is to remove the provisioning profile from the tests as they should stick to simulating an user, and not access system features that need special permissions.

Waitabit answered 31/5, 2024 at 21:12 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.