Apple UUID 同时使用相同的包 ID 更新整个项目

Apple UUID while updating whole project with same bundle ID

我有一个用混合 Obj-C/Swift 编写的应用程序,它使用 UUID 来识别设备。我正在 Swift 重写整个应用程序,使用另一个具有相同包 ID 的项目。但是,当我尝试使用 Xcode 更新旧项目构建时,也使用 Xcode 构建新项目时,新应用程序 UUID 不同。我缺少什么?它不应该是一样的吗,因为我使用的是相同的包 ID?

UUID 是指 UIDevice.current.identifierForVendor?.uuidString 吗?

如果是这样,它会在 Apple 开发者页面中记录的某些情况下发生变化。

https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor

The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.

糟糕,它确实保持不变,旧应用程序在钥匙串中保存了一个,即使在重新安装后也能使用它。