Guides to use Xcode Instruments needed - ios

I am following this guide developer instrument guide and RayWenderlich's tutorial to view and analyze data using Instruments and I am wondering if anyone could suggest any other guide-tutorial as I have still unclear some aspects (e.g. how to determine which classes are live in memory at a particular frame and their memory footprint).
Thanks!

Has been few days since I posted this question and in the meanwhile I found this very useful post that gives a basic introcuction on Instruments as well as other performance related optimizations I was doing without understanding fully why :).. very useful!

Related

Simple memory monitor for iOS

I have zero iOS programming experience but I'm good with Android and Java programming. I also know my basics in C++. Here's what the app needs to do:
List out all the current running apps in the phone and display how much Ram each is consuming.
Put the ram usage by each app onto the Logger.
That's it.
It's simple enough and I've read up as much as I can about Objective C and Swift (I can use either) and I've found an interesting tool here that does something similar to what I need to do.
If any of you can give me any advice I'd be forever in debt as I really need to get this done well. If you need anything else, let me know. Thanks a bunch.
Edit: to make myself clear, I'm only asking if this is even possible in iOS and what approach I may take and if there are any tools you recommend. I'm not asking anyone to do this for me.

Find the source for __lldb_unnamed_function4866$$ProjectName

I got an EXC_BAD_ACCESS in my iOS program, and I suspect that the cause is in one of my anonymous blocks, but there are quite a few of those, and I need to narrow down the candidate list a bit.
The stack trace shows the current frame as __lldb_unnamed_function4866$$ProjectName. There are no line numbers or source file names that I can see. No local variables visible either. The debugger shows machine code instructions. This was running on a background event queue, so there is none of my code anywhere else on the stack.
How do I go about finding out what function this is?
I came across a similar situation, and while I can't help (yet) with your problem, I think I know a man who can.
Check out http://www.realmacsoftware.com/blog/block-debugging, for an exposition of how to find out a lot more about the evil block in question.
It doesn't help me much, because I'm working from a crash log, but if you're still interested, this is going to give you just about as much as you can get about the unnamed block.
Warning, the above link exposes you to a lot of arcane knowledge, and may make you feel a little inadequate :)
[Editted to add]
Not good enough yet?
After searching through disassembly and doing some manual symbolication, I came to the conclusion that the ___lldb_unnamed_function is a red herring.
I followed How to manually symbolicate a crash log with atos, and it pointed the finger at a completely different function, which came from a 3rd party library, and was a very good candidate for the crash reason (killed by angry watchdog with badf00d.)
In the course of this enquiry, I also came across hopper, a great disassembler; I used the demo version to confirm what the suspicious code was doing, so I'm giving them a namecheck.
Try to set an exception breakpoint by clicking on the plus symbol within the breakpoint navigator cmd + 6.
For getting an overview of debugging best practices if found it useful to consider a Stanford Lecture on iTunes U

Particle effects in iOS

I've hired a developer to work on an iPhone & iPad application and as part of the application we would like to have a particle effect.
How do you implement particle effects by using CoreGraphics?
Please note that I've referred the developer to the following link, but he's told me it doesn't work well due to leaks:
http://www.clingmarks.com/generate-particles-along-a-path/822
If I may suggest this: http://www.raywenderlich.com/6063/uikit-particle-systems-in-ios-5-tutorial tutorial in an attempt to implement your particles, maybe you will have some better luck with it. I havent personally used it, but I've used tons of other tutorials from Ray's site, and all of them are fantastic.
Additionally, if you just want to debug your current implementation, this one seems to be up your alley: http://www.raywenderlich.com/2696/how-to-debug-memory-leaks-with-xcode-and-instruments-tutorial.
Hope that helps!

Instruments and Shark

I've finally reached the end of app creation.
I know that Instruments and Shark can be used to test for memory leaks and other such "bad stuff" in your apps. Unfortunately I can't find any good tutorials on how to use these tools.
Especially for Shark, how should I go about using these tools?
Additionally, are there any other similar tools that may be more powerful or easy to use? Thanks you!
One way to find memory leaks and other problems is to use static analysis. If you're using Xcode, there's an integrated tool that's located in Product->Analyze.
Shark is no longer really used, use the Time Profiler instrument instead.
Currently your best bet is reading through the Apple documentation on Instruments.

Profiling CPU Instructions on iPhone

I would like to be able to profile a particular C function within an iOS application to see which CPU instructions it uses, and how often they are used. What is a simple way to go about doing this?
You'll want to check out the Time Profiler tool in Instruments. Check out the User Guide for some detailed information on how to best make use of it.

Resources