Xcode Build for Testing Step Issues

Using the build for testing step I am receiving these errors both on Bitrise and locally

set -o pipefail && xcodebuild “-workspace” “CRM.xcworkspace” “-scheme” “CRM” “-destination” “generic/platform=iOS” “COMPILER_INDEX_STORE_ENABLE=NO” “build-for-testing” | xcpretty

:x: error: Provisioning profile “match Development com.company.crm.CRMUITests” has app ID “com.company.crm.CRMUITests”, which does not match the bundle ID “com.company.crm.CRMUITests.xctrunner”. (in target ‘CRMUITests’ from project ‘CRM’)

:x: error: Provisioning profile “match Development com.company.crm.CRMUITests” doesn’t match the entitlements file’s value for the application-identifier entitlement. (in target ‘CRMUITests’ from project ‘CRM’)

I could use some help trying to sort this out.

This seems to be related to having had setup manual code signing on my UITest target. When I switch it to automatic code signing for this target, it appears to resolve the issue.

What is the general consensus regarding code signing for test targets?

Looking at my past commits, I had changed it to manual code signing to support build-for-test, but now it’s actually breaking it.

After reverting back to automatic code signing it is now working locally when build-for-testing, but on Bitrise I am getting this error

:x: error: No profiles for ‘com.company.crm.CRMUITests.xctrunner’ were found: Xcode couldn’t find any iOS App Development provisioning profiles matching ‘com.company.crm.CRMUITests.xctrunner’. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target ‘CRMUITests’ from project ‘CRM’)

Some googling hinted at xctrunner being a change with Xcode 11.

Ok so I reverted back to manual code signing, and updated my app identifier and bundle identifer for the UI Test target to include .xctrunner at the end. This seems to get me past all this. The question now is if this is the correct approach.

I think using manual code signing is not required, just the .xctrunner suffix of the bundle id.

Specifying the bundle ID as com.company.CRMUITests.xctrunner caused the error message to mention that no profile was found for Bundle ID of com.company.CRMUITests.xctrunner.xctrunner

What I got to work was having my bundle ID as com.company.CRMUITests and my provisioning profile as com.company.CRMUITests.xctrunner

3 Likes

So why is this happening all of a sudden? I’m starting to get the same error. Is this linked to Xcode version?

Yes, solution stated here works for me: xcode 11 changes the bundle id of WDA · Issue #13086 · appium/appium · GitHub

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.