This works in OS X:
WebPreferences *prefs = [webView preferences];
[prefs setDeveloperExtrasEnabled:YES];
WebInspector *inspector = [[WebInspector alloc] initWithWebView:webView];
But crashes in macOS:
-[WebInspector initWithWebView:]: unrecognized selector sent to instance 0xb1ab1ab1a
Is this Private API thrown out?
The code is taken from here.