I have created one application for iPhone. Application does a search for all watersports around the world. It is webservice based application.
My application runs smooth on Simulator without any crash report but when I create ipa file and launch same application on my iPod (I dont have my own iPhone) the application crashes after some time. Scenario of crash is not fixed so I assume this is because of Memory Leak or memory warning.
I used this function didReceiveMemoryWarning to identify memory warning but the function doesn't get called on simulator.
My Xcode version is 4.3 and unfortunately I updated the version of my iPod to iOS 6.0 so I can not test the app by connecting my iPod to the Mac. I am going to update my Mac and Xcode very soon but not soon enough to make this issue resolve/test.
Any ideas?
You can get the crash log from device using the following approaches. Check how-to-find-crash-logs or get-crash-reports-logs-from-iphone-ipad. You can symbolicate the crash log to find out the root cause. Check this question here for more details on that part Symbolicating iPhone App Crash Reports. Once you got the issue, you should be able to fix it.
Try this, put a temporary label then modify it when the didRecieveMemoryWarning is called or make an alert view that pops up when didRecieveMemoryWarning is called.
Also, run with Instruments app, its a great way to monitor your memory usage and identify memory leaks. Also try Product -> Analyze to find memory leaks from in-Xcode. Instruments is part of the SDK just search for it in spotlight.
Related
I'm trying to develop an app using Xcode 4.3.3 with iPhone 5.1 simulator.
When i run this app on simulator, i got no warnings and it's working very well. But,when i try to make this work on iOS device,i got an warning message which is Received memory warnings. I got this warning message while the app starts to display images on the screen. I'm using SDWebImage project which is available in github to display images.I think this problem is releated to how memory organization differs from iOS device to simulator. I have looked this question How does building for iOS device and simulator actually differ? to see how the building app for iOS Device and Simulator differs. But,what i found about memory organization didn't satisfy me. Do you guys have any idea why this is happening ?
Another question : Is there any limitation for an application in the context of memory management? What i mean is, for example let's say 5MB memory is allocated ,will i get any messages which points to this issue ?
Thanks in advance.
You will never get memory warnings in the simulator unless you create them yourself (with the "Simulate Memory Warning" option). You have access to the entire memory of the Mac, including virtual memory. You had better not run out with a mobile app...
If you're seeing memory warnings on device, it means you're using too much memory. The best tool for determining where you're having trouble is Instruments and specifically the Allocations instrument. This will show you what is taking the most memory and where you should focus. Most memory warnings are due to a leak or retain loop.
you should better do not debug with the simulator , because the simulators memory is the mac , but your devices memory is very limit , and the capability of the simulator is better
I am developing an iOS application and thanks to Xcode's "output log" I've been able to fix lots of bugs and such.
When I run my iOS application without Xcode, sometimes it crashes. However, it is hard to tell why did it crash since my device was not connected to Xcode. So I was wondering, when I run my iOS application, is there an output log like Xcode's stored somewhere within the iOS device I can retrieve? Or do I definitely need Xcode? Or perhaps there are other ways?
When you connect your device to your computer, open up the Organizer in XCode. There will be a device log tab that you can select to view device & crash logs.
Go in the organizer then on devices. You'll get logs in there.
If you are jailbroken you can use the syslog in /var/log/. I find it useful.
edit: You need to download syslogd to /var/log/syslog package on cydia also.
When I use the iOS simulator and the app crashes, I can't find the crash logs. I've been looking all over the internets and can't figure out how to enable them. I know I can just run on an actual device and get the crash logs that way, but the bug I'm trying to fix right now tends to cause the program to be hung in the debugger. Then there's no qlaunchsuccess packet sending and it's a huge pain, especially when I have to run the program over and over. The only advice I've been able to find says the use CrashReporterPrefs, but a search of my hard drive reveals nothing named something even close to this. I've also dug into the package contents of XCode and the files of the iOS simulator. The iOS simulator has a crash logs folder, but it is empty. Anyone know how to get this working? Thanks.
Run your App with Xcode to install the App to iOS Simulator
Launch your App on Simulator without Xcode
reproduce steps for crash
the Crash log should show up under this directory
~/Library/Logs/DiagnosticReports/
It appears if you aren't running Xcode (mine is 4.5.2) but just the simulator (mine is 6.0) that when an app crashes it does save a crash report. To view it bring up the Application/Utilities/Console and
(1) make sure it shows the log list (see top left of console to make sure not hidden)
(2) under "DIAGNOSTIC AND USAGE INFORMATION" there is a "User Diagnostic Reports" that if you open up should have your crash reports
(3) the area on the right of the console has the log
A Crash log is just an output of what the debugger already gives you. When you are running in the simulator attached to the debugger, and you hit the crash, you can view the back trace information in the debug navigator (default key binding is cmd+5)
I have a strange issue, I have developed an app , I analyzed the app from Xcode i.e Xcode>Product>Analyze, then fixed any memory leaks I got. I ran the app in ipad simulator it worked fine, no crash nothing, ran it on an iPad device;no crash no errors nothing.
But when I tried to profile the app from instruments for memory leaks , during profiling there were no memory leaks, but at one stage when I load a modal view and then after Modal view dismissal the app crashes and instrument displays simulator session time out.
What could be the problem ?
If you have any compile conditions, e.g.: #ifdef DEBUG ..., to switch on/off functionality between debug and release this could cause problems since Instruments uses the Release configuration and regular Simulator run uses Debug.
I have such problem
I am making an application with xcode 4.3.1 iOS 4.0 as target.
I have default picture as starting image.
I am using core data.
When I start application then type some info into it and then push it to background. Its all ok. If I try to start after I went to background it become crash after start image is loaded. Second launch is good without crashes. When I try to start application with some delay it does not crash.
The problem that I have no errors in debbuger and no logs about crash in iPod. All seems well.
If you had such problems, please say how you fix this issue.
P.S. Sorry for my English
You can try using logs and check out Xcode's organizer's console for your device so you can get additional info about functions that were called last.