Apps slower to start on iPhone 4, iOS 5.1 compiled with Xcode 4.3.1? - ios5.1

I am keeping a close eye on the start time of my app in development. In main I store the start time using CFAbsoluteTimeGetCurrent() and log elapsed time when didFinishLaunchingWithOptions gets called, as well as during the initialization and painting of my StopWatchView and finally in the viewDidAppear of the main view controller. This served me very well in figuring out where my start time goes and keeping it in check. My startup performance tests on actual devices were done on iPhone 3G (iOS 4.2.1) and iPhone 4.
Since upgrading the device to iOS 5.1 I was forced to upgrade the Xcode to the version 4.3.1, too. I have immediately noticed that the start times on iPhone 4 changed dramatically. All measurements were performed with Xcode attached for debugging, reading the elapsed times from logs in console. Now I've also added debugging label that displays elapsed time to be able to measure without debugger attached.
To eliminate the possibility that the change was caused by something in my code, I've created new Utility Application and confirmed the slowdown. The iPhone 4 used to be ~3x faster than iPhone 3G, now it starts slower(!!!) than 3G. The startup time has also become highly volatile (+- 0.3s), where it used to be +-0.05s. The volatility disappears in Airplane Mode, so I suspect it's caused by some background process related to iCloud. However I'm very puzzled by 3x slower startup time on iPhone 4 before and after the upgrade.
Here are the average startup times, first during debugging in Xcode (then without Xcode):
Debug No-debug
iPhone 3G: 1.23s (0.67s)
iPhone 4: 0.43s (-----) [iOS 5.0.1, Xcode 4.3]
iPhone 4: 1.53s (1.18s) [iOS 5.1, Xcode 4.3.1]
iPad 2: 0.41s (0.22s) [iOS 5.1, Xcode 4.3.1]
I don't know if this is caused by iOS 5.1 or Xcode 4.3.1 or if this is iPhone 4 specific problem. Does anybody see similar slowdown?

On further investigation, I have noticed during profiling (after watching WWDC 2012 Session 235 "iOS App Performance - Responsiveness") that the time difference I have noticed is attributable to the call to _UIAccessibilityInitialize.
I have been testing the accessibility of my app and have enabled Settings > Accessibility > Tripple-click Home > Ask. This coincided with the release of the 5.1 update and I have erroneously attributed the problem to the new version. I guess that the OS has to initialize the accessibility machinery, so that you can turn on the VoiceOver anytime, without it needing to restart all open apps.
The performance impact of enabling accessibility is not clearly documented, as far as I know. So, to save other performance and accessibility conscious developers this surprise, know that even with Tripple-click Home set to Ask, you pay the cost of _UIAccessibilityInitialize.
I'm also about to devise a scheme to do my custom accessibilityLabels lazily, as they too, are having non-negligable impact on the responsiveness of my app in normal use. I guess there is no free lunch after all ;-)

Related

Why does latest Android Studio emulator crash or get stuck

Since I upgraded my Android Studio installation to Bumblebee, the emulator has become unusable. It either crashes during startup or gets itself stuck so that the UI is unresponsive and the debugger either cannot install or cannot launch an app. The way in which it fails varies from time to time for no reason that I can understand. although different virtual devices seem to behave differently. I tried deleting my old virtual devices and creating new ones, but that didn't help.
I can't debug my code on a real phone because of a different problem, see my recent answer to Source code does not match the bytecode for Android's View.java.
When it crashes I send a crash report to Google, but they don't seem to be fixing it. The problems started with the first official Bumblebee release 2021.1.1, which seemed to have a complete new version of the emulator, and I'm now on the latest stable version 2021.1.1 Patch 2.
My environment is a Dell Precision M4800 with 16GB of RAM and an 8-core Intel processor, using an external 4K monitor and an external full-size keyboard, running Linux openSUSE Leap 15.3 with all recommended patches installed.
Does anyone have any suggestion short of throwing away my entire Android Studio installation and reverting back to Arctic Fox? Has anyone else seen similar problems?
Tintin's answer didn't work for me: Device Frame wasn't enabled anyway because I had noticed that it had caused problems before.
However the following sequence rather surprisingly, at least to me, did fix the problem.
First make sure that the toolbar is visible at the top of the emulator window: if it isn't, click on the gear settings icon at the top right of the emulator window and enable Show Toolbar.
Start up an emulated virtual device, and before it crashes click on the three dots at the right hand end of the toolbar: this will bring up the extended controls window.
Choose Settings from the list at the left of the extended controls list.
Set the OpenGL ES renderer to Desktop native OpenGL, and the OpenGL ES API to Compatibility (OpenGL ES 1.1/2.0).
Close the extended controls window and then close the Android Emulator window.
Check if there are any zombie emulator or qemu processes still running. If there are, kill them: you'll need kill -9 on Linux.
Try to cold boot an emulated virtual device: it will probably crash before it even gets started up properly.
Close the Android Emulator window and repeat step 6
Try to cold boot an emulated virtual device again, but click on the three dots quickly before it crashes.
When the extended controls list comes up, choose Settings from the list at the left.
Set the OpenGL ES renderer back to SwiftShader, and the OpenGL ES API back to Renderer maximum (up to OpenGL ES 3.1).
Repeat steps 5 and 6.
Now try to boot up an emulated virtual device again. It should work: at least it does for me.
If it doesn't work on your configuration, try all possible combinations of the OpenGL ES settings: you may find one that works.
Logically, changing the OpenGL ES settings and then changing them back again shouldn't do anything, but it does. My guess is that perhaps some needed bit of initialisation for the OpenGL isn't being done by the installer, but it gets done when you change the configuration.
I also faced this problem in both updates in 2021.1.1 it was not working at all. Updated to patch 2 again faced problems turned off Enabled Device Frame it is working OK now

iOS 12 beta 4 CoreLocation from background launch

My app tracks users' travel (with their knowledge and consent, and with appropriate permissions set). A significant location change event starts the app, and then the app starts updating locations.
This works great for iOS 10 and 11, but it isn't working for the iOS 12 betas (tested beta 3 and 4) - the app is getting started, but it is either not getting location updates, or it is not staying active in the background.
I filed a bug report with Apple, and they called my bug report a dupe of an existing bug that's open, but I couldn't see details on the existing bug.
Does anyone have any more information on this? I scoured release notes and developer event presentations, but I didn't find any mention of something Apple purposefully changed that might cause this.
What I'd really like to know is if there's an intended behavior change that I need to support before the final iOS 12 release. Even better, if there's some workaround that will get this working in the beta versions, that would let me sleep at night...
Seems to be fixed in iOS 12 beta 5 or 6 - upgraded iOS and it started working without other changes.

Xcode 9.4 + Only Test-flight app crash

I reuploaded my app to TestFlight via Xcode 9.4 but it is continuously crash after splash screen on that test flight build in IOS 11 while same test flight working in IOS 10. While when running in the Adhoc build in the device, it is working fine without any issue.
And my last submission by Xcode 9.2 is working fine in all IOS devices including 11.4 too.
When I am getting crash logs from Organizer, it says, App crash on a statement like self.viewInput.refreshRewardCount(current: current, max: max) where current and max value passed static as 0 and 50 respectively first time when app start.
Additionality, I have also checked my Optimization Flags for LLVM and Swift compiler which are set properly as my other app and people suggested on the stack too.
Help me to solve that issue.
Thanks
We ran into this before. If you have not resolved this try using ImageOptim (downloaded from the Mac AppStore) and optimize all of your images. iOS 9 had a bug where it couldn't process certain metadata of PNG files.

xamarin.forms know memory usage both for android and ios

I am trying to develop android and iOS application using xamarin.forms. And already completed the main part that includes Canvas drawing. For that, I have used Skiasharp, to perform operations on bitmap images.
Now, in android,
1. If I try to dispose bitmaps that I initialized before I get SIGSEGV fatal error. (I think this issue is not OS specific)
2. When I continuously run my app for 20-22 minutes, app crashes suddenly.
And in iOS,
my iphone gets hanged when I run my app for long time. And it doesn't start until I uninstall app from iFunBox in my pc.
I wanted to ask if there are ways in xamarin.forms or in native projects to find out where my memory is leaking.
How can I know how much memory of RAM is actually being used at the moment ?
Thank you
For Android, you can use the Android Debug Monitor tool. This is a tool that is installed as part of the Android SDK.
Below is the URL for more information:
https://www.codeproject.com/Articles/798462/Diagnosing-Memory-Usage-in-a-Xamarin-Android-Appli
For iOS, you can try to use the native XCode Instrument.
Below is the URL for more information:
https://developer.xamarin.com/guides/ios/deployment,_testing,_and_metrics/using_instruments_to_detect_native_leaks_using_markheap/
Also, Below is a useful article that talk about Xamarin.Forms Memory management.
Hopefully it will be helpful.
https://igorelikblog.wordpress.com/2016/07/08/xamarin-form-memory-management/

My MonoTouch App won't run on 6.1.3, runs on 6.0.x and before... WTF?

I just pushed my app to the App Store after building release/AppStore build using xamarin's Studio...
Everything was green lighted and ready to go, I only had one person who had not installed the release version.... They installed it and it takes 17 seconds to try to start and is killed (I presume). it does NOT create a crash log on the device.
In the Settings there is a "Debug Settings" section under the app - that I didn't put there, including an option for Xamarin Studio Host which is set to automatic but appears to be able to be set to some other string.. (Another message on what the heck this is, and how come it shows up in the first place, and how to get rid of it)
I'm at a loss how to debug this. I just downloaded and upgraded XCode to the latest, in hopes that will help.. (Although, I'm not using the XCode interface to build, but I expect that under the hood it is using that for parts of this, maybe the libraries or something.) Still, unless the iOS writers are nuts, it should be backward compatible with apps written for iOS 4.0 and later... (Mine is a 4.0 targeted app)
Also, on her phone (which has always been 6.x for all the testing she has done), my app has always taken a LONG time to start up.. but on 5.1 it is very fast.. (I.E. 1-2 seconds vs 10+ seconds on her phone)
Anyone got a clue, I sure could use one right now.. I expect that I'll have to reject the binary, and submit another one...
-Chert
Figured it out.... The issue was with the TestFlightApp SDK...
I removed it and now the app starts up OK... Resubmitted to App Store for approval.

Resources