Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically detect Mac OS X Server Edition?

Is anybody knows any API that can help to distinguish Mac OS X "Server edition" from "Desktop edition"? My application should know on which edition of Mac OS X it currently running. (Server or Desktop)

like image 365
killerovsky Avatar asked Dec 28 '22 20:12

killerovsky


1 Answers

sw_vers appears to do it by checking /System/Library/CoreServices/ServerVersion.plist -- you could probably get by with just seeing if the file exists.

like image 87
Gordon Davisson Avatar answered Dec 31 '22 14:12

Gordon Davisson