I am trying to test my app on a real iOS device in airplane mode.
I have noticed edge cases when running the app in airplane mode after being installed from Testflight but I am not able to reproduce them with Xcode.
When starting the app from Xcode I get the error on the device
Unable to Verify App
An Internet connection is required to verify trust of the developer "Apple Development: First Last (AB12C34D)". This app will not be available until verified.
while Xcode is complaining
The operation couldn’t be completed. Unable to launch golf.movesmart.app1 because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user.
I found this post
https://developer.apple.com/forums/thread/697226?answerId=699899022#699899022
but generating a new certificate and even a new profile did not help.
I confess that I am missing a clear understanding of Apple's certificate and profile management.
What should I do to test my app in airplane mode while debugging in Xcode?
I realised that I had to initially start the app with network connection. So I performed these steps:
The precondition to the above steps is to install a profile specifically created for offline mode. Go to your developer account an create a new profile:
Once done: