iOS app launch time is around 10 seconds - ios

My App is taking around 10 seconds to launch.
To be clear, 10 seconds is the time between when i press the app icon and splash screen appears.
I have tried to put timer on main and didFinishLaunchingWithOptions calls. but it seems that these are getting called after the 10 seconds only.
To add some more details here,
This is the update of the app. Previous version of the app was/is working fine on the same device (iOS 8.3 OS), But not the current app.
The main difference between the two updates (except few new features which come into effect after launch only) is the change in the coredata-model.
For which , I have added a new dataModel-filename_2.xcdatamodel file.
Any idea/suggestions on how can I fix this launch time issue?
Edit: Just to add, I am not facing this issue on the "iOS 9". But there is one "iOS 8" iPad on which I am seeing this issue to the extent that app takes long to even come up from background (not just fresh launch). But Can't generalize this, I have tested on 2 devices only.

Related

iOS App shows black screen after succesful install on device using Xcode 12.5

I am trying to install an app using Xcode 12.5 on my personal device which is an iPhone 7 plus running iOS 15 underneath.
I got it to work after much hassle by adding iOS 15 device support files, but, after the app installs and launches itself, I get a black screen for like a minute or two and then the app works fine.
However, if I debug it takes approximately 30-40 seconds from jumping to one breakpoint to another and it consumes a lot of time.
I have tried scouring for a lot of information on this but no luck. Any solution for this would be appreciated.
You probably disabled your Splash screen that is why black screen appears.
Go in your LaunchScreen.storyboard file, there you will find a Screen Controller. Make it story board entry point and give it a background color of your choice.

iPhone 12 Pro debugging on device hangs

Like many of you I received my iPhone 12 pro today in the mail! And of course the first thing I wanted to do was run it in debug on my actual device. Curious if any of you with new iPhone 12's, or iPhone 12 pro's are seeing a huge lag when trying to debug to the device. for example it takes almost 1 min to even hit the entry point in the app delegate, and about 20 seconds when given focus to a uitextview for the keyboard to show up (after the 1st time the keyboard loads, the subsequent ones are instant)
Its super crazy because the simulator is instant, all other actual devices (Xs etc) are instant (all on 14.1), but my brand new 12 pro is unworkable when debugging to it.
Any suggestions? Ive tried multiple projects, seems to do it on every one. Ive submitted a feedback as well.
Disconnect the device, then delete the contents of ~/Library/Developer/Xcode/iOS DeviceSupport and restart Xcode.

Previous screen flashing when restarting the app

Short description of the problem: First time when the app is opened the splash screen appears normally and than it is followed by the home screen. But after the app was closed from taskmanager (double click on home button and swipe up) and opened again, the previous(cached) home screen appears(flashing) for a very short time before the Splash screen appears. I think every iOS app running on iOS 11.4 (ios 9 and 10 not affected) is affected not just mine. As you can see below(slow motion video), I could reproduce it with the Twitter app also - firstly it opens normally and at the second time the problem appears.
My application is suffering constantly from this issue in a predictable way, but the Twitter and other apps are not. They produce this symptom every now and again but than nothing for the following 5-10 try. With normal usage - if I don't terminate the app manually or there are a few app opened between mine is closed and reopened - the problem is not appearing.
The question is, is there a workaround for this issue?
Try adding this line of code in didFinishLaunchingWithOptions:
UIApplication.shared.ignoreSnapshotOnNextApplicationLaunch()

App launches slowly on iPhone 4/4s at first launch

I am observing a wierd issue on iPhone 4/4S and sometimes iPhone 5/5S too. App launch time (at splash screen) is more than usual. I have compared and after installing (first fresh install) it takes about 7-10 sec at the launch image. That is too much and I am worried about my app rejection. (even if not rejection than its a bad user experience for sure).
On iPhone 6/6s it is fine. From the second launch it takes normal acceptable time of 3-4 sec.
Now the funny part is when I delete the app and reinstall it loads relatively faster like 3-4 sec. Also from 2nd launch the app launches in about the same time or lesser.
Now to reproduce I delete the app and installs again after 3-4 hrs it gives the same issue of taking longer time to launch for the first launch.
I don’t know if system caches the launch image until some period of time even after deleting the app. (As it launches faster if delete the app and reinstalls quickly).
Also how to quickly launch the app? Any tips? I am using image xcassets and iOS version supported is iOS 7 and above.
Does it make difference if launch image is more than 1 mb and should I use jpg to reduce size?
Note:
It's taking time at launch image itself. I am curious to know why it's just first time launch after install. Like after killing the app and relaunching doesn't take that much time. And it's device specific only. Not seeing on iPhone 6 and above. I saw issue on iPad 2 as well.

iOS Default.png always comes up on some devices

I have an app and the Default.png images always comes up on some devices when coming back from background.
It would seem to be happening for apps that were created after I upgraded to XCode 4.6.1.
I tried the solution suggested here:
IOS Default.png show every time when my app enter foreground from background
and no go.
If I run the app on iPhone 5 with 6.1.4, the Default only comes up once when the app is initially launched. After that, it never comes up.
If I run the app on my iPad 3 with 6.1.3, the Default always comes up after coming back from background.
My QA lead sees the issue on her iPad 3 with 6.1.4.
Did they change something in the XCode project settings?
Genrally Your App Enter in to Foreground ,IOS 5 simulator displays a Lunch Image where IOS 4.3 simulator take a screen shot of the App when it was entering in to background , but testing on real device its work perfect.
I found the answer by chance here:
Prevent Splash Screen from showing after returning from background
Turns out I had set UIStatusBarStyle in my info.plist and that caused the issue on iPad 3.

Resources