无法使用 Xcode 7、7.0.1 或 7.1 beta 在装有 iOS 9.0.1 的设备上分析应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32878283/
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
Unable to profile app on device with iOS 9.0.1 using Xcode 7, 7.0.1 or 7.1 beta
提问by Derek Lee
I have been trying unsuccessfully to profile my device (via Instruments) using the latest version of Xcode 7.0.1 (7A1001 released 9/28), as well as the previous version of Xcode 7 (7A218), as well as Xcode 7.1 Beta 2 (7B75).
我一直在尝试使用最新版本的 Xcode 7.0.1(7A1001 于 9 月 28 日发布)以及先前版本的 Xcode 7 (7A218) 以及 Xcode 7.1 Beta 2 来分析我的设备(通过 Instruments)失败(7B75)。
My device is an iPhone 6+ with iOS 9.0.1 installed - the latest GM release of iOS9. I am able to run / debug applications on this device without issues.
我的设备是装有 iOS 9.0.1 的 iPhone 6+ - iOS9 的最新 GM 版本。我能够在此设备上运行/调试应用程序而不会出现问题。
In the screenshots below you can see that my device is disabled (greyed out) in all screenshots in all versions. I am able to profile other devices running iOS 8.4.1 without any issues.
在下面的屏幕截图中,您可以看到我的设备在所有版本的所有屏幕截图中都被禁用(变灰)。我能够在没有任何问题的情况下分析运行 iOS 8.4.1 的其他设备。
Does the current version of Xcode not support profiling against iOS 9.0.1 or is there some kind of configuration setting or known work around for this?
当前版本的 Xcode 是否不支持针对 iOS 9.0.1 的分析,或者是否有某种配置设置或已知的解决方法?
回答by Derek Lee
TL;DR- Perform a complete reboot of your device; restart Xcode & instruments; select "Open Xcode" if prompted to enable the device for development.
TL;DR- 彻底重启您的设备;重新启动 Xcode 和仪器;如果提示启用设备进行开发,请选择“打开 Xcode”。
Update 3/31/2016:I haven't encountered any issues with the latest version(s) of Xcode (7.2.x, 7.3), so it seems that the stability here has been improved.
2016 年 3 月 31 日更新:我在最新版本的 Xcode (7.2.x, 7.3) 上没有遇到任何问题,所以这里的稳定性似乎有所提高。
I believe I may have finally gotten this to work properly. Detailed steps:
我相信我可能终于让它正常工作了。详细步骤:
- Unplug the device from your Mac & power down the device completely (hold the power button for several seconds; slide to power off).
- Close Xcode and Instruments.
- Restart the device & once it has booted completely re-connect it to your Mac.
- Re-launch Xcode. Here, my device showed as disabled and Xcode indicated that the device was not available for use.
- Open your project; clean (Shift+Command+K), Build (Command+B), Profile (Command+I).
- After Instruments launched I noticed that the device was enabled. Upon selecting it, a message was displayed with the title "Enable this device for development?" and message "This will open Xcode and enable this device for development." (Note that this only happened to me the first time I went through this process even though I had already been using the device for development - whereas some users have also reported that they are not presented with this dialogue.)
- 从 Mac 上拔下设备并完全关闭设备电源(按住电源按钮几秒钟;滑动以关闭电源)。
- 关闭 Xcode 和 Instruments。
- 重新启动设备并在它完全启动后将其重新连接到您的 Mac。
- 重新启动Xcode。在这里,我的设备显示为已禁用,Xcode 指示该设备无法使用。
- 打开你的项目;清理 (Shift+Command+K)、构建 (Command+B)、配置文件 (Command+I)。
- Instruments 启动后,我注意到该设备已启用。选择它后,会显示一条消息,标题为“启用此设备进行开发?” 和消息“这将打开 Xcode 并启用此设备进行开发。” (请注意,这仅发生在我第一次经历此过程时,即使我已经使用该设备进行开发 - 而一些用户也报告说他们没有看到此对话。)
- Click "Open Xcode". Here Xcode did not prompt me for anything nor was anything displayed - no additional messages indicating anything had been done or that the device was or was not available for development. Opening the Devices window, the device appeared to be available. (I have not been presented with this option for subsequent occurrences.)
- Now I was able to select the device in Instruments and profile it.
- 单击“打开 Xcode”。这里 Xcode 没有提示我输入任何内容,也没有显示任何内容 - 没有额外的消息表明已经完成任何操作或设备是否可用于开发。打开设备窗口,设备似乎可用。(我没有在随后出现的情况下看到这个选项。)
- 现在我可以在 Instruments 中选择设备并对其进行配置。
As a side note, I was also again able to delete installed apps from the Devices window (I realized that this was not possible to do previously).
作为旁注,我还可以再次从“设备”窗口中删除已安装的应用程序(我意识到以前无法做到这一点)。
I'm unsure how my device ended up in this state however I will be on the lookout to see if this continues to occur.
我不确定我的设备是如何最终处于这种状态的,但是我会留意这种情况是否会继续发生。
Please note that this was done using Xcode 7.0.1.
请注意,这是使用Xcode 7.0.1完成的。
Update:My device seems to lapse back into not being able to be used for profiling some time after performing these steps - I've had to reboot my device again in order for it to be available for profiling. Not sure what is triggering this behavior but I will file a Radar for this.
更新:在执行这些步骤后的一段时间内,我的设备似乎又无法用于分析 - 我不得不再次重新启动我的设备以使其可用于分析。不确定是什么触发了这种行为,但我会为此提交一个雷达。
回答by Evgeny Mikhaylov
Close instruments -> reset your device by long pressing home and power button -> restart instruments. Works for Xcode 7.3.
关闭仪器 -> 通过长按主页和电源按钮重置您的设备 -> 重新启动仪器。适用于 Xcode 7.3。
回答by catanore
This issue still occurred with XCode 10.3 and iOS 12.4.2
此问题在 XCode 10.3 和 iOS 12.4.2 中仍然存在
I restarted the device only, and it worked.
我只重新启动了设备,它工作正常。
回答by JosephH
According to Apple staff on the developer forumsthe behaviour of this issue is greatly improved in the Xcode 7.3 betas, so one easy solution is to try upgrading Xcode. I've upgraded and it seems to be behaving so far.
根据开发者论坛上的 Apple 工作人员的说法,此问题的行为在 Xcode 7.3 测试版中得到了极大改善,因此一个简单的解决方案是尝试升级 Xcode。我已经升级,到目前为止它似乎表现得很好。