Memory profiling doesn't work with Xcode 9
I am using the latest version of Xcode 9 and macOS 10.13.
When I try to make a memory graph from the current state of my application, it shows an empty screen that says No Selection.
I also tried to profile and work with Instruments, but it did not allow me to run due to a permission error.
Target failed to run.
Permission to debug [app name] was denied.
I am aware of these threads and tried the suggestions available in them, but they didn’t seem to work:
- Reddit – Has instruments stopped working for you in Xcode 9 due to a permission denied error? Is there a workaround for this?
- Apple Developer Forums – Xcode 9 – Instruments permission denied
- Stack Overflow – Why do I get instruments – “Target failed to run”?
- Stack Overflow – Can’t launch my app in Instruments: At least one target failed to launch
Things that I tried:
- Restarting Xcode
- Emptying the Derived Data folder
- Cleaning the project
- Cleaning the Build folder
- Modifying the scheme’s application environment to Debug instead of Release
- Manually managing provisioning profiles and selecting Development profiles for Debug and Release
- Trying simulators with different OS versions (iOS 11, iOS 10)
Looks like it’s a specific issue with Xcode 9.
Are there any workarounds for this issue?
- Module compiled with Swift 4.0 cannot be imported in Swift 4.0.1
- Xcode 9 custom fonts not working
- CoreData: annotation: Failed to load optimized model at path with Xcode 9 GM
- Module compiled with swift 4.0 cannot be imported in swift 3.1
- dyld: dyld_sim not compatible mach-o
- Unable to run on simulator with Xcode 9.0
4 Solutions Collect From Internet About “Memory profiling doesn't work with Xcode 9”
I tried building the application on a physical device and it worked, hovever, the memory graph did not show my Swift classes (for e.g., my controllers were simply not there). Allocation observing worked fine with Instruments, nonetheless.
It seems like this is an issue caused by the simulator.
In My Case I was Using Xcode 9. When I have checked to Xcode-> Preferences->Locations->Command Line Tools = Xcode 8.3.3 so I just Changed from Xcode 8.3.3 to Xcode 9.0 and It starts working.
Updating Xcode to 9.2 solved this problem for me.
In my case the Build Configuration for Profiling was set to Release instead of Debug in the Scheme. After changing it, I could just profile in the Simulator.
Hope this helps.
- Access custom object property while iterating over dictionary
- Can't type into html input fields on iOS after clicking twice
- Async image loading from url inside a UITableView cell – image changes to wrong image while scrolling
- UICollectionView align logic missing in horizontal paging scrollview
- How do I use SPACE instead of TAB in NSTextView
- Convert UIImage to CVImageBufferRef
- program access to iPhone volume buttons
- Xcode 9: Provisioning profile is Xcode managed, but signing settings require a manually managed profile
- Convert Swift Dictionary With Enum Value To NSDictionary
- Layer animations removed when switching apps
- UISplitViewController detail-only inputAccessoryView
- Build FFmpeg with xCode 5
- xcode 6 pch.file not found
- How to pass the touch event to superview when userInteractionEnabled = YES?
- Facebook login page showing blank page in IOS 9