Our Swift app uses Realm (10.7.6) and it's encrypted. I'd like to open the .realm file in Realm Studio (10.1.2) but it's asking for the "128-character hex-encoded encryption key". I'm not sure where to get this.
Btw, in my test app I can open that .realm file with Realm Studio if I don't encrypt so the versions of RealmSwift and Realm Studio are compatible.
To encrypt the Realm in the app I'm using the getKey()
code from the Realm docs here. The key that gets generated in that code is only 64 bytes, not 128 which is what Realm Studio is asking for. If I print(key)
I get "64 bytes" in the console. If I add a breakpoint and po key
it's not much better:
▿ 64 bytes
- count : 64
▿ pointer : 0x0000600003a14160
- pointerValue : 105553177166176
Where do I get the "128-character hex-encoded encryption key" that Realm Studio is asking for?
Update: As mentioned in Jay's answer below, I used Johannes Lund's answer from here to convert the Data
object to a hex string. Sure enough, I could take that string and paste it into that Realm Studio window.
Sadly, as documented on the Realm site, you can't have an encrypted Realm open in multiple processes. I've been using Realm Studio to help test our collection observers but now we'll have to do that another way.