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:
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 versionagain to confirm
Step 2 — Enable USB Debugging in MuMu
Inside the running MuMu emulator:
- Open Settings → About Phone
- Tap Build Number 7 times until you see “You are now a developer”
- Go back → open Developer Options
- 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:
- Open Notepad
- Paste the following (replace
16449with 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
- Save as
kodular_companion_connect.bat(make sure it saves as.bat, not.bat.txt) - Place it on your Desktop for easy access
Step 5 — Connect Companion via ADB Every Session
Each time you start a new Kodular session:
- Make sure MuMu is already running
- Double-click
kodular_companion_connect.bat - Wait for it to show
devicenext to your MuMu port and print both tunnel confirmations (8001,8002) - Open Kodular in your browser
- Click Connect → Connect to Companion
- In MuMu, open Kodular Companion
- Tap “I already have a code” —
do NOT scan the QR code (the QR code encodes your WiFi IP and will bypass ADB) - 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:
- Connect Companion using the steps above
- Turn off WiFi on your laptop
- Make a small design change in Kodular
If Companion still syncs → you’re on ADB
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
offlineafter your PC wakes from sleep — theadb kill-serverline 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.