iPhone 12 Pro debugging on device hangs - ios

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.

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.

iOS app launch time is around 10 seconds

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.

iOS Simulator takes extremely long time to boot first time

I'm trying to run an iOS simulator (Xcode 7.0.1, OS X Yosemite). However, the first time I run the simulator, it takes a very long time to boot up (80-120 seconds), which is causing my automation testing to time out. If I close the simulator and re-launch the same one, it will boot up in about 5-8 seconds. Launching a different device will cause the long boot up time again.
I have tried resetting the content and settings of the simulator, deleting and re-downloading simulators, and uninstalling and reinstalling Xcode.
This machine is a Parallels Desktop VM running on a 2012 Mac Mini. While I do not believe this to be a resource issue (the simulator runs just fine with the second launch), I have tried increasing ram and video memory to the VM with no success.
Had the same issue after updating to Xcode 7 on my iMac (late 2013). And yesterday I've succeeded to resolve it by doing 2 steps (unfortunately, I don't know which did really help):
I had Xcode 6 installed side by side with Xcode 7. So I've deleted Xcode 6 instance.
Open Xcode 7, go to Window -> Devices and delete all listed iOS simulators you have there. Close & re-start Xcode. Go to Window -> Devices again and add only simulators you need (in my case I've added iPhone 6 iOS 8, iPhone 6s iOS 9, iPad Air 2 iOS 9). You can add more simulators later on as you need them. Also, not sure if this is critical, I've selected no paired watchOS device for simulators I've added.
After completing these steps, my simulator cold start was significantly imporoved - it takes now like 30-40seconds max for a cold start. Before that it was 3-4minutes and first debugger attach attempt always failed.
Hope, this will be helpful for somebody.
My solution so far has been to pre-boot the Simulator prior to needing it for automation. I consider this somewhat hackish, but it does get the job done.
xcrun instruments -w "Simulator Name Here"
sleep 120
This will launch the simulator, then sleep for a couple minutes before proceeding on to whatever else you need the simulator for.
At first boot, the sim device will go through initial setup just like a real device. Taking 2 minutes is quite a long time on modern systems but not that unheard of, especially if you're not on an SSD. I suggest you watch the sim device's system.log to see what tasks are occurring during the boot process and keep an eye out for any errors that might indicate what is going wrong.
I tried to run the iPhone6S simulator on my Macbook Air, and it just hung at the game center login screen. It hung for 10 minutes. I had 50% scale on the simulator window. Then I tried to reduce the scale even more, and immediately it passed the GC login screen.
My guess is that my little Air has don't have time to do anything else but updating the simulator screen at high scales, and when I reduced the scale it had time to bother with the game center login functionality. My simulator widow is the size of a stamp now. :)
Puh. I've had this simulator problem for weeks...

Testing iOS changes?

I want to know one thing: how accurate is the Xcode iOS simulator in representing the actual run time on a physical device? I recently tested an app with a 6.1 deployment target on a device running 6.1 (iPad 2). So far I had been testing on an iPad mini running 8.2 (after building the app in Xcode 6.2 and scaling back the deployment target from 7.1) but was shocked to see that the buttons I made didn't load at all on my physical iPad 2. The buttons instead loaded as blank "old school" iPhone buttons and when I clicked some of them, they crashed the app even though their only functionality was to perform a basic segue.
Should I update my iPad 2 to 8.2/8.3 and try again? I guess I am asking because the iPad 2 isn't technically mine and the owner doesn't want me to update it in fear of loosing data so I'm in a pickle as far as conceiving my next step in development . Does this problem sound at all familiar to anyone or should I just save up and buy my own 2nd testing device and hope for the best?

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.

Resources