3

I want to read any unique info like UDID or serial number programmatically in apple watch. Is there any way to get it ?? I want to get programatically not manually via xcode..

Vittal Pai
  • 3,317
  • 25
  • 36

2 Answers2

0

WatchOS3 does not have any UIDevice-like API to get even identifierForVendor or advertisingIdentifier, not talking about UDID.

If you need something unique to concrete watch device, workaround I can suggest is putting random UUID to watch's Keychain on first launch and use it as if it was UDID. Theoretically, items in Keychain are persistent between app installations, but worth checking if they stay between iphone-watch pairings.

abjurato
  • 1,439
  • 11
  • 17
0

Similar to the method that uses identifierForVendor to uniquely identify an iOS device, watchOS also has one.

if let uuid = WKInterfaceDevice.current().identifierForVendor?.uuidString {
    print("UUID:",uuid)
}
JuvinR
  • 128
  • 1
  • 7