Xcode Build for Testing Step Issues

#1

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.

0 Likes

#2

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.

0 Likes

#3

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’)

0 Likes

#4

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

0 Likes

#6

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.

0 Likes

#7

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

0 Likes

#8

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

1 Like

#9

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

0 Likes

#10

Yes, solution stated here works for me: https://github.com/appium/appium/issues/13086#issuecomment-559488669

1 Like