My iOS app every now and then refuses to launch until I reinstall it - ios

I've got an app that uses Core Data that sporadically stops launching so I have to reinstall it using XCode and then it launches again like normal for a while, with all the Core Data information still preserved.
I have seen that an app often stops launching when the target of an app is too low in comparison to the device software version, however this is not so for this app and device (iPhone 6s).
Have you had such an issue before? What do you think could be causing this problem?

There are many, many, many things that could cause an app to fail to launch. You need to narrow things down and collect some data so that you can find out what the problem is and do something about it. Right now you don't even know that it's related to Core Data, you're just guessing.
For a crash on launch, look at the device console and see what messages appear when you try to launch the app and it fails. You can get the device console messages by
Connecting your device to your Mac
Opening Xcode's "Devices" window (cmd-shift-2)
Looking in the bottom half of the window
A better way to watch the console is to use the free iOS Console app.

The problem was that, as mentioned by dan in the comments, the code was being signed for a short period of time (7 days) and so I had to keep re-installing it on the iOS device to keep it working. Thus to keep the app working indefinitely a paid developer account is needed.
Also mentioned in this reddit forum:
https://www.reddit.com/r/jailbreak/comments/4hotx3/news_free_developer_account_installs_reduced_to_7/

Related

How to debug react-native iOS app crashing on startup after a week or so

I started messing around with react-native. I've built a small application and it seems to work fine (package.json). I can work on it in Debug or Release mode, using the simulator or my iPhone 6S device, and all is well.
This app is just for me so I don't pay for the Apple Developer thing, and I just run the app in Release mode on my device, and it...seems to be fine? I can quit xcode and go places and the app works fine.
After a week or so, it's hard to tell, the app stops loading. It'll display the splash screen for a split second and then it's gone back to the home screen.
I setup Rollbar, but it doesn't catch anything. I look in the Privacy -> Analytics area and don't see anything there either.
I'm not really looking for an answer to my exact problem since various SO questions and other places suggest it's probably something weird and specific. My main problem is I don't know even where to look/how to debug this kind of thing. If I build the app and run it on device again, it'll run fine. I need to try to debug without loading new code, and have no idea how that works on iOS. I've tried poking around at the Debug -> Attach to Process by Name, but the app never gets far enough to do anything with that.
Alternatively, I throw react-native in the garbage and use something that works...
App provisioning with a free developer license (?) is 7 days. See: Why does my free XCode Provisioning Profile only last 7 days?
You can likely verify this by looking at error messages in the console window. Connect your device, and in Xcode go to Window/Devices and Simulators/Open Console, then launch your app.

Application Failure Without Crash Log

Having perused many other questions concerning unusual app crashes without any success at solving my problem, I have decided to post this question.
I have an app that crashes at random. Some users (in test) never have crashes, others have an occasional crash. This app is installed via XCode on testers phones, straight from the development machine. The app never crashes when in use, only upon startup a day or two after installation and use.
The app is instrumented with Crashlytics, and no crashes are detected, nor are Out Of Memory warnings. No crash logs are left on the phone after this behavior.
Crashlytics works. I injected test crashes and they were properly detected.
Once the app crashes, it will not restart. The splash screens appears for an instant and then the app closes.
The app uses Core Data and I use ObjectiveRecord https://github.com/supermarin/ObjectiveRecord as the Core Data interface. There are no aborts anywhere in the code (at least none that I added/left in)
The app downloads about 1500 images (photographs) at initialization time, and whenever the photos collection is updated. The filenames are stored in Core Data, not the binary data.
As an experiment, I took the container from the same app on another phone and replaced the container on the defective phone. No difference. Replacing the container on the good phone with the container from the bad phone made no difference either.
If I reinstall the app on the target phone, without deleting the original install, all works as expected. This leads me to believe that I am not suffering from database corruption - obviously, I may be wrong, but if advice can be offered as to how to test this, I will happily accept it.
I am at my wits' end here - any advice as to what the problem might be, or how to diagnose the problem will be gratefully received.
EDIT -- The app is for IOS 9, iphone only.
I shall answer my own question. I have been distributing the app to my 4 testers using a MacBook. I only have one license, and rather than downloading it and moving it between my iMac and MacBook, I was just allowing Xcode to generate a new certificate.
This doesn't work. Ever.
It invalidated all of the copies of the app that I installed.
The moral of the story is: beware of licensing issues - even if you have a license.
and the hint was:
Aug 29 15:48:28 iPhone amfid[170] : /private/var/containers/Bundle/Application/25BE181B-C30F-41FF-87A3-88C8E63BB3B3/TEST.app/TEST not valid: 0xe8008018: The identity used to sign the executable is no longer valid.
Live and learn I guess......

How to debug an iOS app that does not make it past launch for certain users?

I have hundreds of people using my app, but a handful are reporting that the app does not make it past the black launch screen (it immediately closes, before entering into my app). I'm using Crittercism but it's not even getting far enough to catch any exception, which makes it sound like a springboard / backboard problem.
Here's what I've asked the users to do:
Reinstall the app
Delete some apps (to free some space)
Restart the device
None of the above worked. I'm completely at a loss as to what's wrong. The app is in the AppStore and works fine for most users. Furthermore, I can't find anything unique about these users (they're using recent versions of iOS with fairly modern hardware).
Crittercism doesn't show anything, because after the crash - log will be send only at the next launch, so if user doesn't open your app anymore (or can't do it, because he has constant crash).
I advice your to try next ideas:
Do use use keychain or store smth there? It's not cleared after uninstall
Maybe your data is backed up in icloud
Did it begin with the new iOs version (9.0 for example)
Maybe it's some cache problem after installing one version on another,
Can it be the problem of different timezones
Can it be a crash with local settings
If you have feedback with users with crash - contact them and ask about device, iOs version and other
your have crash sections in your itunesconnect profile, maybe there you'll get some information

User suddenly can't get past launch image screen

A user has reported that my app suddenly won't launch on their device. They sent me a video, and they launch the app, the launch image screen shows for a split second, but then crashes back to the iOS home screen.
The user tried deleting and reinstalling the app with no benefit.
I use Crashlytics, and am not getting any reports of crashes from them (or any other user- although I've seen them in prior versions so I know it's working correctly). I'm also not seeing any crashes in iTunes connect.
I asked the user to send me any crash reports in the Settings Diagnostics section and they said there are none listed for my app.
I have confirmed that their iOS version is supported by my app. (iOS 8.4).
I'm not sure where to go next, and would appreciate any pointers. Sorry for the vague question but I have posted everything that I know about the situation.
Just wanted to provide some closure on this. The user ended up wiping and restoring their device, and it solved the problem. It seems extreme to me but it was their own suggestion and didn't take them long to do. So I'm not sure what caused this but that's one (albeit brute force) way to fix it.

ios app-on-device debugging events

Newbie here, so apologies if this is stupid question:
Are there any applications or solutions out there that would allow you access to debugging events on an app installed on your iphone? To be clear, this isn't an app I've developed, it's just on my iphone and is used as part of another solution which we are developing. Curious if there's a way to just watch the events on an app to help with debugging process.
Thanks.
If you make an app, and build it with a development release, and development signing, you can select to build+run it on a device. Then, you can use the Xcode debugger to see your logs / errors etc.
Steps:
Plug in iPhone
Start Xcode
Hit Build + run
Watch debugger
Logs are either made by the OS for certain things (NSinconsistency, bad constraints, race conditions in view presentation) or by you with NSLog.
Or did you mean when the app is not tethered to your computer? There are other tools for that - including just plugging the phone back in and downloading the logs off the device.

Resources