Macos Mac OS UUID是否依赖于硬盘?
我使用此代码在Mac OS上获取UUIDMacos Mac OS UUID是否依赖于硬盘?,macos,uuid,hard-drive,Macos,Uuid,Hard Drive,我使用此代码在Mac OS上获取UUID NSString* getComputerId() { io_registry_entry_t ioRegistryRoot = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/"); CFStringRef uuidCf = (CFStringRef) IORegistryEntryCreateCFProperty(ioRegistryRoot, CFSTR(kI
NSString* getComputerId()
{
io_registry_entry_t ioRegistryRoot = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
CFStringRef uuidCf = (CFStringRef) IORegistryEntryCreateCFProperty(ioRegistryRoot, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0);
IOObjectRelease(ioRegistryRoot);
return (NSString*) uuidCf;
}
此UUID是否依赖于硬盘?如果用户更换硬盘,UUID会发生变化吗?中没有提到HDD