Dari

Desktop App

Inspect bridge messages from Android and iOS apps on your computer

The Dari desktop app shows the bridge messages of a connected debug build on your computer: a live list, the request and response side by side, and foldable JSON. It needs dari 2.0.0 or later and works with real devices and emulators. iOS apps using the Dari Swift package connect on macOS from a Simulator or a USB device; see iOS. It runs on macOS 10.15 or later and Windows (x64), with Linux (x64) in preview.

For filters, Response Time and export, see Inspector UI.

Install

macOS from Terminal

The quickest way. It picks the build for your Mac's chip, checks it against the release's SHA-256 file, and installs or updates /Applications/Dari.app:

curl -fsSL https://raw.githubusercontent.com/easyhooon/dari/main/scripts/install-desktop.sh | bash

The checksum is what catches a bad download, so run the command only from this page or the repository. To pin a version, put DARI_VERSION=2.0.0 before bash.

macOS from the DMG

  1. Download Dari-<version>-arm64.dmg (Apple Silicon) or Dari-<version>-x64.dmg (Intel) from the download page or the releases page.
  2. Open the image and drag Dari into Applications.
  3. Optionally, compare shasum -a 256 Dari-<version>-arm64.dmg with the .sha256 file from the same release. A match means the download isn't corrupted; it doesn't prove who published it.

Dari is signed with a Developer ID and notarized by Apple, so it opens without a security prompt. Download it only from the repository's releases page.

Windows

  1. Download Dari-<version>-x64.exe from the download page or the releases page and run it. It installs for the current user only.
  2. The installer isn't code-signed, so SmartScreen may warn on first run. Click More info → Run anyway.
  3. Optionally, compare certutil -hashfile Dari-<version>-x64.exe SHA256 with the .sha256 file from the same release.

For managed rollouts (Group Policy, Intune), use Dari-<version>-x64.msi from the same release instead. Both install the same app and upgrade an existing install in place. Releases before 2.3.0 have only the .msi.

Linux (preview)

On Debian 13, Ubuntu 24.04 or later, and distributions based on them:

  1. Download dari_<version>_amd64.deb from the releases page.
  2. Install it with sudo apt install ./dari_<version>_amd64.deb. Dari appears under Development in the app menu and installs to /opt/dari.

The .deb depends on package names introduced in Debian 13 and Ubuntu 24.04, so it doesn't install on older releases. There, and on other distributions such as Fedora or Arch, use Dari-<version>-linux-x64.tar.gz from the same release: it bundles its own Java runtime. Extract it and run Dari/bin/Dari.

Optionally, compare sha256sum <file> with the .sha256 file from the same release. Linux builds are x64 only, and tested so far on Debian 13 with Xfce on X11.

Download size

Measured on 2.2.0, the macOS download is about 11 MB larger than the Windows one:

Windows (.msi)macOS (.dmg, Apple Silicon)
Unpacked119.3 MB127.1 MB
CompressionMSZIPUDZO (zlib level 1)
Download59.6 MB70.7 MB

The Windows .exe wraps the same MSI, so it is only about 0.6 MB larger.

Both hold the same app: a Java runtime trimmed by jlink, the app's jars, and Skiko, the native Skia library that Compose draws with. Both also compress with Deflate, the LZ77 + Huffman coding algorithm behind zip and gzip:

  • MSZIP: an MSI keeps its files in a CAB archive, and MSZIP compresses them with Deflate in 32 KB blocks. jpackage leaves WiX at this default.
  • UDZO: a DMG is a compressed disk image, and UDZO compresses it with zlib, a thin wrapper around Deflate. hdiutil uses zlib level 1, the fastest and weakest, unless told otherwise.

So the gap has two causes:

  1. Larger native libraries on macOS. libskiko-macos-arm64.dylib is 20.8 MB and libjvm.dylib 15.7 MB; on Windows, no file but the runtime's lib/modules exceeds 12.7 MB. Deflated file by file, the macOS app comes to 65.8 MB, against the 58.4 MB Windows cabinet.
  2. zlib level 1. It adds about 5 MB more.

To measure the macOS side:

./gradlew :dari-desktop-app:createDistributable
cd dari-desktop-app/build/compose/binaries/main/app
du -sh Dari.app Dari.app/Contents/runtime Dari.app/Contents/app
hdiutil create -srcfolder Dari.app -format UDZO -imagekey zlib-level=9 Dari-level9.dmg
121M	Dari.app
 66M	Dari.app/Contents/runtime
 54M	Dari.app/Contents/app

du -h counts in MiB, so 121M is 127 MB. The same Dari.app in other DMG formats:

FormatAlgorithmOpens onSizeCopying Dari.app out
UDZO, level 1 (hdiutil default)zlib (Deflate)Every macOS70.8 MB2–4 s
UDZO, level 9zlib (Deflate)Every macOS67.3 MB
ULFO (2.2.1 and later)LZFSE: Apple's LZ77 with finite-state entropy coding, built for fast decompressionmacOS 10.11+67.3 MB4–5 s
ULMO (2.2.0)LZMA: LZ77 with a large dictionary and range coding, as in 7-Zip and xzmacOS 10.15+59.5 MBabout 15 s

Copy times are from an Apple M2, mounting the DMG and copying the app out with ditto, as installing or updating does. ULMO is the smallest, but macOS decompresses it outside the kernel, so installing and every in-app update take about 10 s longer. From 2.2.1, releases use ULFO instead: a few MB more for an install about three times faster. Dari requires macOS 10.15 or later.

Updates

Dari checks the releases page on launch and every hour. When a newer version exists, an Update button appears in the title bar, with the new version in its tooltip, and the Help menu offers Install Dari <version> (or Download Dari <version>… where Dari can't update itself, as below).

  • macOS: Dari downloads the new image, checks its .sha256, bundle ID, version and code signature, then quits and relaunches as the new version. If anything fails, the installed version is kept. This works when Dari sits in a folder you can write to, such as Applications; otherwise Dari tells you to move it to Applications and open it from there.
  • Windows: Dari downloads the new .msi, checks its .sha256, upgrade code and version, then quits, installs it silently and relaunches. If the install fails, Windows Installer rolls it back and the installed version opens again. This works for the per-user install from the .exe or .msi; a copy elsewhere opens the download page. To update by hand, quit Dari and run the new .exe or .msi. If Dari is still open, the installer stops with Error 1306 on dari.lock: quit Dari and click Retry.
  • Linux tarball: Dari downloads the new tarball, checks its .sha256, main class and version, then quits, swaps the new Dari folder in for the old one and relaunches. If the new version doesn't start, the old folder is put back. The folder and the one containing it must be writable by you.
  • Linux .deb: the copy in /opt/dari belongs to root, so the button explains that and offers the download page. Install the new .deb with sudo apt install, which upgrades the installed copy.

Versions

The desktop app and the library share one version line, but the desktop app can ship on its own. A release titled Desktop only, such as a desktop fix, updates the desktop app and leaves the library where it was, so that version doesn't exist on Maven Central.

A Desktop only release never requires updating dari in your app.

Connect

  1. Keep adb available. Android Studio in its default location already includes it, and Dari also checks ANDROID_HOME. Without Android Studio, install SDK Platform-Tools: brew install android-platform-tools on macOS, sudo apt install adb on Debian or Ubuntu, or on Windows unzip it and add the platform-tools folder to PATH.
  2. Connect a device with USB debugging on, pair one over Wi-Fi (below), or start an emulator.
  3. Run a debuggable build of your app that uses dari and bring it to the foreground.

Dari finds the device and the app on its own and connects. With several devices, pick one from the title bar, or start Dari with ANDROID_SERIAL set. If the device hides its app list, type the applicationId instead.

While the desktop app is connected, the in-app notification and shake-to-open pause; they come back when it disconnects.

Over Wi-Fi

A device on Android 11 or later can connect without a cable through wireless debugging. The computer and the phone must be on the same network.

  1. On the phone, open Developer options → Wireless debugging and turn it on.
  2. In Dari, choose Session → Pair Device over Wi-Fi…, or Pair Device over Wi-Fi on the empty screen. It is available once Dari finds adb.
  3. Pair one of two ways:
    • QR code: on the phone, tap Pair device with QR code and scan the code Dari shows.
    • Pairing code: on the phone, tap Pair device with pairing code. The phone shows up in Dari's list; pick it, or type the IP address and port the phone shows, then enter the 6-digit code.

Dari waits up to about 30 seconds for the phone to connect after pairing. Once it does, the phone joins the device list like a USB device. A phone connected over both USB and Wi-Fi is listed once.

How it connects

There is nothing to configure: no proxy, certificate or port. Over USB, nothing to pair either; over Wi-Fi, pair once as above.

  1. Your app opens a named socket, dari_<applicationId>, that only exists inside the device.
  2. The desktop app runs adb forward tcp:0 localabstract:dari_<applicationId>. This opens a free port on your computer, chosen by adb, and tunnels it to that socket over the device's adb connection: USB, Wi-Fi or the emulator's.
  3. The desktop app talks to 127.0.0.1:<port>, and adb carries the data to your app.

Tunnels are removed when the desktop app disconnects or quits. adb forward --list shows any open ones.

Desktop appjava.net.Socketadb tunnelUSB · Wi-FiAndroid appLocalServerSocketListeningcat /proc/net/unix@dari_com.example
Desktop → appApp → desktopadb command

1. Find the app

The desktop reads the device’s Unix sockets with adb shell cat /proc/net/unix. A socket named dari_<applicationId> means that app runs Dari.

Privacy

  • Debug builds only, unless you opt in. The socket opens only in debuggable builds, or in a non-debuggable internal build that sets the manifest flag below. Release builds use dari-noop, which contains no capture code.
  • adb only. Only adb (shell) or root can connect, so other apps on the device can't read messages.
  • Masking is opt-in. By default, the desktop app receives payloads as captured, whatever the in-app setting is. Turn on Mask sensitive values in the desktop app's settings, and the device masks values under keys such as token, password, secret, cookie or authorization, and Bearer credentials, before they leave it. This is separate from the in-app setting. Apps on dari older than 2.2.0 always mask. See Masking for the exact rules.
  • No analytics. Apart from crash reports, the desktop app's only network requests are for updates: a check against github.com on launch and every hour, which sends nothing but what any browser visit would, and, when you install an update, the download of the release and its checksum. dari.log stays local and records the version at startup, crash-report setting changes and failures, never message contents.
  • Crash reports are on by default. When the app crashes, it sends the exception type, stack trace, and OS, architecture and Java versions to Sentry. Exception messages, bridge messages, host names and IP addresses are never sent. Turn it off in Settings → Privacy → Send crash reports.

Add your own masking. It runs on every message, after the built-in masking when that is on, and if it throws, the message isn't sent:

Dari.setPayloadRedactor { entry ->
    entry.copy(requestData = entry.requestData?.replace(Regex("\"phone\":\"[^\"]*\""), "\"phone\":\"***\""))
}

To keep the socket closed entirely:

Dari.setDesktopInspectorEnabled(false)

A non-debuggable internal build, such as staging, can opt in with this entry in its manifest:

<meta-data
    android:name="com.easyhooon.dari.desktop.ALLOW_NON_DEBUGGABLE"
    android:value="true" />

With the Gradle plugin, also list that build type. The plugin instruments only debuggable variants unless told otherwise. That build must depend on dari, not dari-noop. Keep release on dari-noop.

dari {
    nonDebuggableBuildTypes.add("staging")
}

Desktop only

For builds where only the desktop app should show messages, such as a staging build used for QA, add this entry. Dari then shows no notification, doesn't open on shake, and removes its launcher shortcut. Messages are still captured, and the desktop app shows them as usual.

<meta-data
    android:name="com.easyhooon.dari.DESKTOP_ONLY"
    android:value="true" />

A non-debuggable build needs ALLOW_NON_DEBUGGABLE above as well; otherwise nothing can show its messages.

Troubleshooting

StatusWhat to do
adb not foundSet ANDROID_HOME, or add platform-tools to PATH, then reopen Dari.
No deviceCheck adb devices. Accept the USB debugging prompt on the device.
No Dari app foundApps on dari 1.x have no desktop connection; upgrade to 2.0.0 or later. If the device hides the app list, type the applicationId.
Wi-Fi pairing finds nothingSome networks block device discovery (mDNS). Type the address and code from the phone's pairing-code screen instead. On macOS, if Android Studio started adb, restarting adb with ADB_MDNS_OPENSCREEN=0 can help; Dari sets it when it starts adb itself.
"Paired, but the device didn't connect"Turn Wireless debugging off and on, wait a few seconds, then try again.
App is in the backgroundAndroid pauses background apps. Bring the app to the foreground and Dari reconnects.
Details stay on "Select a message"The list fills from the live stream, but request and response bodies are fetched from the app on click. A backgrounded app may be frozen and not answer. Bring the app to the foreground and click the message again.
Not running DariCheck that the app is a debuggable build using dari 2.0.0 or later.

To report a problem, use Help → Report an Issue…. It opens the bug form with your Dari version and OS filled in; Help → Suggest a Feature… opens the feature request form. Help → Show Log File opens the folder with dari.log (~/Library/Logs/Dari on macOS, %LOCALAPPDATA%\easyhooon\Dari\logs on Windows, ~/.local/state/dari on Linux). The log records the version at startup, crash-report setting changes and failures, never message contents.

Uninstall

  • macOS: quit Dari and move /Applications/Dari.app to the Trash. To remove its settings and log too, delete ~/Library/Logs/Dari and ~/Library/Preferences/io.github.easyhooon.plist.
  • Windows: Settings → Apps → Installed apps → Dari → Uninstall. Settings live in the registry under HKEY_CURRENT_USER\Software\JavaSoft\Prefs\io\github\easyhooon, and the log in %LOCALAPPDATA%\easyhooon\Dari, which uninstalling leaves behind.
  • Linux: sudo apt remove dari, or delete the extracted Dari folder. Settings live in ~/.java/.userPrefs/io/github/easyhooon and the log in ~/.local/state/dari; delete them to remove everything.

Build from source

git clone https://github.com/easyhooon/dari.git
cd dari
./gradlew :dari-desktop-app:run

On this page