Using Xcode Instruments on hackintosh

别说谁变了你拦得住时间么 提交于 2019-12-03 05:09:22

问题


Using hackintosh (i7-4790K 4GHz, 16GB DDR3, GF980Ti) for developing on Xcode (both Swift and Objective-C) about an year, never get any errors. But now I need to use Instruments apps (such Leaks, Allocations, Energy Log, System Trace, etc.) - but I can not! When I start ANY of these apps I see just transparent window without any visible information.


回答1:


EDIT: as @Eike said in his answer, Instruments and other apps facing this issue work out of the box from 10.13 onwards. For 10.12, the NVWebDriverLibValFix kext is a better/less intrusive fix and avoid some permissions issues. This answer should now be considered obsolete.


Instruments is a code-signed application distributed by Apple. Some of these applications are flagged so they refuse to load libraries that are not signed by Apple. The Nvidia Web Driver is not signed by Apple, so it's not loaded, resulting in the behavior you describe.

The accepted answer tell you to work around the issue by loading another driver, signed by Apple. While this will certainly work, I prefer to do it the other way around : force Instruments to load the nvidia driver.

You can re-sign the Instruments binary with the following command:

sudo codesign -f -s - /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/MacOS/Instruments

It will then load the Nvidia driver and run perfectly well.




回答2:


The signing fix in the most-liked answer unfortunately impedes the execution rights of Instruments, so while it's then visible, the time profiler will not work.

Fortunately the iBooks thread from the other answer is not over yet, and the suggested (and provided) solution is to use a kernel extension that makes Nvidia drivers appear validated.

https://github.com/mologie/NVWebDriverLibValFix

This basically solves the problem at its root and is the next best thing to having Nvidia drivers actually signed by Apple.

With 10.13 / High Sierra the Web-Driver should work without any hack / modification (it should be removed when updating)




回答3:


It's a known problem with the recent nVidia macOS Web Drivers. Not just with XCode Instruments, it appears in iBooks, too when you open a book for read. People have reported this issue on the Apple Support Forums using Web Drivers on a genuine Mac - so it doesn't only affect Hackintosh PC's.

See this thread: https://www.tonymacx86.com/threads/nvidia-web-driver-ibooks-bug.203229/page-8

For a temporary fix: Enable your Intel HD4600 graphics in your i7-4790K. Make sure it's enabled in UEFI BIOS, and injected with Clover. See post #72 at the link above. Solved my issue with transparent window on my Hackintosh.

Another solution is to remove the nVidia graphics card and use Intel HD4600 only, but this way you lose the power of the GTX980Ti of course.

Update: I recommend Nax's solution, it's better in every aspect. However this codesign command doesn't work for transparent iBooks window. If you re-sign iBooks it will crash on launch.



来源:https://stackoverflow.com/questions/41470684/using-xcode-instruments-on-hackintosh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!