Install the macOS bundle
For macOS, the Realm Object Server comes bundled with a demo app called RealmTasks—It’s the quickest way to learn about the Realm Mobile Platform. (In production, you’ll probably want to install the Realm Object Server on Linux, or a cloud hosting provider.)
Realm Object Server, Cocoa SDKs and Demo App
Starting Realm Object Server
Navigate to your downloads folder and open the “realm-mobile-platform” folder.
Start Realm Object Server by double-clicking the file
start-object-server.command. This file will open a terminal window and start Realm Object Server for you.
Starting the server will automatically open the Realm Dashboard (if it does not, please go to http://localhost:9080).
Create an admin user by entering your email and providing a password. After registering, you can log in using these credentials.
The Realm Dashboard will show you the status of the Realm Object Server, current activity and allow you to manage users.
RealmTasks is a simple task management app powered by the Realm Mobile Platform, inspired by Clear by Realmac Software. It’s available for iOS, macOS, and Android, with full source code available on GitHub.
Open the “Demo” folder inside “realm-mobile-platform”, then the “RealmTasks” folder. Launch the RealmTasks app inside; this is the macOS version.
When the app launches, you can log in as an existing user, or register a new user. Since this is your first time using the app, click “Register” and enter a username and password. (It can be anything; this is a local demo.)
Once you have logged in, the app is ready to use!
Things to Try
- Click the “+” button to add tasks
- Swipe left on a task to delete it
- Swipe right on a task to mark it “done”
- Tap, hold and drag to re-order tasks
These tasks are being added to your local Realm inside the app while being live-synchronized with the Object Server.
If you previously ran RealmTasks and need to reset its state, close the app, then run this command:
rm -rf ~/Library/Containers/io.realm.realmtasks.macos
The Realm Browser
To manage the Realms on the server, Realm includes a browser that allows you to explore and interact with them in realtime.
Open the macOS app named “Realm Browser” inside the “realm-mobile-platform” folder.
The app will open a panel with initial options. Click “Connect to Object Server”.
In the “Connect to Object Server” dialog box, enter
realm://127.0.0.1:9080 as the server URL.
In order to connect as admin we need an admin access token. In the terminal running the server, look for a line starting with
Your admin access token is:. Copy the long token key string, including the two trailing equals signs (
==). This is the admin access token for your Object Server.
A new dialog box will open, listing all the Realms on your server. If you only registered one user, there will be only one Realm. Select it to view the contents.
If you still have the RealmTasks app open, you can now try editing and reordering your tasks while seeing the changes live in the browser. Changes in the browser are reflected instantly in the app as well.
From here, you can follow a tutorial to build an iOS app similar to RealmTasks from scratch, or jump right into the Realm Object Server documentation to integrate an app that already uses the Realm Mobile Database.
If you’ve never used the Realm Mobile Database before, you might want to start by picking your platform and checking the docs. There, you’ll learn about what makes our database unique, like the power of live objects, auto-updating queries, and the freedom from ever having to use an ORM again.