Speed Up Kodular Companion Sync Using ADB with Android Emulator(Windows)

The Problem

If you use MuMu Player (or any Android emulator) with Kodular Companion on Windows, you’ve probably noticed that after a few refreshes, the sync gets progressively slower — eventually freezing or crashing with:

Runtime Error
java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw an exception; no stack trace available.

By default, Kodular Companion syncs over WiFi — even when your emulator is running on the same machine. Every design change transfers your entire project assets over the local network, and after repeated refreshes, memory in the Companion app accumulates and causes the slowdown.

The fix: route Companion through ADB (Android Debug Bridge) instead of WiFi. This uses a direct loopback tunnel on your machine — significantly faster and more stable than WiFi sync.


What You Need

  • Windows PC
  • MuMu Player(or any other emulator supporting ADB) installed and running
  • Kodular Companion installed inside MuMu
  • ADB (Android Platform Tools) installed on Windows

Step 1 — Install ADB (Android Platform Tools)

Open Command Prompt and run:

adb version

If you see a version number printed, ADB is already installed — skip to Step 2.

If you get 'adb' is not recognized, download Platform Tools from Google:
:backhand_index_pointing_right: SDK Platform Tools release notes  |  Android Studio  |  Android Developers

Extract the zip to a folder (e.g. C:\platform-tools\) and add it to your Windows PATH:

  • Search “Environment Variables” in Windows Start
  • Under System Variables → find Path → Edit → New → paste C:\platform-tools\
  • Click OK, restart Command Prompt, run adb version again to confirm

Step 2 — Enable USB Debugging in MuMu

Inside the running MuMu emulator:

  1. Open Settings → About Phone
  2. Tap Build Number 7 times until you see “You are now a developer”
  3. Go back → open Developer Options
  4. Enable USB Debugging

Step 3 — Find Your MuMu ADB Port

MuMu’s ADB port is shown in its diagnostic info. To find it:

  • Open MuMu → top-right menu (...) → Problem Feedback or Basic Info
  • Look for the line: ADB debug port: XXXX, XXXXX

MuMu typically exposes two ports. You need the one that shows as device (not offline) when you connect. Common ports are 5555, 5559, 7555, or 16449 depending on your MuMu version.

To find the right one, run both and check:

adb connect 127.0.0.1:5559
adb connect 127.0.0.1:16449
adb devices

The one showing device (not offline) is your active port. In my case it was 16449 on MuMu Player 15.

If the emulator shows unauthorized instead of device, check MuMu’s screen for an “Allow USB Debugging?” popup and tap Allow.


Step 4 — Set Up the ADB Batch File (One-Time Setup)

To avoid typing these commands every session, create a batch file:

  1. Open Notepad
  2. Paste the following (replace 16449 with your actual port from Step 3):
@echo off
title Kodular Companion - ADB Setup
color 0A

echo ================================
echo  Kodular Companion ADB Setup
echo ================================
echo.

echo [1/4] Restarting ADB server...
adb kill-server
adb start-server
echo Done.
echo.

echo [2/4] Connecting to MuMu...
adb connect 127.0.0.1:16449
echo.

echo [3/4] Setting up reverse tunnels...
adb -s 127.0.0.1:16449 reverse tcp:8001 tcp:8001
adb -s 127.0.0.1:16449 reverse tcp:8002 tcp:8002
echo.

echo [4/4] Verifying connection...
adb devices
echo.

echo ================================
echo  All done! Steps to follow:
echo  1. Open Kodular in browser
echo  2. Click Connect to Companion
echo  3. Open Kodular Companion in MuMu
echo  4. Tap "I already have a code"
echo  5. Enter the 6-digit code shown
echo ================================
echo.
pause
  1. Save as kodular_companion_connect.bat (make sure it saves as .bat, not .bat.txt)
  2. Place it on your Desktop for easy access

Step 5 — Connect Companion via ADB Every Session

Each time you start a new Kodular session:

  1. Make sure MuMu is already running
  2. Double-click kodular_companion_connect.bat
  3. Wait for it to show device next to your MuMu port and print both tunnel confirmations (8001, 8002)
  4. Open Kodular in your browser
  5. Click Connect → Connect to Companion
  6. In MuMu, open Kodular Companion
  7. Tap “I already have a code” — :warning: do NOT scan the QR code (the QR code encodes your WiFi IP and will bypass ADB)
  8. Enter the 6-digit code shown in Kodular browser

Step 6 — Verify It’s Using ADB (Not WiFi)

To confirm you’re actually on ADB and not WiFi:

  1. Connect Companion using the steps above
  2. Turn off WiFi on your laptop
  3. Make a small design change in Kodular

:white_check_mark: If Companion still syncs → you’re on ADB
:cross_mark: If Companion disconnects → still on WiFi (make sure you used the 6-digit code, not the QR code)


How Much Faster?

In my testing on MuMu Player 15 (Android 15, i5-8265U, 20GB RAM):

  • WiFi sync: Progressive slowdown after 3-4 refreshes, OOM crash after ~10 refreshes
  • ADB sync: Noticeably faster initial sync, stable across many more refreshes per session

ADB won’t completely eliminate the Companion memory leak (that’s a Companion app issue), but it removes the WiFi overhead and makes each refresh significantly faster, meaning you get more productive refreshes per session before needing to restart.


Additional Tips

  • Re-run the bat file if MuMu shows offline after your PC wakes from sleep — the adb kill-server line handles reconnection automatically
  • Restart MuMu completely when Companion gets sluggish — this clears accumulated memory from Companion’s leak
  • Use a built APK (Build → Android App (.apk)) for heavy testing sessions involving Firebase, dynamic components, or WebViewer — Companion is best for quick visual/layout checks, not long logic-testing sessions
  • Switch MuMu renderer from Vulkan to OpenGL if you’re on an Intel integrated GPU — more stable for emulation

Tested On

Component Version
MuMu Player 15 (v6.5.2.0)
Android (in MuMu) 15
Windows 11 64-bit
ADB (Platform Tools) r35+
Kodular Creator (latest)

Hope this helps! Let me know if you run into issues with different MuMu versions or ports — happy to update the guide.

EDIT: You can increase heapsize memory to make more headroom for companion using below command in ADB:

adb -s 127.0.0.1:16449 shell setprop dalvik.vm.heapgrowthlimit 512m

Maker sure to change the port as per your device. Also you can include above command in bat file for seamless connection.

2 Likes

Nice guide.

What about real device? Since every emulator acts as devices itself, whereby adb is also available in real devices, have you tried it?

1 Like

TBH, since starting of my kodular project, I only used android emulator. I tried to work with companion on phone but i didn’t find it useful in other ways. However, I do real testing via intalling APK once a day when I make changes to the app. I’ll do the testing on my oneplus 13 either today or tomorrow via companion.

1 Like

Just checked on my Oneplus 13 via ADB method above with USB cable connection and disabling the Wifi/Data. The kodular companion appears to be faster than the normal connection. :smiley:

1 Like