Unable to simulate iOS application on my device. "Unable to verify APP" - xcode

I'm trying to build and simulate my app from xcode to my device but I'm struggling with an error that always show up when I run my application.
Error:
Could not launch “AppName” Domain: IDEDebugSessionErrorDomain Code: 3 Failure Reason: The operation couldn’t be completed. Unable to launch org.reactjs.native.example.AppName because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user.
When I tap the app button on my phone it says:
"Unable to verify app. An internet connection is required to verify the trust of the developer ... This app will not be available until verified."
I already trusted the developer on Settings > General > VPN & Device Management but even when I trust it the app still saying "Not verified"
My app runs normally on xcode simulator.
iOS version: 16.2 Xcode version: 14.1 macOS: Ventura 13.0.1
I already trusted the developer on Settings > General > VPN & Device Management but even when I trust it the app still saying "Not verified"

I've solved it. I went into ~/Library/MobileDevice/Provisioning Profiles and cleared the old profiles. At the same time I restarted my iOS device. Upon restart I was able to go to preferences, and trust the development cert, and also verify the app successfully. I was able to run it from Xcode after this.

Related

iOS 15 Untrusted Developer issue

I have updated recently to a new iOS 15 and after I built and run my application in Xcode, while have been logged in with a same developer account as before iOS 15 installation, I get this message:
The operation couldn’t be completed. Unable to launch com.xyz.xyz.xyz
because it has an invalid code signature, inadequate entitlements or
its profile has not been explicitly trusted by the user.
and the error log:
Could not launch “my-project0name” Domain: IDEDebugSessionErrorDomain
Code: 3 Failure Reason: The operation couldn’t be completed. Unable to
launch com.xyz.xyz.xyz because it has an invalid code signature,
inadequate entitlements or its profile has not been explicitly trusted
by the user. User Info: {
DVTRadarComponentKey = 855031;
IDERunOperationFailingWorker = DBGLLDBLauncher;
RawUnderlyingErrorMessage = "The operation couldn\U2019t be completed. Unable to launch com.xyz.xyz.xyz because it has an invalid
code signature, inadequate entitlements or its profile has not been
explicitly trusted by the user."; }
System Information
macOS Version 11.6 (Build 20G165) Xcode 13.0 (19234) (Build 13A233)
Timestamp: 2021-09-21T12:36:18+02:00
Earlier (on iOS14), this could be solved by going to:
Settings.app -> General -> Profile -> Select Profile -> Trust
But now (on iOS15) I can't actually find it at that location. How would I fix this?
From what i understand, this might be a bug connected to iOS 15 / xcode 13.
I found a solution which is to create a new Apple ID and use it to sign your app in xcode.
You can add a new team by going into "Signing & Capabilities"-tab and select "Add account" where you select a team.
Once you've done this and run the application on your device again, the option to trust the application in Settings > General > Device Management should appear!
As #ujell pointed out. The provisioning profile generated prior iOS 15 is preventing installation on the new release. Therefore, you will need to generate a new provisioning profile for your app. Try the following:
Quit Xcode
Go to the directory of cached provisioning profiles (cd
~/Library/MobileDevice/Provisioning Profiles/)
Back up the existing
files to another directory
Remove all profiles listed under
~/Library/MobileDevice/Provisioning Profiles/
Launch Xcode
Install/run the app on your device
Xcode will detect that there are no eligible profiles on your local system and request a new one during the next build to a device. The new profile will be compliance with iOS 15 provisioning.
NOTE: if it still doesn't work, then install the iOS 15.2 beta release (Build 19C5026i or later) on your device and try the steps above again.
Indeed, it looks like, the problem occurs only with IOS >hardware< real devices running >= iOS 15
I see no option in Settings allowing me to set the app dev as trusted.
This does NOT occur with my older (real) iPad Air, running with iOS 12.5. The app runs immediately without prompting for trust etc.
It also runs without problems on Xcode's simulator devices with iOS 15.
So yes, I think it is an iOS 15 and/or Xcode issue.
reported this to Apple.
Ios15 changes trusted application position to:
settings -> general -> vpn and device manage
then you can see your application under the Developer App, click it and verify it
iOS 13
in your iphone,got to
Settings -> General -> VPN and device management -> Developer app ->Trust and accept
At least my issue was the result of Apple again messing with the code signing creating a ling tail of side effects.
iOS15 code signs differentially on the "new" type of certificates.
I'm developing an app that is connection to a device via WIFI without internet connection.
The initial development was done on Xcode 13.1 and an iOS14 iPad. That worked well. As usual the iPad needed to be on a WIFI with internet connection at the first launch to verify the code signing. After that it was fine to launch the app from Xcode to the iPad while it being on the WIFI without internet connection. The app didn't need any additional code signing verification.
After updating the iPad to iOS15 every launch started to fail with the error unverified when the iPad was on WIFI without internet connection. Launching on the iPAD on WIFI with internet connection was fine.
It seems like iOS15 causes apps to verify code signing on every launch - not only the first any more.
After searching and fiddling with Provisioning Profiles for several days I found out that Apple now has two different types of certificates - an "iOS Development" certificate and a "Apple development" certificate. The latter being the "new" thing.
Deleting my automatically created certificate and creating a "new" - and then a new provisioning profile solved my problems.
My app now only needs to verify code signing at the first launch.
This fixed my code signing / developer verification issues.
iOS 15:
Settings -> General -> VPN and device manage -> business apps -> Tap on your certificate and install it.
Might be a bit late, but to anyone still searching for a solution to this problem, I finally fixed it by turning on automatic date & time settings.
On your iPhone: go to Settings  > General > Date & Time.
Then turn off and on again the "Set Automatically" setting.
For somme absurd and unknown reason that seemed to solve the problem, for me at least.
Hope it helps.
Note: I have an iPhone 7 with iOS 15.6 and i use xCode 13.4.1
Just install the Developer app on the physical host iOS device.
Go to account and signin from you developer apple id
Now under Settings > General > VPN & Device Management you'll be able to see organisations.
Trust the ones you want to
You'll now be able to open the applications signed by that organisation

In Xcode, build for running is succeed, but App installation failed

I want to install the app I had previously deleted back into Xcode.
'build for running' is succeed in xcode, but App installation failed when I run at connected iphone. The error messege is 'A signed resource has been added, modified, or deleted'.
i'm using this profile.
I solved this problem by changing the profile and code signing identity.
Your profile has been expired. Check your profile from developers.apple.com.
You can take a look on this link
UPDATED ANSWER:
You must need to user developer profile to installed directly into your device from xCode.
Distribution is only when you want to upload app on AppStore.
As in your screen shots, you are using Distribution profile for same. Kindly use developer profile to installed.

"Message from debugger: Terminated due to code signing error" when debugging a Mac app?

I'm writing a Mac app in the sandbox, and can't seem to get code signing to work. I've selected "Developer ID" from the Info tab for my target, and I've tried letting Xcode set up my provisioning profile automatically as well as creating the profile myself. The app builds without any errors or warnings, but when I try to "build and run," it gives me the following error:
In console.app, I noticed I was getting the following message:
3/5/15 4:46:37.151 PM taskgated[73]: killed com.nateparrott.Boxcar[pid 27408] because its use of the com.apple.developer.ubiquity-container-identifiers entitlement is not allowed (error code -67050)
It turns out that the default entitlements file in my project included an empty list of iCloud container, which caused the sandbox to think the app needed iCloud permissions (which weren't included in the default provisioning profile). Removing the iCloud entry from the entitlements file solved the problem.
Try to regenerate your certificates from the Dev Center. This happens most of the times when you switch to a new mac or after upgrading to a newer OS X version.
You have downloaded and installed your cert (in Keychain Access) from the portal. If you created the cert today on the same Mac you're trying to run it on this won't be your issue.
Your cert from above is in the provisioning profile you imported into XCode.
You actually imported your provisioning profile into XCode. It should be selectable form your Build Settings drop-down.
The bundle identifier you created in the portal matches what you have designated in your project under the Target Info.
I tried Setting Build Settings->code signing identity to "Mac Developer" and Provisioning Profile to "Automatic". The debugger worked fine after that.
This also can happen when debugging on iOS Simulator, when developing for Mac Catalyst, when ENABLE_HARDENED_RUNTIME set to YES.
Below Xcode configuration helps to avoid this error:
ENABLE_HARDENED_RUNTIME[sdk=macosx*] = YES
ENABLE_HARDENED_RUNTIME[sdk=iphonesimulator*] = NO
ENABLE_HARDENED_RUNTIME[sdk=iphoneos*] = NO
modify targets>Build Setting>code signing identity to your sign development.

How to debug APNS on iphone from xcode

My iPhone app is able to register for APNS remote notifications when I run it via an adhoc distribution. So I know that my adhoc provisioning profile is correct.
But I'd really to debug the app from xCode, runnin on my iPhone. In that case, I know that the app will use the APNS sandbox, which is fine. But when running in this mode, when the app calls registerForRemoteNotificationTypes, it gets the dreaded error "no valid 'aps-environment' entitlement string found for application".
I assume that I should be using my developer code signing certificate when debugging the app on the iPhone from xCode. Is that correct? What stupid configuration thing I am missing that is causing the error?
To be able to debug the application your server APNS should be configured with the Developer APNS certificated instead of the Distribution APNS certificate.
Because on Debug you're signing the application with the Developer certificate.
I hope it helps.
no valid 'aps-environment' entitlement string found for application - error is because, APNS is not enabled on your development provisioning profile.
To make sure your provisioning profile is APS enabled - Open your XXXXX.mobileprovision in text edit & search 'aps-environment'. You should be able to see something like below.
<key>aps-environment</key>
<string>development</string>

No iOS Development certificate was found.

I used xcode in 2010, I have removed every certificate that I can find on developer.apple.com and from in keychain so I can have a fresh start.
When I click on provisioning refresh button I get the error message:
No iOS Development certificate was found. However, there is already a certificate request pending. An Agent or Admin must approve this request before you can download your certificate.
I have logged in and out, started and restarted Xcode.
I am the sole developer, so am the admin who would approve certificates, there are none. None at all.
None listed under All / Pending / Development / Distribution.
Will Apple not let me start anew?
I had same problem you had.
I removed all certificates from developer.apple.com and from my keychain
When i went to https://developer.apple.com/account/ios/certificate/
I was always creating only the Adhoc certificate, I was missing the
"iOS App Development Certificate".
As soon as I created the "iOS App Development Certificate", xcode stopped with this error message.
Contact Apple Developer Program support, they will walk your through the process of fixing it. See my answer over here.

Resources