-1

I am building a macOS application. In which I need to retrieve information like

  • Macbook name
  • Apple Id
  • OS version

& etc. Is it possible to retrieve information in macOS. if it is possible then how can we do this in swift macOS app?

M. Mubeen Asif
  • 107
  • 1
  • 7

2 Answers2

0

For the name you could use:

if let deviceName = Host.current().localizedName {
   print(deviceName)
}

For the system :

var systemVersion = NSProcessInfo.processInfo().operatingSystemVersion

For the Apple Id I'm not sure at all but I guess you cannot for security questions I guess. You need to check that up I don't know.

0

for the name you can use something like this

if let deviceName = Host.current().localizedName {
       print(deviceName)
    }

for apple id on mac i am not sure but on iphone is UIDevice.current.identifierForVendor?.uuidString you can search for it or try this one, i have never developed mac book app

var systemVersion = NSProcessInfo.processInfo().operatingSystemVersion 

is for the os version