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?
2
Answers
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:
I’m able to send my application build to a physical device that is in AirPlane mode.
I would be curious to know if you’ve ever built and launched your app on the physical device BEFORE putting it into AirPlane mode.
As of iOS 16, Apple added a ‘Developer Mode’ which ironically has always been on Android as long as I can remember.
https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device/
Make sure your device is configured correctly and can run on the physical device. I don’t think AirPlane Mode is your issue here.
Also make sure you’ve setup Xcode Signing & Capabilities with a valid Apple ID developer account.
If you go into Xcode -> Settings there is an @Accounts Tab. Put your AppleID account there and it will make it so you can easily auto sign your app in your project build. You can check the ‘Automatically Signing’ check box and then select your account in the Team Combo box for your project build and you should be good to go.