This is a screenshot from the Swift Task track in Xcode.
I made these tasks with
public actor ResourceManager {
func foo() {
for observer in observers {
Task(name: "ResourceManager notify observers") {
await notification(observer)
}
}
}
}
I am confused why each of the task is showing as a separate task in the task lifetime summary. Is there a way to queue the trace in Instruments into the fact that these are indeed the same task?
Instruments
RSS for tagInstruments is a performance-analysis and testing tool for iOS, iPadOS, watchOS, tvOS, and macOS apps.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have been working on battery consumption analysis for my application, and as part of this effort, I wanted to understand how competitor apps behave under similar usage conditions.
To do this, I downloaded competitor apps from the App Store and attached them to Instruments via Xcode. I then executed a defined set of manual test scenarios to simulate real user behavior. During these tests, the iPhone was connected to a Mac and charging continuously, which meant that System Power Usage logs were not generated in Instruments.
However, I was able to capture detailed metrics such as:
Network usage
CPU load
GPU activity
Display and brightness impact
Other runtime performance characteristics
Since direct battery drain data was unavailable, I used derived analysis (with AI assistance) to estimate approximate power consumption based on the above metrics, assuming real-device (battery-powered) conditions.
According to Apple documentation, System Power Usage in Instruments is not directly tied to the device’s battery percentage. Instead, it appears to be computed using contributing factors such as CPU, network, display, and other subsystem activity. This raises a few important questions about data reliability and methodology.
Key questions:
How reliable are Instruments-based metrics (CPU, network, display, GPU) for estimating real-world battery consumption when the device is charging?
Can these metrics be safely used as a comparative baseline between competitor applications, even if absolute battery drain values are unavailable?
Is the System Power Usage instrument essentially a derived model based on subsystem activity, and if so, does it remain accurate when the device is not discharging?
From Apple’s perspective, is this a valid approach for relative power comparison, provided that:
The same device is used
OS version is identical
Test scenarios are consistent and repeatable
Based on these findings, would it be reasonable to proceed with instrumenting our own application, run the same scenarios, and draw conclusions using relative comparisons rather than absolute battery percentages?
The intent is not to claim exact battery drain numbers, but to establish a directionally correct and repeatable comparison that can guide performance optimizations in our own application.
I would like to understand whether this methodology aligns with Apple’s recommended practices, or if there are limitations or inaccuracies I should be aware of before relying on these results for decision-making.
Topic:
Developer Tools & Services
SubTopic:
Instruments
I am profiling a simple SwiftUI test app on my new iPhone through my new MacBook Pro and everything is version 26.2 (iOS, macOS, Xcode). I run Instruments with the SwiftUI template using all of the default settings and get absolutely zero data after interacting with the app for about 20 seconds. Using the Time Profiler template yields trace data. Trying the SwiftUI template again with the sample Landmarks app has the same issue as my app.
what is the diff between INST_ALL and Instructions(FIXED_INSTRUCTIONS)?
also CORE_ACTIVE_CYCLE VS Cycles(FIXED_CYCLES)
Hi everyone,
I’m developing a cross-platform mobile app (React Native) but I don’t currently own a Mac.
What is the most reliable and professional way to:
Build the iOS version
Test it properly (real device / TestFlight)
Upload it to the App Store
Are cloud Mac services (like MacinCloud, AWS Mac, etc.) considered stable for production release workflows?
Is there any fully supported workflow without direct access to a physical Mac?
Would appreciate real-world experience from developers who faced the same situation.
Thanks in advance.
Topic:
Developer Tools & Services
SubTopic:
Instruments
When I try to run dtruss on a command line program (freshclam) I see:
$ sudo dtruss -a /usr/local/bin/freshclam 2>&1 | tee ~/tmp/dtruss.out
dtrace: system integrity protection is on, some features will not be available
dtrace: failed to execute /usr/local/bin/freshclam: DTrace cannot instrument translated processes
I did some research and found advice on how to enable dtrace use via running:
csrutil enable --without dtrace
in a terminal running in macOS recovery mode. When I do that I see a warning saying this is an unsupported configuration and that it will allow unsigned kernel modules to be loaded. This is not what I want, I just want to run dtruss on a program while keeping all the other SIP protections in place. Why can't I just use sudo to grant the privileges for dtrace to work?
All of this has me wondering if Apple intends for developers to use dtruss/dtrace in the current macOS?
Topic:
Developer Tools & Services
SubTopic:
Instruments
Hi everyone,
I am developing a benchmarking tool to measure memory latency (L1/L2/DRAM) on Apple Silicon. I am currently using Xcode Instruments (CPU Counters) to validate my results.
In my latest run for a 128 MB buffer with random access, Instruments shows:
Latency (cycles): ~259 cycles (derived from LDST_UNIT_OLD_L1D_CACHE_MISS / L1D_CACHE_MISS_LD).
Manual Timer Result: ~80 ns.
To correlate these two values, I need the exact CPU Frequency (GHz) at the time of the sample.
My Questions:
Is there a recommended way to programmatically fetch the current frequency of the Performance cores (p-cores) during a benchmark run?
Does Apple provide a "nominal" frequency value for M-series chips that we should use for cycle-to-nanosecond conversions?
In Instruments, is there a hidden counter or "Average Frequency" metric that I can enable to avoid manual math?
Hardware/Software Environment:
Tool: Instruments 26.3+ (CPU Counters Template).
Chip: A19, iPhone 17 pro.
OS: 26.3.
Topic:
Developer Tools & Services
SubTopic:
Instruments
Tags:
Mobile Core Services
Developer Tools
ML Compute
Instruments