0

I really like developing for iOS more than Android.
However, android SDK has a great tool for profiling, called Traceview: Traceview screen

It can not only help to find bottlenecks, but can also show which method was running in specific moment in each thread. This can be very helpful in profiling and debugging. For example, if my app crush at some moment, I can easily see what was happening before the crash in each thread.

Is there are any tool for iOS that can do similar things? I tried TimeProfiler and Sampler in Instruments, but the could not find how to do this.

Thomas Dignan
  • 7,052
  • 3
  • 40
  • 48
Pavel Alexeev
  • 6,026
  • 4
  • 43
  • 51

1 Answers1

0

Detecting crash stack traces:

  1. This is possible if you have a debug build on your device and that crashes. Attach the device to Xcode and from Xcode start the app. Once it crashes Xcode will show you the stack trace.
  2. In any case iOS writes a crash report with detailed stack traces of all threads. Once you connect the device to Xcode and start the Organizer, it will automatically import all crash reports and symbolicate them. Please note that you need to have the exact build and dSYM archived on your Mac that caused the crash on the device. When you use the archive feature, this is automatically done. If this is a debug build and you did create another debug build in Xcode for the device and not the simulator (no matter if any device is connected or not) then the files are not available to any more. Symbolication will translate the memory frames into class, method and line numbers. To get line numbers, the dSYM is mandatory!
  3. You can also use 3rd party crash reporters to detect crashes, send them to a server, get them grouped together and symbolicated (if the dSYM is uploaded and the server is capable of doing that). This works for debug, beta and app store builds. Some examples are shown here: Including custom data into iOS crash dumps

Profiling - The tool Instruments provides lots of functionalities to profile your app, like:

  • Memory Usage
  • Leaks
  • CPU Usage
  • Zombies
  • and many more

You can find more detailed information about Instruments in the iOS developer documentation: https://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004652

Community
  • 1
  • 1
Kerni
  • 15,241
  • 5
  • 36
  • 57