xcode 帮助!仪器无法启动

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3533531/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 19:39:14  来源:igfitidea点击:

HELP! Instruments won't start

iphonexcodeipadinstruments

提问by Roger Gilbrat

Instruments is failing to start on my iPad and iPhone. Both are correctly provisioned and I can debug code on them from xcode with no problems, but Instruments fails to start.

Instruments 无法在我的 iPad 和 iPhone 上启动。两者都已正确配置,我可以毫无问题地从 xcode 调试它们的代码,但 Instruments 无法启动。

All I get is a beep. I looked in the Mac Console logs and I see several of these:

我得到的只是一声哔哔声。我查看了 Mac 控制台日志,我看到了其中几个:

8/18/10 5:46:27 PM Instruments[1406] -[NSCFArray length]: unrecognized selector sent to instance 0x11bfd93e0

8/18/10 5:46:27 PM Instruments[1406] -[NSCFArray 长度]:无法识别的选择器发送到实例 0x11bfd93e0

I tried reboot the Mac, shutting down the iPad, unplugging the iPad, removing the iPad from Organizer. I've tried deleting the Instruments .plist file.

我尝试重新启动 Mac,关闭 iPad,拔下 iPad,从管理器中移除 iPad。我试过删除 Instruments .plist 文件。

I've tried both USB ports and different cables. No luck in getting Instruments to run.

我已经尝试了 USB 端口和不同的电缆。让仪器运行没有运气。

I can run the app just fine from Xcode on the device, just not Instruments.

我可以在设备上从 Xcode 运行该应用程序,但不能运行 Instruments。

I have tried this on two different Macs, and I have the same problem. I tried connecting Instruments to my iPhone and I get the same problem, so I don't think it's the device. I really don't want to go buy a new iPad just to find out that it doesn't work.

我已经在两台不同的 Mac 上尝试过这个,但我遇到了同样的问题。我尝试将 Instruments 连接到我的 iPhone,但遇到了同样的问题,所以我认为这不是设备问题。我真的不想去买新 iPad 只是为了发现它不起作用。

I am able to run Instruments on the simulator, but not the device. Xcode can build and run the app fine, so there isn't anything fundamentally wrong with the app.

我可以在模拟器上运行 Instruments,但不能在设备上运行。Xcode 可以很好地构建和运行应用程序,因此应用程序从根本上没有任何问题。

The Instruments drop down that reads "Choose Target" shows my iPad, but not the app like the simulator does. I tried attaching Instruments to an running version of the app, and the attach menu shows the app, but it's grayed out.

显示“选择目标”的仪器下拉菜单显示了我的 iPad,但不像模拟器那样显示应用程序。我尝试将 Instruments 附加到应用程序的运行版本,附加菜单显示该应用程序,但它是灰色的。

I upgrade to the last Xcode and made sure my iPad was running the lastest and the problem persists. I am running Xcode 3.2.3 (1688) and Instruments 2.7 (2529).

我升级到最后一个 Xcode 并确保我的 iPad 运行的是最新的并且问题仍然存在。我正在运行 Xcode 3.2.3 (1688) 和 Instruments 2.7 (2529)。

If I start Instruments directly (not from Xcode), I get a error dialog what says "Device Connection Failed" along with the unknown selector message and I see yellow banners in Instruments that read: "Target failed to run".

如果我直接启动 Instruments(而不是从 Xcode),我会收到一个错误对话框,上面写着“设备连接失败”以及未知的选择器消息,并且我在 Instruments 中看到黄色横幅,上面写着:“目标无法运行”。

Here is the console log from my iPad when Instruments fails to connect:

这是 Instruments 无法连接时来自 iPad 的控制台日志:

Thu Aug 19 16:16:27 iPad lockdownd[17] <Error>: (0x481000) set_response_error: handle_start_session SessionActive
Thu Aug 19 16:16:28 iPad /usr/libexec/notification_proxy[149] <Error>: Could not receive size of message
Thu Aug 19 16:16:28 iPad /usr/libexec/notification_proxy[149] <Error>: Could not receive message
Thu Aug 19 16:16:48 iPad lockdownd[17] <Error>: (0x481000) handle_connection: Could not receive USB message #6 from Instruments. Killing connection
Thu Aug 19 16:16:48 iPad com.apple.mobile.lockdown[17] <Notice>: receive secure message timeout!

Everything worked fine one night and then the next day it starts failing. I've done nothing to the machine or device between working and not working.

一天晚上一切正常,然后第二天就开始失败。在工作和不工作之间,我没有对机器或设备做任何事情。

I'm getting very desperate here. I've posted on the Apple Dev forums, but haven't gotten any responses.

我在这里变得非常绝望。我在 Apple Dev 论坛上发帖,但没有得到任何回应。

Can anyone help me? Any advice?

谁能帮我?有什么建议吗?

采纳答案by Roger Gilbrat

This problem was solved by doing a full factory reset of the iPad and the iPhone. Something got borked on the devices.

这个问题是通过对 iPad 和 iPhone 进行完全恢复出厂设置来解决的。设备上出现了一些问题。

If this happens to you, now you know. :-)

如果这发生在你身上,现在你知道了。:-)

回答by Anthony McCormick

I had the same issue! I could only use Instruments on my iPhone but not on iPad or iPad2! Whenever I started instruments with Xcode 4 it would just beep and the record button would be disabled..

我遇到过同样的问题!我只能在 iPhone 上使用 Instruments,而不能在 iPad 或 iPad2 上使用!每当我使用 Xcode 4 启动乐器时,它只会发出哔哔声并且录音按钮将被禁用。

I solved this issue by in XCode going to >Targets>Edit Scheme>Profile "yourAppName" and changing the Build Configuration from Release to Debug. Then try to profile again Product>Profile

我通过在 XCode 中转到 >Targets>Edit Scheme>Profile "yourAppName" 并将构建配置从 Release 更改为 Debug 解决了这个问题。然后再次尝试配置文件 Product>Profile

If you get the beep again.. You will see that it says "CHOOSE TARGET" next to the record button open the drop down >Choose Target> "yourAppName" then hit record.

如果你再次听到哔哔声..你会看到它在记录按钮旁边说“选择目标”,打开下拉菜单>选择目标>“你的应用程序名称”,然后点击记录。

This solved it for me and was finally able to run instruments again!

这为我解决了这个问题,终于能够再次运行仪器了!

I know this post is old but i hope it helps someone.

我知道这篇文章很旧,但我希望它可以帮助某人。

回答by whyoz

If anyone is having problems with "Device Connection Failed," make sure you aren't opening an older version of Instruments (maybe from your dock) that doesn't support the newer devices/iOS 6. This is a first step in ensuring that Instruments will start for your device.

如果有人遇到“设备连接失败”的问题,请确保您没有打开不支持较新设备/iOS 6 的旧版本 Instruments(可能来自您的 Dock)。这是确保仪器将为您的设备启动。

To solve this, go to XCode > Open Developer Tools > Instrumentsand it will open the newest version of Instruments that's included with your XCode v4.6 install.

要解决此问题,请转到XCode > Open Developer Tools > Instruments,它将打开包含在您的 XCode v4.6 安装中的最新版本的 Instruments。

Make sure you remove any old docked versions of Instruments and redock the new version.

确保删除任何旧的停靠版本的 Instruments 并重新停靠新版本。