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.
Related
I'm using AFNetworking for downloading video file from server. Since my app target on iOS7+, i use method downloadTaskWithRequest:progress:destination:completionHandler:
When i download a large file(400M), the memory detector of xcode seems weird, the memory keeps growing and several Received Memory Warning print in the console, then my app is killed.
But when i profile with Instruments, the allocations of memory seem to be stable.
The app does not crash if i run my app directly without debug, crash only appears when running with xcode.
Is this a bug of xcode? or my app has memory issues(may be memory leaks)??
Update:
Xcode version 7.1.1, iOS8.3, Using Objective-C
I get a crash when executing my app on iOS 6.1.: I must have modified something I was not aware of and when I tried to execute the app on the iPod touch of my mum I got that crash and that happens even on the simulator with that version. What could it be and what may I do to fix it so that the app works both on iOS6 and iOS7?
Thanks,
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.
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
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)