how to make iPhone app crash after launch? [duplicate] - ios

This question already has answers here:
What's a reliable way to make an iOS app crash?
(18 answers)
Closed 8 years ago.
What is the code on Xcode and where do I put it to make an iOS app crash?
I want to make my app launch a url and then crash. Is there any way to do this?
Thanks

This sounds like a terrible idea, but if you insist you can just call a method that doesn't exist to force a crash, e.g.
[self performSelector:#selector(doesntExist:)];
Or you can close the App like this:
exit(0);
But you really shouldn't do this, neither of these methods are acceptable for the App Store (or anything for that matter!)

If you just want to crash (in order to see how your app recovers from a crash), simply do something stupid like [nameOfArray objectAtIndex:100000000];

Related

Is there a method that gets called on app uninstallation? [duplicate]

This question already has answers here:
Detect iOS application about to delete?
(3 answers)
Closed 4 years ago.
I have a very specific need to handle some cases if my iOS app gets uninstalled. But I cannot find any method so far that gets called in case the app gets uninstalled. I have searched around with similar questions but cannot find anything usefull. Can anyone suggest something please.
No, its not possible.
But you can check if the application has re-installed by storing a key in iCloud using keychain.

NSUserDefault issue with iOS10 [duplicate]

This question already has answers here:
iOS 10, NSUserDefaults Does Not Work
(4 answers)
Closed 6 years ago.
Have a similar problem with this iOS 10, NSUserDefaults Does Not Work
Seems like NSUserDefault is not working in iOS 10 simulator when it previously run iOS 8 or 9. But my question is, would it be okay on the device itself? When it is downloaded by the user using iOS10, would it lend to some bug or crash?
NSUserDefault will work fine on device, i am using it in my app. I haven't faced any such issues. Try to run your app in a device, i am sure you won't face any issues.
If possible please share the code, there is a possibility that you might be missing on something

can I send a user to the iPhone's lock-screen? [duplicate]

This question already has answers here:
Programmatically lock and unlock iPhone screen
(8 answers)
Closed 8 years ago.
I've seen an app that activates the lock-screen after showing a local notification (so the user has to enter the passcode).
... and now I wonder how they did this, since I need this kind of functionality for one of my projects. It might even pass Apple's review process because it does make sense for this app... (and, yes, I'm aware that Apple might reject it, but I'd like to give it a shot).
How would I do this???
I don't believe it is possible as the framework that handles this is private.
iOS 8.1 does not offer API to do this. Most likely you have seen an App implementing its own lock screen. You will need to implement something similar.
You can find examples on GitHub, e.g. https://github.com/venmo/VENTouchLock

Is it possible to answer a call programmatically in iOS? [duplicate]

This question already has an answer here:
Programmatically answer an incoming phone call on iPhone
(1 answer)
Closed 9 years ago.
Is it possible to programmatically answer a call in iPhone? I have already googled about this and found that iOS SDK does not support such feature. But I found an answering machine app in Appstore.
https://itunes.apple.com/in/app/prank-answering-machine-free/id508457142?mt=8
Please help me out.
No this is not possible, the iOS SDK does not allow any interaction with the phone.app.
Also the app you have found is a prank app, one that you start if you receive a call and the play back one the messages from the app.
No, that is not possible. The CoreTelephony framework lets your application receive notifications if there is any change in the call state, but there is no way to answer it.
The app that you mentioned does not say anything about answering a call, from what I can see.
I would say it depends. If you want to make a app and publish it in app store, its not possible. However if you want don't want to publish on app store and willing to use private api, then its possible. Refer this answer.

Send app crash logs/regular app logs [duplicate]

This question already has answers here:
How to get iPhone crash log from customers?
(4 answers)
Is there a way to have our own app to upload its crash repot?
(4 answers)
Closed 9 years ago.
I want to implement "Report a problem" button in my app, which sends me the logs of the user's app as a text file (by email), so I can see what is the problem.
Is there any way to do so?
Thanks in advance!
I have used QuincyKit to capture and retrieve crash logs from customers. It takes a bit of time, but once you get it set up, it works very well.
Crashlytics is definitely the way to go with crash logs. It is by far the easiest to implement and provides excellent information for solving problems as well as allows remote logging. It also means you will get the crash logs even without your users emailing them to you.
I'd still include a report a problem button that simply allows the user to email you if they have a problem specifically, but generally they won't for crashes.

Resources