MacOS – Enable Web Inspector in Safari v 8.0 in Yosemite OS

bashmacmacos

I'm trying to show/hide the web inspector tool in mac os "Yosemite" using bash script, I used the following command in terminal but it didn't work even after I restarted Safari, so am I doing something wrong?

defaults write com.apple.Safari WebKitDeveloperExtras –Boolean

Best Answer

defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

adds Inspect Element to the right-click menu

However, opening the Develop menu will do it too

defaults write com.apple.Safari IncludeDevelopMenu -bool true

One additional note about toggling the Develop menu this way is that it isn't interactive with the Safari prefs pane, & can result in reversed behaviour if later toggled from there by the user.