Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receiving error 'Unable to attach to task; port invalid' when trying to run Xcode 7 Instruments, Allocations/Leaks tool on connected iPad

I have Macbook Pro (13-inch, Mid 2012) and it is running El Capitan v.10.11.3.

I have connected an iPad 2 running iOS 9.2.1.

I am attempting to run Xcode 7's Instruments app and select the Leaks or Allocations tool. My target is iPad > MobileSafari or iPad > Web (Standalone mode).

Once I click the record button I receive the following error 'Unable to attach to task; port invalid.'

I also tried this on the iPad Air running iOS 8.3 and received the error 'Failed to attach to target process.'

When I tried running Leaks on my Macbook > Safari. I received the error 'Failed to attach: Target process is marked restricted, cannot be traced while System Integrity Protection is enabled' Related to: Xcode 7.1 Allocations Instrument SIP Throws a fit

I was able to disable SIP (by running 'csrutil disable; reboot' in the Terminal when my Macbook was in recovery mode) and now the Leaks tool is working on my Macbook but I still cannot figure out how to run Leaks on an iPad's MobileSafari app.

Is anyone else having this issue and how can I fix it?

I have searched through the Instruments help docs but cannot find anything.

Xcode Leaks > iPad > Unable to attach to task; port invalid.

like image 716
Mac Avatar asked Mar 10 '16 14:03

Mac


1 Answers

According to this thread on Apple Devs

Profiling system applications is restricted. You'll only be able to profile applications you built and installed from Xcode.

So apparently, you can't use Instruments to do this.

like image 195
Mike Avatar answered Nov 15 '22 06:11

Mike