• This repository has been archived on 16/Feb/2024
  • Stars
    star
    801
  • Rank 56,459 (Top 2 %)
  • Language
    C
  • License
    MIT License
  • Created about 7 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🍎Objective C Method Tracing Call Chart

AppleTrace

AppleTrace is developed for analyzing app's performance on iOS.

>> I have developed a replacement called Messier which is much easier to use. :)

logo

appletrace

Feature

  1. User-defined trace section.
  2. Trace Objective C methods.

FAQ

Go to Wiki

Clone

git clone https://github.com/everettjf/AppleTrace.git

For stable release , please refer to Releases

Usage

  1. Produce trace data.
  2. Copy from app's sandbox directory.
  3. Merge (all) trace data files into one file trace.json. (There may be more than 1 trace file.)
  4. Generate trace.html based on trace.json.

See below for more detail.

1. Produce

Until now , there are 2 ways for generating trace data.

(1) Manual set section.

Call APTBeginSection at the beginning of method ,and APTEndSection at the end of method. For Objective C method (whether instance method or class method), there are APTBegin and APTEnd macro for easy coding.

void anyKindsOfMethod{
    APTBeginSection("process");
    // some code
    APTEndSection("process");
}

- (void)anyObjectiveCMethod{
    APTBegin;
    // some code
    APTEnd;
}

Sample app is sample/ManualSectionDemo.

(2) Dynamic library hooking all objc_msgSend.

Hooking all objc_msgSend methods (based on HookZz). This only support arm64 under debugger ( lldb).

Sample app is sample/TraceAllMsgDemo.

2. Copy

Using any kinds of method, copy <app's sandbox>/Library/appletracedata out of Simulator/RealDevice.

appletracedata

3. Merge

Merge/Preprocess the appletracedata.

python merge.py -d <appletracedata directory>

This will produce trace.json in appletracedata directory.

NOW !!!, you could drop trace.json into Chrome's chrome://tracing. Or if you want to generate a html result, continue to the 4th step.

4. Generate

Run sh get_catapult.sh to get catapult source.

Then generate trace.html using catapult.

python catapult/tracing/bin/trace2html appletracedata/trace.json --output=appletracedata/trace.html
open trace.html

trace.html only support Chrome

SampleData

Open sampledata/trace.html using Chrome.

Thanks

  1. HookZz : https://github.com/jmpews/HookZz
  2. catapult : https://github.com/catapult-project/catapult

Group

欢迎关注微信订阅号,更多有趣的性能优化点点滴滴。

fun

More Repositories

1

MachOExplorer

🧱Explore MachO File on macOS and Windows
C++
596
star
2

TomatoRead

RSS Reader for iOS Developers
Objective-C
480
star
3

Yolo

😈Scripts or demo projects on iOS development or reverse engineering
Objective-C
314
star
4

ScriptWidget

ScriptWidget is an iOS app that we can create widgets for iOS using JSX label style in JavaScript.
Swift
210
star
5

EasyVM

Yet another virtual machine application based on the Virtualization framework
Swift
96
star
6

WasmPatch

🧱Yet Another Patch Module for iOS/macOS via WebAssembly
C
89
star
7

atosl-rs

🦀️atos for linux by rust - A partial replacement for Apple's atos tool for converting addresses within a binary file to symbols.
Rust
81
star
8

USBKeyboard

Keyboard app that allows you type in macOS and input into iOS through USB wire.
Objective-C
70
star
9

XBookmark

Bookmark Plugin for Xcode 8.x and 7.x
Objective-C
70
star
10

vscode-filter-line

vscode extension for filter line by strings or regular expressions
TypeScript
68
star
11

zlldb

🐞LLDB scripts for iOS development
Python
53
star
12

dirtrace

👣Generate chromium's trace event format json file from directory based on file size
Python
40
star
13

Xcode13ClockHandRotationEffectModifier

Swift
37
star
14

supotato

Classify (.h) header files into a text (.txt) report according to the first 2 letters of each file name.
Python
23
star
15

Papers

Paper Collection
20
star
16

everettjf.github.io

everettjf's blog
CSS
18
star
17

NaturalScrollMouseForWindows

Natural scroll mouse in windows (just like in Mac OS X)
C++
17
star
18

dyld_shared_cache_ida

iOS 14 dyld_shared_cache IDA 7.5 Windows idb file
15
star
19

SpaceVimTutorial

[Deprecated] SpaceVim入门教程
15
star
20

XSourceNote

(!!Deprecated, only for Xcode7)Xcode plugin for writing notes when reading codes, and generate markdown articles.
Objective-C
14
star
21

Chatterbox

Who is the winner of app release frequency
Python
12
star
22

DictionaryPullDownToClose

Tweak : Pull down and release to close iOS system dictionary
Objective-C++
10
star
23

vscode-pubspec-dependency-search

VSCode extension for flutter developer to easy search package in web browser
TypeScript
7
star
24

linkmap-rs

🦀️Linkmap file parse library for rust
Rust
7
star
25

RubySVMVirusScanner

Virus scanner (PE classifier) based on rb-libsvm and pedump
Ruby
5
star
26

zvim

personal vim
Vim Script
3
star
27

bifrost

[WIP]Simple socket wrapper for iOS/Android/macOS/Windows based on Asio
C++
2
star
28

filterline

Command line replacement for vscode-filter-line
TypeScript
2
star
29

iBooksLookUpCloser

Cydia tweak to add left bottom "Done" button to dictionary view (after tap "Look Up") in iBooks
Objective-C++
2
star
30

SwiftCallRustDemo

Swift
1
star
31

dirsum

Get formatted summary for specified directory
Rust
1
star