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

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.

Related

Iphone App developed with KivyMD Crashing

I've created a game with KivyMD and currently I am testing it on iOS. I have tested the game on Android and it works flawlessly. The game builds successfully in XCode and once built, the game works fine on an iPhone. However, few days later, something seems to be going wrong and app starts to crash in iPhone. As soon as I launch the game, I see a black screen which appears to be a pre-splash. However, I haven't set a pre-splash for the game. If I rebuild the game in XCode again, it builds successfully with no errors and the app starts to work fine again for few more days and then it starts to crash. Can someone help me with the following?
Is there a way to look at the error message in some log file on iPhone when the app crashes?
Is there a debugging tool that I can use to troubleshoot when the app crashes?
Is there an iOS simulator app that I can use on my iMac to test the app?
XCode shows the build log as successful always. So, the app crashing appears to be a run-time error. Unfortunately, I am new to this and needs some help.
Thanks in advance.
UPDATE: You'll probably want to find a solution that is specific to Kivy. This answer may help. In fact, your question may be considered a duplicate:
https://stackoverflow.com/a/27175629/2476389
Generally, I recommend Firebase Crashlytics for crash logs. If a crash occurs in your app, the stack trace and other helpful info will be uploaded to your Firebase console the next time the app is started. You can see all your crashes in the console. You will need to follow the instructions to integrate crashlytics into your app and then release a new build, but it's well worth it. This will allow you to get crash logs from all devices (testers, users, etc).
https://firebase.google.com/docs/crashlytics
For crashes you can reproduce on your dev device, you can also retrieve the log directly:
https://developer.apple.com/news/?id=nra79npr

"Sideloaded" iOS app unavailable after sideloading to another device [duplicate]

I am currently working an iOS app, nothing serious, just a simple budget tracker. The workflow is the following: coding some new stuff into app => connect my iPhone to my mac => building app with Xcode to my iPhone 6 and my wife's iPhone 6 plus (so two different device!). At this point everything works fine.
But after a while (sometimes just a few days, sometimes weeks), the app suddenly stop working on both devices at the same time, without any foreshadow: We don't update iOS and don't do any changing in the environment, the app just start to do like this: https://s3.amazonaws.com/sized-video-assets-public-v1/wp-content/appadvice-v2-media/2015/07/crash_9b28fddfc26f9f0380f1b0d0b2324018-quarter.gif (but in my case, the app can't reach the first view, crashing immediately after start).
The most weird thing is, the crashing issue starts exactly the same time on both different device, but the "no-problem interval" is never the same: sometimes the crash starts after one day, sometimes after two weeks, etc.
After I rebuild the app to devices with Xcode, the whole thing starts over, and the app works fine for a while.
I already tried these things to debug this problem:
Fixing all the warnings cased by the Swift's frequent syntax change, so my app always free of warnings => same problem still there
Checking the diagnostic debug logs on devices, no logs for the time of crashing
Checking memory usage on startup, its about 25MB on login screen (first view), and the max memory usage is about 38-40MB in the app.
Debugging app with Xcode, but as I mentioned above, there is no errors/warnings, and after the successful build, the app works fine again.
What is happening here?
If application is installed with XCode and you don't have a Paid Program Developer Account, the life expectancy of the app is like 48h approximately
(There is no official time of validity for that)
, for a paid program, it's a few month with the correct certificate. Currently it seems to be approx 60 days.
If you didn't sign your app, it has low life expectancy. It's quite new that Apple allow you to deploy for a free account, but it just for testing purpose (other than simulator), if you want more days to test on device, you have to pay for the developer program.
Hope This will help you...
Do let me know if you have any other query.

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

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/

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