在 Xcode 4.1 Build 4B110 下通过 Profile 启动 Instruments 的错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6801310/
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 21:32:47  来源:igfitidea点击:

Bug with starting Instruments via Profile under Xcode 4.1 Build 4B110

xcodeprofileinstrumentsosx-lion

提问by andi1984

Important Update

重要更新

The strange bug is fixed (at least for me) in Xcode 4.2!

Xcode 4.2 中修复了这个奇怪的错误(至少对我而言)!



I've a serious problem with Xcode 4.1 Build 4B110 under Mac OS X Lion and running Instruments via Xcode. The problem is that Instrument freezes partly if I start it via Xcode. So if I start a project in Xcode 4.1 and open "Profile" the Instruments UI appears. The timer starts running, but the instruments app doesn't track anything and the more serious problem:

我在 Mac OS X Lion 下使用 Xcode 4.1 Build 4B110 并通过 Xcode 运行 Instruments 时遇到了严重问题。问题是,如果我通过 Xcode 启动 Instrument,它会部分冻结。因此,如果我在 Xcode 4.1 中启动一个项目并打开“配置文件”,则会出现 Instruments UI。计时器开始运行,但仪器应用程序没有跟踪任何东西,更严重的问题是:

The program seems to be running but does not react to any actions I make. So I can not click on any buttons etc. Nothing happens. The timer is still running, but I can not do anything. I also can not close the window/app anymore. So I have to force stop the Instruments app.

该程序似乎正在运行,但对我所做的任何操作都没有反应。所以我不能点击任何按钮等。没有任何反应。计时器仍在运行,但我无能为力。我也不能再关闭窗口/应用程序了。所以我必须强制停止 Instruments 应用程序。

But if I start the Instruments app directly via Developer/Applications/Instruments.appeverything is ok. Of course, the app doesn't track anything, but I can click on the buttons and anything possible there.

但是如果我直接通过Developer/Applications/Instruments.app一切启动 Instruments 应用程序就可以了。当然,该应用程序不会跟踪任何内容,但我可以单击按钮和那里可能发生的任何事情。

So does anyone know about this problem?

那么有没有人知道这个问题?

Does anybody know how to fix this weird problem?

有人知道如何解决这个奇怪的问题吗?

I've also deleted the developers folder with the corresponding deinstall-script file and reinstalled Xcode 4.1. But still the problem persists.

我还删除了带有相应 deinstall-script 文件的开发者文件夹并重新安装了 Xcode 4.1。但问题仍然存在。

Can anybody give me a hint, tip, etc.?

任何人都可以给我提示,提示等吗?

Would be really great!

真的会很棒!

Update

更新

So, further weird stuff:

所以,更奇怪的东西:

Profile somehow worked for iOS 3.0 version apps, but after making a short break it didn't work again. So, I don't know where this bug is located. I guess it's about the target app iOS version.

Profile 以某种方式适用于 iOS 3.0 版本的应用程序,但在短暂休息后它不再起作用。所以,我不知道这个错误在哪里。我想这是关于目标应用程序的 iOS 版本。

Thanks, Andreas

谢谢,安德烈亚斯

采纳答案by Epaga

Quoting your comment on this, andi1984, so that no one misses this "big" answer for anyone (like me) for whom it is a lifesaver. This worked great for me!

引用您对此的评论,andi1984,以便没有人错过任何人(如我)的“大”答案,因为它是救生员。这对我很有用!

If I'm opening Xcode, choose Profile and choose one instrument (let's say Leaks) the new Instrument window opens. Then I need to go back to Xcode (while Instrument.app window is still open in background!) and have to use command + tab to choose out of Xcode in front the Instrument.app again. Then the Instrument app shows me the tracked data. Really weird problem, but now it works. ;-)

如果我打开 Xcode,选择 Profile 并选择一种仪器(比如 Leaks),新的 Instrument 窗口将打开。然后我需要回到 Xcode(而 Instrument.app 窗口仍然在后台打开!)并且必须再次使用 command + tab 来选择 Instrument.app 前面的 Xcode。然后仪器应用程序向我显示跟踪的数据。真的很奇怪的问题,但现在它起作用了。;-)

回答by wuf810

Epaga's solution sometimes works & sometimes doesn't.

Epaga 的解决方案有时有效,有时无效。

Therefore I suggest everyone duplicates the following open radar so that Apple gives this issue some priority:

因此,我建议大家复制以下开放式雷达,以便 Apple 优先考虑这个问题:

http://openradar.appspot.com/9855452

http://openradar.appspot.com/9855452

回答by Chad

I had the problem of instruments locking up and the above cmd-tab trick didn't work until I did it such that the dialog "Instruments is trying to access your computer" appeared asking for my password. After I entered the password then I could get to instruments. I suspect the problem is the password dialog is hidden in the Xcode windows. In this case Instruments is frozen because it has the modal dialog open.

我遇到了仪器锁定的问题,并且上面的 cmd-tab 技巧在我这样做之前不起作用,以至于出现“仪器正在尝试访问您的计算机”对话框询问我的密码。输入密码后,我就可以使用仪器了。我怀疑问题是密码对话框隐藏在 Xcode 窗口中。在这种情况下,仪器被冻结,因为它打开了模态对话框。

So:

所以:

  1. Run Instruments
  2. Cmd Tab to Xcode covering the instruments. Cycle and hide messages until password dialog is found. Close Xcode
  1. 运行仪器
  2. Cmd Tab 到 Xcode 覆盖仪器。循环并隐藏消息,直到找到密码对话框。关闭 Xcode

This may be a one time thing... now that I gave Instruments access it may not need the password again.

这可能是一次性的事情......现在我给了 Instruments 访问权限,它可能不再需要密码了。

回答by Nate

I've found that if I leave two Instruments windows open at the same time, when Instruments locks up in one window, bringing the other window into the foreground seems to snap Instruments out of it. It seems to bring Instruments back if you can get the focus on a different Instruments window than the one that's locked.

我发现如果我同时打开两个 Instruments 窗口,当 Instruments 锁定在一个窗口中时,将另一个窗口置于前景中似乎会将 Instruments 从中拉出。如果您可以将焦点放在与锁定的不同的 Instruments 窗口上,则似乎可以将 Instruments 带回来。

I've found the two-window-method works all the time while the Xcode-profile-method only works sometimes.

我发现双窗口方法一直有效,而 Xcode-profile-method 只是有时有效。

Edit:

编辑:

After trying the two-window-method a bit more, this method also only works sometimes.

在尝试了更多的双窗口方法之后,这种方法也只是有时有效。