Does the new HTTP Traffic instrument require iOS15 running on the device? I am attempting to profile my app and I get an error saying 'This device is lacking a required capability'?
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
Hi there,
In a project that I am working on, whenever I try running instruments for allocations to see the memory allocations that are happening under the hood, I see the statistics, and the traces updating, however the chart never updates.
I have made new projects on the machine, and I have tried different Xcode versions, and they all show the chart just fine. I have tried running the project on other machines with no success. I have double checked the arguments and options on the active schema I am trying to profile with the schema of a new project and they are identical.
Here is a picture of how it looks:
My questions are as follows:
What properties and settings can disable the chart from showing up?
What diagnostic steps recommended that I should take?
I can not share a reproducible as this is the only project I have with this problem and it is not mine, but please tell me if there is anything else I can provide in order to debug this.
All the best
Parsa
Topic:
Developer Tools & Services
SubTopic:
Instruments
Tags:
Xcode
Developer Tools
Instruments
Debugging
Can somebody help me find the official documentation for instruments?
Google brings you to this forum, then the link at the top of this forum for Instruments documentation brings you to the Xcode page, which links to these Apple developer docs, wherein a search returns nothing for "Instruments". Searching these Xcode docs for "Instruments" returns only this specific use case on analyzing HTTP traffic.
Topic:
Developer Tools & Services
SubTopic:
Instruments
Recently, we reworked a crucial part of our app and managed to half the amount of CPU cycles our app requires (according to Xcode Instruments).
Nonetheless, when using the Time Profiler component in instruments, it shows that the CPU time spent was either higher or the same (depending on execution).
The main time-consuming factor here: libsystem_pthread.dylib - the amount of CPU time spent by this library has doubled from original implementation to reworked implementation.
Therefore, I'm having a few questions:
How should I interpret this result?
How is this even possible if the CPU clock cycles halved?
What is the better metric here, the CPU cycles or the time profiler?
How can I reduce the impact of that said library? What does that library do and how can I influence its performance?
Thanks in advance.
What exactly is included/calculated in the following metrics within RealityKit Trace - RealityKit Metrics - 3D render attributes:
3D Mesh Triangles
Total Triangles Submitted
3D Mesh Vertices
Total Vertices Submitted
As the second part of the question, what differentiates between:
3D Mesh Triangles vs Total Triangles Submitted
3D Mesh Vertices vs Total Vertices Submitted
When I was using Instruments to test the Display on my phone, I discovered a long-duration frame. Below that frame, there were some gaps in the vsync queue. As I understand it, vsync signals should appear consistently and steadily. How can this behavior be explained?
My phone is iPhone 15 Plus and iOS 18.
First of all, you cant unlock the device, even if you know the password. Thats one thing.
Then, you cant use your main device to navigate trough the device you are controling. You basically can’t do shit to be honest. And Siri is on a bad mood this days.
That’s what I have to say to you my friends.
Eu amo vocês.
beijos.
Consertem essa porra.
E o “Eye Tracking” está bugado também. Não funciona direito.
Hello, I develop app using pure React Native which uses pods under the hood uses pods to install dependencies.
With some of dependencies I have such error only on a real device(on a simulator everything is ok):
"dyld[53510]: Symbol not found: __ZN5swift39swift51override_conformsToSwiftProtocolEPKNS_14TargetMetadataINS_9InProcessEEEPKNS_24TargetProtocolDescriptorIS1_EEN7__swift9__runtime4llvm9StringRefEPFPKNS_35TargetProtocolConformanceDescriptorIS1_EES4_S8_SC_E
Referenced from: <4A3492BF-0479-3124-BE58-05BAED71BB20> /private/var/containers/Bundle/Application/0D9FDF5C-BBC9-4060-972B-B2D6FD91E321/appName/Frameworks/pathToPod
Expected in: <0549B906-CB15-3735-AA15-FAEB5F687C8B> /private/var/containers/Bundle/Application/0D9FDF5C-BBC9-4060-972B-B2D6FD91E321/appName/Frameworks/pathToPod"
Anyone else having the same problem or have any ideas on how to fix this?
Topic:
Developer Tools & Services
SubTopic:
Instruments
Hi Apple Engineers,
I am encountering an issue where the memory usage reported by the Xcode memory report and the Xcode Instruments memory profiler are not aligned. Specifically:
Xcode Memory Report:
After implementing autoreleasepool, URLSession reading a zip file, and moving the task inside DispatchQueue.global().async, the memory usage goes down from 900MB to 450MB, indicating a potential memory leak.
Xcode Instruments Memory Profiler:
The memory usage goes down from 900MB to 100MB, suggesting that the memory has been properly released and there is no significant memory leak.
Could you please help me understand the discrepancy between these two tools and provide guidance on the appropriate way to interpret the memory usage in my application? Which result I should rely on it?
I would greatly appreciate your insights and expertise on this matter. Thank you in advance for your assistance.
I've been developing an app for macOS for some time. As I've been approaching the app's final development stages, I decided to try Instruments as I've suspected a memory leak was occurring, since my app's memory usage slowly grows over time. Instruments has found one leak, and I've spent considerable time trying to find the cause. Long story short, I've ended up with just an EmptyView() and Instruments were still showing a leak. I've tried creating a new project with a placeholder "Hello, world!" text, and Instruments were still detecting a leak. Am I doing something wrong here? Maybe I'm not using Instruments correctly? Or is this a bug? My Instruments version is 16.0, macOS Sequoia 15.1.
Hello, I would like to obtain the average CPU usage of a trace I ran through instruments by looking at the cpu profiler. Is there any way to do this? Or should I be using another instrument.
six months have passed since I bought this iPhone 13. till 3 months it was having the battery health of 100% but now it is draining rapidly. It drained to 99% in November.at the beginning of December it was 98%. on 23 December 97% and now on new year its 96%. can anybody tell me why ?
Hey,
In the UI of the Instruments app, I can change the recording mode to immediate. Is that possible when using xctrace? It seems to use deferred as a default.
I've tried to create a template, set the recording mode to immediate, and use that template for recording. However, that doesn't seem to work. At least the exported TOC of the .trace will have the following summary:
<summary>
<start-date>2025-01-11T13:00:11.365+01:00</start-date>
<end-date>2025-01-11T13:00:30.525+01:00</end-date>
<duration>19.160279</duration>
<end-reason>Target app exited</end-reason>
<instruments-version>16.0 (16A242d)</instruments-version>
<template-name>core_animation_fps</template-name>
<recording-mode>Deferred</recording-mode>
<time-limit>12 hours</time-limit>
</summary>
This issue might be related to: https://developer.apple.com/forums/thread/735948
Thanks a lot!
Hi there,
How to let instruments - app launch template wait for process to launch , rather than actively launch by instruments?
I need to profile the app launch performance when clicking a push notification or cold launch via a url link. How to let instruments to wait for the process and collect the data?
Currently, I tried the command
xctrace record --template "App Launch"
--attach MyApp
--device-name 'Phone-Dev'
--output mytrace.trace
But it soon failed with 'Cannot find process matching name: MyApp'. How to make it work?
Topic:
Developer Tools & Services
SubTopic:
Instruments
Hello,
I’m encountering an issue with the Instruments app while running a benchmark on an M2 Ultra Mac Studio. Despite being certain that GPU activities involving memory read and write operations are occurring, all related performance counters consistently return 0.
Interestingly, this problem does not occur when using the same code on an M1 MacBook Air, where the counters behave as expected.
What could be causing this discrepancy? Any insights or suggestions would be greatly appreciated.
Thank you!
Topic:
Developer Tools & Services
SubTopic:
Instruments
Tags:
Metal
Metal Performance Shaders
metal-cpp
Hey folks,
We are looking for a way to increase the sampling frequency beyong what's currently called "high frequency sampling" for CPU profiler (or time profiler -- doesn't really matter for us).
We are aware that this is not offered through the UI but wondering if we can somehow experimentally enable this via the .tracetemplate (plist).
Basically, we see that samplingRate exists (in the plist) but don't see it having an effect on the actual runs. The resulting trace file always lists sample-rate-micro-seconds="1000" for the data table. E.g.,
<table trigger="time" pmc-events="Cycles" target-pid="SINGLE" schema="counters-profile" needs-kernel-callstack="0" sample-rate-micro-seconds="1000"/>
Cheers
Topic:
Developer Tools & Services
SubTopic:
Instruments
* [Error] Failed to stop recording session: Failed stoping ktrace session.
(xcode-select version 2409)
So why can't it stop the ktrace session? And how long has that typo been around? 😄 (Look, I've kept typos in log messages for years because it differentiated that message from other messages.)
Topic:
Developer Tools & Services
SubTopic:
Instruments
It looks like, for some reason, our apps are using a bunch of power sometimes. sysdiagnose has this in the power log:
Never mind. Including the output of sysdiagnose has "sensitive language," and it won't tell me what is sensitive, making this a waste of my time.
ETA: Ok, I I can attach the file: power.log
I've gone through the energy documentation, but it seems geared towards embedded, not macOS, so I'm not sure how I can figure this out more. The extra problem, of course, is that we have a network extension, two daemons, and a GUI app. 😄
I've discovered what appears to be a system-level memory leak when pressing any key in Swift UI projects. This issue occurs even in a completely empty SwiftUI project with no custom code or event handlers.
When monitoring with Instruments' Leaks tool, I observe multiple memory leaks each time any key is pressed. These leaks consist primarily of:
NSExtraData objects (240 bytes each)
NSMenuItem objects (112 bytes each)
Other AppKit and Foundation objects
Has anyone else encountered this issue? How can I fix this behavior? While the leaks are small (about 5-6KB per keypress), they could potentially accumulate in applications where keyboard input is frequent.
I am using XCode16 and macOS 14.7.2. Previously, using the instruments on an iPhone with iOS 14.3 was normal, but when I upgraded to iOS 18, the instruments often couldn't find the library.
I have to restart the instruments to restore normal operation, but the problem will occur again after using it for a period of time