I have been working on Memory leakage recently. I am dealing with the instruments tool every day. I would like to write a related tutorial for you. However, when I visited the Forum today, I found documents translated by others. I wrote them well and thought I could not write them. So I will not write it. I will repost the article here.
Original article: Instruments User Guide
Link: https://developer.apple.com/library/ios/#DOCUMENTATION/DeveloperTools/Conceptual/InstrumentsUserGuide/Introduction/Introduction.html
PDF Document Download:
Number of times that instruments users downloaded volume (3748 K): 5111
PS:
[Translation reason-translation itself is also a process of Reinforcement Learning]
I have been diving on cocoachina before. Although I have been developing IOS for almost two years, I always feel that something is missing. I used to view the API documentation in English, but I can't remember some details. One day someone complained to me that it was too painful to view the official English API documentation. Then I thought that if I translated some frequently-used official documents into Chinese, maybe it can help these people who need help, and then they even began their own entertaining translation journey. While helping others, you are also happy.
Many people may not know much about the instruments application, but many old IOS developers may have used the instruments tool to detect memory leakage of IOS applications. Especially before IOS 5.0, that is, when Apple does not support arc on the iOS platform, writing IOS apps is similar to C, so it is easy to forget to release the memory, memory is very valuable for mobile devices. Even though the memory of the iPhone is already MB, the background mode of Apple encapsulates the entire application and waits for the next activation. Therefore, the memory occupied by the application is also occupied. That is, even if the application enters the background mode, it still occupies the original memory. Therefore, the more applications you open, the more memory consumption. For many common users, the applications they open are usually in the background mode, and few users clean up background applications. Therefore, many applications still have very limited available memory.
(Aside: if Apple supports one-click cleanup of background programs, it seems like this is supported in the jailbreak tool ).
There are also developers who have tested iOS app automation. They should be familiar with uiautomation. Yes, it is to write interface automation test cases through JS scripts. The instruments application has excellent support for uiautomation. You can use it to view many potential code problems and test the performance.
In fact, there are many powerful functions in the instruments application. It supports many native instrument tools to help you analyze your code, not only including memory detection and automated testing, it can also monitor waiting for file read/write operations. Therefore, a good IOS developer should master the use of the instrument application. Because the instruments application itself is too powerful, it is impossible to grasp the opportunity completely, but because many of their built-in tools have similarities, you can basically master what you commonly use. At the same time, let's take a look at the internal functions so that you can quickly get started when you need to use them.
Finally, in the process of translation, this article finds that many Chinese translations are obscure, so the free translation method is adopted. This inevitably leads to some discrepancies with the original article, if you find any errors during reading, you can send me an email:Xyl.layne@gmail.com.
Finally, let's take a look at my weibo posts for communication and learning.
Weibo address:
Http://weibo.com/u/1826448972
Finally, I hope this document will help those who feel difficult to read the official English documents. If you can, I recommend that you view the original English documents as much as possible. After all, it is original and translation cannot avoid some omissions.
Because the translation is written in word, the format is too large, so it is difficult to upload images, so we can directly convert them to PDF for you to download.
Directory preview is provided as follows:
Directory
Introduction to instruments User Guide
Organizational structure of this document
Chapter 1 Introduction to instruments
1.1 start instruments
1.2 create a trail document
1.3 browsing and tracking document window
1.4 example: Quickly use a trail
1.5 What is next?
Chapter 2 add and configure the instruments Tool
2.1 use the instrument Library
2.1.1 modify the library attempt Mode
2.1.2 search for an instrument tool in the library
2.1.3 create a custom instrument group
2.2 add and delete instruments
2.3 configure an instrument tool
Chapter 3 Record tracking data
3.1 select the process to be tracked
3.1.1 track all processes
3.1.2 track an existing process
3.1.3 tracking a new process
3.1.4 specify different targets for each instrument tool
3.2 collect data
3.3 Use the Quick Start key to start instruments
3.4 run in minimal mode
3.5 run the instruments application from xcode
3.6 wireless connection to iOS devices
Chapter 4 record user interface tracks
4.1 Record User Interface tracks
4.2 record user interface tracks repeatedly
4.3 playback of user interface tracks
Chapter 5 view and analyze tracking data
5.1 tools for viewing data
5.1.1 tracking panel
5.1.2 Detail Panel
5.1.3 extended Detail Panel
5.1.4 run the browser
5.2 Analysis Technology
5.2.1 use sampler instrument to analyze data
5.2.2 use allocat**** instrument tool to analyze data
5.2.3 search for Memory leakage
5.2.4 analyze core data applications
Chapter 6 Saving and importing tracking data
6.1 Save the tracking document
6.2 export tracking data
6.3 import data from the sample Tool
6.4 Use dtrace data
Chapter 7 use dtrace to create a custom instruments Tool
7.1 about custom instruments tools
7.2 create a custom instrument tool
7.2.1 add and delete probes
7.2.2 provider of the specified Probe
7.2.3 add assertions to the probe
7.2.4 Add an action to the probe
7.2.5 prompt for writing custom scripts
7.2.6 compile the in and end scripts
7.2.7 access kernel data from custom scripts
7.2.8 variable scope
7.2.9 script query Error
7.3 export the dtrace script
Chapter 8 built-in instruments tools
8.1 core data instruments [core data related]
8.1.1 core data saves
8.1.2 core data fetches
8.1.3 core data faults
8.1.4 core data cache misses
8.2 dispatch instruments [concurrency related]
8.2.1 dispatch
8.3 energy Diagnositics instruments [battery diagnostics]
8.3.1 energy usage)
8.3.2 CPU activity (CPU acitivity)
8.3.3 display brightness)
8.3.4 sleep/Wake)
8.3.5 Bluetooth)
8.3.6 wireless (WiFi)
8.3.7 positioning (GPS)
8.4 file system instruments [File System related]
8.4.1 I/O activity (I/O activity)
8.4.2 File locks)
8.4.3 file attributes (file attributes)
8.4.4 file Activity)
8.4.5 directory I/O (directory I/O)
8.5 garbage collection instruments [Garbage Collection]
8.5.1 GC total
8.5.2 garbage collection)
8.6 graphics instruments [drawing related]
8.6.1 core Animation)
8.6.2 OpenGL driver)
8.6.3 OpenGL ES driver)
8.6.4 OpenGL ES Analyzer)
8.7 input/output instruments [input/output problems]
8.7.1 read/write (Reads/wirtes)
8.8 master tracks instruments [interface operation tracking]
8.8.1 user interface)
8.9 memory instruments [memory-related]
8.9.1 shared memory)
8.9.2 allocate memory (allocati *****)
8.9.3 Memory leakage (leaks)
8.10 system instruments [system related]
8.10.1 time profiler)
8.10.2 rotating Monitor)
8.10.3 sampling (sampler)
8.10.4 Process)
8.10.5 network activity monitor)
8.10.6 memory monitor)
8.10.7 disk Monitor)
8.10.8 CPU Monitor)
8.10.9 activity monitor)
8.11 threads/locks instruments [thread-related]
8.11.1 Java thread)
8.12 UI automation [UI automation]
8.12.1 use Automation instrument tools
8.12.2 accessing and Operating User interface elements
8.12.3 add flexible supertime
8.12.4 test results
8.12.5 days for outputting test results and data
8.12.6 handle warnings
8.12.7 detect and specify the direction of the device
8.12.8 test multiple tasks
8.13 User Interface instruments [user interface]
8.13.1 cocoa event (cocoa events)
8.13.2 carbon event (carbon events)
Conclusion
Recommended Resources