App with enterprise build but same code base having completely different launch time when sign with different company

I stumble upon this problem on iOS 15 because the enterprise app that we manage get kill by the system because launch time is > 20 seconds when first install/update.

At first we thought that because we use too many external dynamic libraries and create a sample app that use Swift Package Manager to convert most dynamic into static only around 10 is still unable to convert. The problem is partially solved and we can open the app within 20 seconds but it still takes more than 10 seconds to open.

However, we are fortunate enough to have one of our customer also using enterprise account, so the previous sample app is then build using their cert and app id. To our surprise, this build open instantly with less than 1 seconds during startup time. The same build but with our certificate, app id uses 12 seconds.

We further investigate and observe that the build with the our customer company also install faster. When using our company our app install and stop at around 75% for more than 15 seconds, while app using customer certificate does not have this problem and it installs instantly.

We also notice that when we allow Trust for these enterprise app in

Settings App -> General -> VPN & Device Management

When we tap our company it takes 12 seconds to open the Trust page, the number is close enough to notice the pattern, that maybe there is some communication during app launch for the first time and causes the problem.

On the other hand, tap on our customer company open the Trust page instantly.

We also try different dependencies type and it seems the App with all static framework open instantly while the app with dynamic framework seem to be the problem.

This seem to be correlate to the number of dynamic frameworks we have, more dynamic framework more time to open on our company certificate but it is working fine on our customer certificate.

How can we solve this? and why our company certificate takes long time to work as compare to our customer company?

We attach the log from Console.app for both the app sign with our company and customer company during first startup

Replies

Finally, I manage to make this work by creating a new certificate.

When comparing our cert and customer cert, I notice that our cert has more around 70 provisioning profiles and app identifiers reference to it, only 3 on our customer side.

So by creating a new certificate and make only our production app reference to it solve the problem. Still the test build still attach to the old cert and we cannot move them out since crash during test is acceptable for us.

The maximum number of certs allow is only 3 which is not enough to distribute to all our test apps, any suggestion we can do to improve this?