Realm Studio

3
Last updated 24 days ago

What is Realm Studio?

Realm Studio is a developer tool for easily managing the Realm Database and Realm Platform. With Realm Studio, you can open and edit local and synced Realms, and administer any Realm Object Server instance. With Studio, you can perform basic tasks such as connecting to your instance, browsing data, and viewing logs.

Download The latest Version

To get started, pick your platform and download the application:

Operating System

Versions

Download Link

Mac OSX 10.12+

Download

Ubuntu 14.04+ Debian 8+ CentOS/RHEL 7+

Download

Windows 8+ Windows Server 2012+

Download

Download Older Versions

Need an older version of Realm Studio for compatibility? You can find all versions available for download here.

Release Notes

Want to know about the latest enhancements and bugfixes? Check out the release notes.

Connect with Realm Studio

Cloud
Self-hosting

Connecting to your cloud instance is easy with Realm Studio. Just click the "Connect to Realm Cloud" button and select your desired instance.

If you are sharing access to your cloud instance with another user, they can connect manually by clicking "Connect to Server".

You can get your instance URL by copying it from your cloud instances dashboard.

Example Cloud URL

Connecting to your self-hosted instance is easy with Realm Studio. Just click the "Connect to Server" button.

Studio Landing Page

In the corresponding popup, you will need to input your server information.

  • URL: your URL should match the following format: http://<ip_address>:port

    • For example, a local installation will look like: http://127.0.0.1:9080

    • If using HTTPS, your format will match: https://<ip_address>:443

  • Username / Password: You will need to login with an admin user. After a fresh installation, a default admin user is created with the username: realm-adminand a blank password. We recommend changing this password as soon as possible for security concerns.

Viewing Data

Once connected you can browse to all of the synchronized Realms on the server and open them to view the data. Any changes you make to the data will be automatically synchronized to any other devices sharing the data.

Once you have logged into your server, you will be able to see a list of the available Realms:

View the list of Realms in your server

Simply click on any Realm and you can view the data inside of it as well as create new objects manually.

View your data

Querying Data

While viewing the data within a Realm, you can filter the data by making queries. Queries are typed into the browser bar at the top of your Studio window. These queries follow the same syntax as our Realm JS SDK. For more information on the queries, you can press the ? button which is just to the right of the browser bar. It will take you to this page with a more detailed explanation.

In the screenshot below, you can see an example on how to perform a query. As you can see, this query filters the Item class for objects which are marked as false for the isDoneproperty. You'll notice that two objects are returned while 3 three objects exist within the class (noted by the 3 in the left pane).

Changing Schema

You can also use Studio to make changes to synchronized Realm schemas. This is limited to additive changes: creating new models and properties.

Export Model Definitions

During development, you may want to export your schema for consistency and ease of use across definitions. For example, you may have already created your schema in an existing iOS application and now need to declare the same schema in your Android app. Creating an exact matching object definition in another programming language by hand can be quite error-prone, so Studio allows you to export an definition based directly on the data in the Realm.

To do this, simply open up the Realm of interest. Open the "File" menu, and select "Save model definitions" as well as the desired syntax.

Viewing Special Realms

If working with query-based sync or performing administrative tasks, it is possible that you may want to view certain Realms that are hidden by default. Simply click on the "View" menu and select which Realms you need to view.

For example, you may want to view a user's "partial" Realm to get a view of what data is being synchronized to their device.

System Classes: __ Models

When using query-based synchronization, you may notice that a number of special models are created inside of your Realm. They are prefaced with "__" and are used as part of the internal sync system. These models are as follows:

  • __Class

  • __DefaultRealmVersion

  • __Permission

  • __Realm

  • __Role

  • __User

When connected to a server, Realm Studio allows you to administer users.

View your list of users

Viewing and Editing Permissions

Studio allows you view and edit the permission of a Realm, Class, or Object for reference realms using query-based synchronization. The options follow the permission standards as described here. Detailed description of each toggle can be viewed through a tooltip by hovering over each letter. By doing this, you can easily create some basic permissions data which can then be retrieved later via our APIs and then applied at scale to other objects, classes, and Realms.

Permission UI on the right

Administering Users

Studio allows you to view, create, and modify users from the Users tab.

Create Users

You can create a new username/password user.

Update Existing Users

With existing users, you can change their type (regular or administrator) from the right hand pane. If the user was created via username/password provider you can change their password. Finally, you can delete the user as well.

Viewing Logs

When connected to a server, Realm Studio allows you to view the server logs from the Logs tab. You can easily adjust the logging level in the bottom right hand corner. When troubleshooting an issue, it is likely that debug level logs will help.

Browsing Local Realms

Realm Studio allows you to open local Realm files and view the data. Once opened, you can edit data and save changes to the Realm.

If you are working with Realm files on a device, you will need to transfer them to the machine running Realm Studio.

Click "Open Realm file" to bring up the file window
View and edit local Realm files - a demo file is available to try it out!

Viewing Realms From Emulators

Studio allows you to live-observe (and edit) any Realm local to it. This can be very useful during mobile app development, since you can run an emulator on the same machine as Realm Studio and observe Realms in real time while debugging your app. The only challenge is that emulators often make it really hard to find their local files.

Fortunately you can get the on-disk storage location from the Realm configuration: dump it to the debug console, and then use that path to open the Realm in Studio:

Swift
JavaScript
Java
.NET
// Get on-disk location of the default Realm
let realm = try! Realm()
print("Realm is located at:", realm.configuration.fileURL!)
// Get on-disk location of the default Realm
Realm.open({}).then(realm => {
console.log("Realm is located at: " + realm.path);
});

The filesystem used by Android emulators are unfortunately not directly accessible from the machine running Realm Studio. In this case you need to download the file from the emulator before it can be accessed.

// Run this on the device to find the path on the emulator
Realm realm = Realm.getDefaultInstance();
Log.i("Realm", realm.getPath());

Then download the file using ADB. This can be done while the app is running.

> adb pull <path>

You can also upload the modified file again using ADB, but only do this while the app is not running as it otherwise can corrupt the file.

> adb push <file> <path>
var realm = Realm.GetInstance();
Console.WriteLine($"Realm is located at: {realm.Config.DatabasePath}");

Importing Data

Realm Studio supports the ability to create a Realm file from CSV. To do so, go to File then Create Realm from --> CSV.

Note that when importing from CSV, the first row will be used as the object properties.

For example, a CSV formatted like:

data.csv
device,number,flag
gizmo,1,TRUE
widget,2,FALSE

This will result in a model named datathat has three properties: device which will be a string, number which will be an int and flag which will be a bool

Not what you were looking for? Leave Feedback