Instruments

RSS for tag

Instruments is a performance-analysis and testing tool for iOS, iPadOS, watchOS, tvOS, and macOS apps.

Instruments Documentation

Post

Replies

Boosts

Views

Activity

installer doesn't put on disk embedded application
Hello! I have an applications which contains another application in Contents/EmbeddedApps/ pkgbuild --root "$rootdir/$APPNAME" --scripts installscripts --install-location "/Applications/$APPNAME" --identifier com.my.id --sign 'Developer ID Installer: *** (YYY)' --version $VERSION "$PACKAGE.pkg" Notarised then. Now when I install the package I don't see embedded application inside Contents/EmbeddedApps/ macOS Version 14.6 Beta (23G5061b) A month ago I was able to install my packges successfully. But now all my old packages are affected. Also I made simple project with just two "Hello World" applications and embed one into another. I create .pkg notarised package and try to install it. Still EmbeddedApps is empty. But the files of embedded application in build/ directory becomes crowned root:wheel. Looks like installer uses my working directory for embedded application instead of /Applications/MyApp.app/Contents/EmbeddedApps/Emb.app
0
0
44
1d
instruments Error using CLI
While running instruments using CLI we are seeing below error: command: xcrun xctrace record --template Leaks --launch application --output recording.trace -e DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib Run issues were detected (trace is still ready to be viewed): [Error] An error occurred trying to capture Leaks data. [Error] Failed to generate memory graph for pid 7828: failed to create a VMUTaskMemoryScanner, probably because the target's libmalloc hasn't been initialized Recording failed with errors. Saving output file... System details: Xcode 15.4 Mac :Intel processors MacOs:14.5
0
0
22
2d
Really High Energy Use
I'm developing an app where users can select items to add to a screen, similar to creating a Canva presentation or choosing blocks in Minecraft. However, I'm encountering an issue with energy usage. When users click the arrows to browse different items, the energy use spikes significantly. Although it returns to normal after a while, continuous clicking causes the energy use to skyrocket. The images I'm using are 500x500 pixels. Ideally, I would like to avoid caching all the images, as the app might have up to 500 items and caching them all would consume too much memory. I have tried numerous way to avoid this but I just can’t seem to make it work. Would anyone know how to avoid such problem? I have included a picture of the energy use when just opened, and one after like 10 seconds of continuously clicking on an arrow to see more items. Also a picture of how the app looks. struct ContentView: View { struct babyBackground { var littleImage = "" } @State var firstSet: [babyBackground] = [ babyBackground(littleImage: "circle"), babyBackground(littleImage: "square"), babyBackground(littleImage: "triangle"), babyBackground(littleImage: "anotherShape"), babyBackground(littleImage: "circle"), babyBackground(littleImage: "square"), babyBackground(littleImage: "triangle"), babyBackground(littleImage: "anotherShape") ] @State var secondSet: [babyBackground] = [ babyBackground(littleImage: "circle"), babyBackground(littleImage: "square"), babyBackground(littleImage: "triangle"), babyBackground(littleImage: "anotherShape"), babyBackground(littleImage: "circle"), babyBackground(littleImage: "square"), babyBackground(littleImage: "triangle"), babyBackground(littleImage: "anotherShape"), babyBackground(littleImage: "circle") ] @State var thirdSet: [babyBackground] = [ babyBackground(littleImage: "circle"), babyBackground(littleImage: "square"), babyBackground(littleImage: "triangle"), ] let columns: [GridItem] = Array(repeating: .init(.flexible()), count: 4) func createBackgroundGridView(for backgrounds: [babyBackground], columns: [GridItem] ) -> some View { LazyVGrid(columns: columns, spacing: 10) { ForEach(0..<backgrounds.count, id: \.self) { index in Button(action: { }, label: { if let path = Bundle.main.path(forResource: backgrounds[index].littleImage, ofType: "png"), let uiImage = UIImage(contentsOfFile: path) { Image(uiImage: uiImage) .resizable() .frame(width: 126, height: 96) } }) } } .padding() } @State var indexOn = 0 var body: some View { HStack{ Button(action: { indexOn = (indexOn == 0) ? 2 : indexOn - 1 }) { Label("", systemImage: "arrowtriangle.left.fill") .font(.system(size: 50)) } Spacer() ScrollView { switch indexOn { case 0: createBackgroundGridView(for: firstSet, columns: columns) case 1: createBackgroundGridView(for: secondSet, columns: columns) case 2: createBackgroundGridView(for: thirdSet, columns: columns) case 3: createBackgroundGridView(for: thirdSet, columns: columns) default: createBackgroundGridView(for: firstSet, columns: columns) } } .frame(maxWidth: .infinity, maxHeight: .infinity) Spacer() Button(action: { indexOn = (indexOn == 2) ? 0 : indexOn + 1 }) { Label("", systemImage: "arrowtriangle.right.fill") .font(.system(size: 50)) } } } } Energy Use when app starts: Energy use after clicking for about 10 seconds: App UI:
0
1
38
2d
Error attaching to the pid
Hi 👋 I need assistance in attaching the to the pid in terminal. In lldb mode I am connecting to the pid using device process attach --pid <pid-id> which gives me an error Process 505 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP frame #0: 0x00000001d505c808 libsystem_kernel.dylib`mach_msg2_trap + 8 libsystem_kernel.dylib`mach_msg2_trap: -> 0x1d505c808 <+8>: ret Thanks
1
0
113
1w
Instruments false positives
I have been able to get rid of reported memory leaks in Instruments not by fixing a leak but by adding some lines (like releasing a previous nil object) that convinced Instruments it is not a leak. But I am stuck are some I cannot stop Instruments from reporting. It reports a leak in this code if(expr.length>0) { // add previous Atomic Atomic *atom = [[Atomic alloc] initWithString:[string substringWithRange:expr] isNumber:aNum]; [exprTokens addObject:atom]; [atom release]; } } and it underlines the substringWithRange method. I changed code to explicitly release atom and I assumed substringWithRange would return an autoreleased new string. I am aware Instruments tells you where the leaked object is created and not where it is leak, but only things created here are atom and a sub string and atom is released immediately. The initWithString method might do it, but I don't find anything there. Also, while running instruments, this code is 8542 times (I am pretty sure always in the same context) and Instruments says it only leaks 61 times. I don't now if there is misunderstanding are a code problem?
1
0
123
1w
iOS simulator glitching erratically constantly
I am using an iPhone 15 Pro as my iOS simulator, and the IDE that I am using is Android Studio. This issue is happening on a 2019 MacBook Pro 16 inch, running the latest version of Xcode, and running macOS Sonoma 14.5. I've never had this issue on other, older/newer Macs with Android Studio. Everytime I interact with the simulator, it shows green bars and distorts the view quite a bit (See screenshots below). I tried all that I could think of, including, but not limited to: Restarting simulator, restarting MacBook, restarting Android Studio, using different iOS simulators (same problem), and so forth. I have not found any such occurrence to anyone else while looking online for answers. One interesting thing that I noticed is that for Xcode projects, the simulator runs perfectly, but when I use Android Studio, the simulator doesn't work properly at all. Any solutions to this? All input is greatly appreciated. P.S.: I have tested the app on an actual iOS device, and it works perfectly. Here are some screenshots. This show what happens when you scroll or interact with the app: (Each screenshot is a different interaction)
0
0
91
1w
The connection to service named com.apple.testmanagerd was invalidated: failed at lookup with error 3 - No such process.
The connection to service named com.apple.testmanagerd was invalidated: failed at lookup with error 3 - No such process. Currently I am struggling with this problem while running tests runner `xcrun devicectl device process launch --console --device '000000000000000000000' 'com.gl.RunnerPOC-Watch-AppUITests.xctrunner What may be causing the issue? Thanks in advance
0
0
183
2w
iOS 18 isn't an option to run my app in simulator - xcode 16 beta
what could be the reason? i open my app in xcode 16. build completes successfully. i am only given the options to simulate in iOS 17, 17.2 or 17.5. none of the devices show the option to run in iOS 18. but i am able to go into the simulator and through file and open the iOS 18 simulator. just not able to run my app in there. my app is set in xcode to run with a minimum of iOS 16. any ideas?
1
0
564
3w
unable to find utility "instruments"
I am building an old app with very old dependencies on the new xcode. Download xcode 14.2 or below looks like a solution. I am not sure if that's possible. Building for simulators fail because of arm64. Phone is my only option. When using `react-native run-ios --device' it fails with sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find instruments 2> /dev/null' failed with exit code 17664: (null) (errno=No such file or directory) xcrun: error: unable to find utility "instruments", not a developer tool or in PATH. Here is my configuration System: OS: macOS 14.5 CPU: (8) arm64 Apple M2 Memory: 244.50 MB / 16.00 GB Shell: Unknown Binaries: Node: 16.20.0 - ~/.nvm/versions/node/v16.20.0/bin/node Yarn: 3.6.4 - /opt/homebrew/bin/yarn npm: 8.19.4 - ~/.nvm/versions/node/v16.20.0/bin/npm Watchman: 2024.05.06.00 - /opt/homebrew/bin/watchman SDKs: iOS SDK: Platforms: DriverKit 23.5, iOS 17.5, macOS 14.5, tvOS 17.5, visionOS 1.2, watchOS 10.5 IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.9971841 Xcode: 15.4/15F31d - /usr/bin/xcodebuild npmPackages: react: 16.8.6 => 16.8.6 react-native: 0.60.4 => 0.60.4
2
0
229
3w
Memory profiler crash on running profile for debugging WKWebKit crash
We are getting crash issue in our WKWebkit based Cordova application due to memory issues. However, for debugging the memory issue we are trying to use JavaScript allocations in the memory profiler of instruments. and while using it, the profiler automatically closes within few seconds, and we are not able to debug the underlaying memory issue in the WKWebKit. I
4
0
252
Jun ’24
Testflight and AppStore installation fails
I'm working on this Mac Safari extension https://apps.apple.com/app/id6464076425 The installation of the app via Testflight stops without any success (only for me) As well as the installation via AppStore. This happens only to me. I tried it on another computer, and it installed successfully. Here are some videos: This makes the development and release process impossible until I solve this problem. I tried all the methods I could find online, such as: Deleting the currently installed app Restarting Safari Restarting my Mac Is there anything else I can do to fix this problem?
0
0
251
Jun ’24
Is it possible to run instruments an App without being connected to Xcode?
I'm currently supporting an app where one of the dependencies we use had an update. The app is an iPad only app that is meant to be run as a kiosk (guided access, single app mode). After the dependency update for the casing of the tablet / kiosk, we noticed an uptick in errors that may or may not have been associated with the recent 3rd party software update. I wanted to verify if the update had an impact on our production kiosks. To get a good idea of whether or not the update for casework's library had a negative impact, though, I would need to run instruments on a tablet while it's in the case. There's only one power cable to the iPad and the cable that would be used to connect directly to a Mac / Xcode is the same cable that connects to the casework. Is it possible to run instruments, and then retrieve data, from an app that's not directly connected to Xcode? Or is it possible for Xcode to somehow connect via a running instance of an app remotely?
1
0
390
May ’24
Unknown network connection Xcode instruments
Users have reported unusually high data usage with my app. So to investigate I have profiled in instruments. My app as expected in using minimal data. However in instruments I see an "Unknown" process. Which sends around 1mb of data every 2 seconds. Can anyone explain what unknown process is? Sorry my question is vague but I'm at the beginning of understanding the instruments outputs so your help is so very much appreciated.
1
0
365
May ’24