Get Mac unique identifier number (ex.: serial number) in 64-bits

前端 未结 2 1028
余生分开走
余生分开走 2021-01-28 04:55

how can i retrieve in Cocoa, Mac unique identifier, for ex.: serial number in 64-bit mode ?

I\'ve followed couple articles but they were intended for 32-bit mode.

<
相关标签:
2条回答
  • 2021-01-28 05:26

    Simple way is to execute:

    ioreg -l | grep IOPlatformSerialNumber | awk '{print $4}'

    0 讨论(0)
  • 2021-01-28 05:37

    Have a look at this article "How to get hardware and network info"

    If you are having trouble with the 64bit architecture - or your app simply has to be a 64bit app - consider moving the IO part to a helper utility and access it using distributed objects.

    Have a look at Creating XPC Services

    0 讨论(0)
提交回复
热议问题