{"id":13576286,"url":"https://github.com/everettjf/AppleTrace","last_synced_at":"2025-04-05T05:31:22.229Z","repository":{"id":45906644,"uuid":"102832172","full_name":"everettjf/AppleTrace","owner":"everettjf","description":"🍎Objective C Method Tracing Call Chart","archived":true,"fork":false,"pushed_at":"2021-09-12T01:06:44.000Z","size":1278,"stargazers_count":806,"open_issues_count":1,"forks_count":170,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-11-05T12:33:18.882Z","etag":null,"topics":["analysis","appletrace","catapult","hookzz","ios","macos","os-trace","performance","systrace"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/everettjf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-08T07:28:44.000Z","updated_at":"2024-09-27T04:33:49.000Z","dependencies_parsed_at":"2022-08-12T12:40:13.766Z","dependency_job_id":null,"html_url":"https://github.com/everettjf/AppleTrace","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everettjf%2FAppleTrace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everettjf%2FAppleTrace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everettjf%2FAppleTrace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everettjf%2FAppleTrace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/everettjf","download_url":"https://codeload.github.com/everettjf/AppleTrace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294287,"owners_count":20915333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","appletrace","catapult","hookzz","ios","macos","os-trace","performance","systrace"],"created_at":"2024-08-01T15:01:08.865Z","updated_at":"2025-04-05T05:31:17.217Z","avatar_url":"https://github.com/everettjf.png","language":"C","readme":"# AppleTrace\n\n`AppleTrace` is developed for analyzing app's performance on `iOS`.\n\n*\u003e\u003e I have developed a replacement called [Messier](https://messier.github.io/) which is much easier to use. :)*\n\n![logo](/image/appletrace-small.png)\n\n- [中文说明，开发思路及方法](http://everettjf.github.io/2017/09/21/appletrace/)\n- [搭载MonkeyDev可trace第三方App](http://everettjf.github.io/2017/10/12/appletrace-dancewith-monkeydev/)\n\n![appletrace](https://everettjf.github.io/stuff/appletrace/appletrace.gif)\n\n\n\n## Feature\n\n1. User-defined trace section.\n2. Trace Objective C methods.\n\n## FAQ\n\n[Go to Wiki](https://github.com/everettjf/AppleTrace/wiki)\n\n## Clone\n\n```\ngit clone https://github.com/everettjf/AppleTrace.git\n```\n\nFor stable release , please refer to [Releases](https://github.com/everettjf/AppleTrace/releases)\n\n## Usage\n\n1. Produce trace data.\n2. Copy from app's sandbox directory.\n3. Merge (all) trace data files into one file `trace.json`. (There may be more than 1 trace file.)\n4. Generate `trace.html` based on `trace.json`.\n\nSee below for more detail.\n\n### 1. Produce\n\n\nUntil now , there are 2 ways for generating trace data.\n\n(1) Manual set section.\n\nCall `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.\n\t\n```\nvoid anyKindsOfMethod{\n    APTBeginSection(\"process\");\n    // some code\n    APTEndSection(\"process\");\n}\n\n- (void)anyObjectiveCMethod{\n    APTBegin;\n    // some code\n    APTEnd;\n}\n```\n\t\nSample app is `sample/ManualSectionDemo`.\n\t\n(2) Dynamic library hooking all objc_msgSend.\n\nHooking all objc_msgSend methods (based on HookZz). This only support arm64 under debugger ( lldb).\n\nSample app is `sample/TraceAllMsgDemo`.\n\n### 2. Copy\n\nUsing any kinds of method, copy `\u003capp's sandbox\u003e/Library/appletracedata` out of Simulator/RealDevice.\n\n![appletracedata](image/appletracedata.png)\n\n\n### 3. Merge\n\nMerge/Preprocess the `appletracedata`.\n\n```\npython merge.py -d \u003cappletracedata directory\u003e\n```\n\nThis will produce `trace.json` in appletracedata directory.\n\nNOW !!!, you could drop `trace.json` into Chrome's `chrome://tracing`. Or if you want to generate a html result, continue to the 4th step.\n\n### 4. Generate\n\nRun `sh get_catapult.sh` to get catapult source.\n\nThen generate `trace.html` using `catapult`.\n\n```\npython catapult/tracing/bin/trace2html appletracedata/trace.json --output=appletracedata/trace.html\nopen trace.html\n```\n\n*trace.html only support Chrome*\n\n## SampleData\n\nOpen `sampledata/trace.html` using Chrome.\n\n## Thanks\n\n1. HookZz : https://github.com/jmpews/HookZz\n2. catapult : https://github.com/catapult-project/catapult\n\n## Group\n\n欢迎关注微信订阅号，更多有趣的性能优化点点滴滴。\n\n![fun](wechat.png)\n\n\n","funding_links":[],"categories":["Applications","C"],"sub_categories":["Development","👨‍💻 Development (9)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverettjf%2FAppleTrace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feverettjf%2FAppleTrace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverettjf%2FAppleTrace/lists"}