IPhone application shuts down when downloading until AppDelegate completes Download

So, I have my wonderful app that works great on a simulator or while the device is connected.

And then, if I create an IPA and distribute it on my device, either use TestFlight, or even send it to the App Store. The application will crash most of the time when I try to run it.

Failure reports, not even indicated, do not give me any information.

I used TestFlight so that it can help me figure out where the application crashes, but the application crashes before running TestFlight.

Here is my code (main.m):

#import <UIKit/UIKit.h> #import "version3contentAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([version3contentAppDelegate class])); } } 

and the beginning of version3contentAppDelegate.m:

 #import "TestFlight.h" #import "version3contentAppDelegate.h" #import "RootTableViewController.h" #import "AppsFeedTableViewController.h" #import "AboutShmoopModalViewController.h" @implementation version3contentAppDelegate @synthesize window, shmoopCoreData, tabBarController; #pragma mark - #pragma mark Application lifecycle - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSLog(@"applicationDidFinishLaunching"); [TestFlight takeOff:@"3f3618576288d96d598646d060a4f26a_NzUyMjEyMDEyLTAzLTI2IDE3OjIxOjQzLjgyNzQwNg"]; ... 

As you can see, the TestFlight code is at the beginning of the didFinishLaunching file. This means that if after this a failure occurs, I will have a crash report in TestFlight, which I do not have.

Can anyone understand why this is happening? The project was originally developed on the old xcode, for the old iphone, currently it is an xcode 3 project. But I am programming it on Xcode 4.3 with iOS 5.1 on devices.

+4
source share
4 answers

According to your request, here is my comment:

It gets into the didFinishLaunching file if it shows a splash screen. I noticed that you are not using ARC. Maybe you are redoing something too much? Update your project and see if it helps.

+1
source

If it fails on your device, you will see a crash log.

Secondly, in my experience, the main reason for application crashes: didFinishLaunchingWithOptions: is due to loading resources that take too long to load.

iOS has a watchdog that monitors applications and kills them if they do certain things for too long. Loading, unloading, etc. Usually it takes a few seconds, and if they take longer, the timer kills them, suggesting that they hanged themselves.

This timer is disabled for debugging reasons in the simulator, therefore, these failures appear only when the device is actually tested.

Once you have a crash log from your local device, check the code above if it is 0x8badf00d, this is the watchdog timer that kills your application. Pay attention to the error code 8-bad-food :-)

Then you need to look at your code and move as much as possible to the background thread so that the didFinishLaunchingWithOptions: method can complete as soon as possible.

+5
source

It may be a crash when starting TestFlight - I just spent quite a bit of time looking for a very similar problem where the deployment of AdHoc testing was random, sometimes crashing when opened, and it was on the line [TestFlight takeOff:...] backtrace showed that it crashed.

Extract the device crash logs (in all cases when it crashed after it appeared on the splash screen, I had crash logs) and try using symbolicatecrash to transfer the dump. In my case, it didn't translate anything except the line applicationDidFinishLaunching:withOptions called in testflight.

+2
source

This is a problem with Xcode. If you are not using automatic layout and size class, delete the xib startup file. Failure will be resolved.

0
source

Source: https://habr.com/ru/post/1403560/


All Articles