ios – Xcode – “Could not attach to pid” and “app cannot be installed because it’s integrity could not be verified” errors


In our project we have 3 schemes: Prod, Test and UAT (another one for testing)

For last couple of days I’ve been unable to build and run the project when Prod or UAT are selected but I get different error messages for both of the schemes.

When trying to run “Prod” I’m getting:

Failed to install embedded profile for app.xxx : 0xe800801f (Attempted to install a Beta profile without the proper entitlement.)
Verify that the Developer App certificate for your account is trusted on your device. Open Settings on the device and navigate to General -> VPN & Device Management, then select your Developer App certificate to trust it.

But there is no certificate in the Settings app to select!

When running “UAT” the message says:

Could not attach to pid : “1235”
Failure Reason: attach failed (Not allowed to attach to process.  Look in the console messages (Console.app), near the debugserver entries, when the attach failed.  The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)

But I couldn’t find anything in the Console.app other than what Xcode already told me.

What I tried:

  • Virtually every solution I’ve found so far on the internet

  • Cleaning project build folder, derived data and device support

  • Reinstalling cocoapods used in the project

  • Looking for the log in the Console.app but I could not find anything other
    than what Xcode already told me. There was no entry created by the
    debugserver process

  • Restarting both MacBook and iPhone devices

  • Downgrading Xcode to 15.0.1 (the error started appearing when I was
    on 15.1 and updating to 15.2 didn’t fix it)

  • Removing all certificates
    from Keychain and adding them again (we use Fastlane for that)

  • Same for all provisioning profiles

  • Removing Mac and VisionOS from supported destination so that only iPhone
    is left

These errors started appearing overnight, I went back to one of the older branches that definitely worked before and I got the same errors.
Strangely the “Test” scheme works as I said previously but I cannot come up with any explanation as to why.

Settings for all schemes look basically the same.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img