Hot Reload
Connect your device to the Nativeblocks CLI for live frame updates and real-time log streaming during development.
DevKit connects your running app to the Nativeblocks CLI. When you deploy a change via the CLI, the frame updates on your device instantly. No rebuild required. It also streams all SDK events to the CLI console for real-time debugging.
Add the Dependency
build.gradle
dependencies {
debugImplementation("io.nativeblocks:nativeblocks-wandkit-android:1.2.0")
}
Initialize DevKit
Call this after NativeblocksManager.initialize. Always restrict to debug builds.
MainActivity.kt
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
NativeblocksManager.initialize(
applicationContext = this,
edition = NativeblocksEdition.Cloud(
endpoint = NATIVEBLOCKS_API_URL,
apiKey = NATIVEBLOCKS_API_KEY,
developmentMode = true
)
)
if (BuildConfig.DEBUG) {
val devKit = DevKit.Builder(this)
.keepScreenOn() // keeps screen on during live sessions
.autoConnect() // connects to the CLI dev server automatically
.logTracking() // streams all SDK events to the CLI console
.build()
NativeblocksManager.getInstance().wandkit(devKit)
}
}
Builder options
| Method | What it does |
|---|---|
keepScreenOn() | Prevents screen from sleeping during a dev session |
autoConnect() | Connects to the CLI dev server on the same network automatically |
logTracking() | Pipes all INativeLogger events to the CLI log console |
How hot reload works
- Run the Nativeblocks CLI and connect to your device
- Update a frame via the CLI (move a block, change a property, update a variable)
- Deploy via the CLI
- The frame updates in your running app in real time. No rebuild, no reinstall.