Tracer
Custom Xcode Instruments package that implements tracing of any activities inside the app. See detailed description here: https://appspector.com/blog/instruments-part-2
Install / Use
/learn @appspector/TracerREADME
Tracer
This repo contains example project and custom Xcode Instruments package for opentracing-like inspection of any activities in your iOS/macOS app. See detailed description here: https://appspector.com/blog/instruments-part-2
Requirements
os_signpost API is available starting from iOS 12 and macOS 10.14.
To install custom package you need Xcode 10.
Installation
To add the package to your Instruments you have to download it from the Releases, extract, doubleclick and install. After that it will appear in the list of instruments. Unfortunately there is no way to install and update it automatically.
To use the package you need to issue appropriate os_signpost calls, which is more convinient using wrapper from TracingModule directory in sample project. Wrapper could be installed via CocoaPods:
pod 'Tracer', '~> 1.0.1'
or manually by just moving TracingModule directory to your project and importing Tracer:
#import <Tracer/ASTracer.h>
Usage
Manual
There are two ways you can play with tracer. First is manually by using the following API:
- (ASScope *)addScope:(NSString *)scopeName;
- (void)removeScope:(NSString *)scopeName;
- (void)startSpan:(NSString *)spanName inScope:(NSString *)scopeName;
- (void)stopSpan:(NSString *)spanName inScope:(NSString *)scopeName success:(BOOL)success;
Scopes and spans are concepts describing activites you want to trace, i.e. if you want to trace your view controllers activities scope coud be a view controller and span - any activity performed within it. Span and scope names should be unique. Stopping a span you can pass success flag which indicates span completion status, failed spans will be displayed red on a graph lane.

Tracing NSOperations
Also you can use tracer to atomatically trace NSOperations using startTracingOperations call:
[[ASTracer tracer] startTracingOperations];
This will install hooks and KVO observers to track operations lifecycle.

Sample app
If you want to play with package yo ucan use Tracer app in the package Xcode project. It allows to create NSOperationQueues and operations inside them and automatically starts tracing them. Install package then start Tracer app, run Instruments, choose blank template add Tracer package to it and start recording:

Resources
- Article about building custom Instruments pakages:<br> https://medium.com/appspector/building-custom-instruments-package-9d84fd9339b6
- WWDC session 410 'Creating Custom Instruments'<br> https://developer.apple.com/videos/play/wwdc2018/410/
- John Sundell article about os_signpost API<br> https://www.swiftbysundell.com/daily-wwdc/getting-started-with-signposts
- Apple Instruments documentation<br> https://help.apple.com/instruments/developer/mac/10.0/#/
- CLIPS reference<br> http://sequoia.ict.pwr.wroc.pl/~witold/ai/CLIPS_tutorial/
- Article on tracing mechanisms by CossackLabs<br> https://www.cossacklabs.com/blog/how-to-implement-distributed-tracing.html
About Us
Looking for better debugging instrument? Try AppSpector. With AppSpector you can remotely debug your app running in the same room or on another continent. You can measure app performance, view CoreData and SQLite content, logs, network requests and many more in realtime. This is the instrument that you've been looking for.

Related Skills
next
A beautifully designed, floating Pomodoro timer that respects your workspace.
product-manager-skills
49PM skill for Claude Code, Codex, Cursor, and Windsurf: diagnose SaaS metrics, critique PRDs, plan roadmaps, run discovery, and coach PM career transitions.
devplan-mcp-server
3MCP server for generating development plans, project roadmaps, and task breakdowns for Claude Code. Turn project ideas into paint-by-numbers implementation plans.
