Hot Restart in Mobile Development — Essence, Mechanism, and Principle of Operation

Author: IT Sectr Published: 2026-05-18 Reading time: 8 min

Hot Restart is a mechanism for quickly reloading a mobile application during development, in which the application completely restarts with updated source code. Unlike a full recompilation, Hot Restart uses already compiled binary code and only reloads the Dart VM, reducing the development cycle time. According to Flutter documentation (2025), a typical Hot Restart takes 1 to 3 seconds. Hot Restart is especially useful when changing the global state of the application and initialization code.

Key Takeaways

  • Hot Restart — a full restart of the application with updated code, where the Dart VM reloads and the application state resets to initial.
  • Hot Reload — incremental loading of changes without losing the current application state, works significantly faster than Hot Restart.
  • Dart VM restarts completely during Hot Restart, guaranteeing that all changes are applied, including initialization and static variables.
  • How it works includes recompiling changed files, restarting the Dart VM, and reinitializing the application in 1–3 seconds.
  • Use cases — changes to global variables, configurations, DI containers, and initialization code that require a full state reset.

What Is Hot Restart?

Hot Restart is a development mechanism in which the application completely reloads with updated source code without the need for a full project recompilation. The developer makes changes to the code, saves the file, and sends a restart command through the IDE. The application recompiles the changed files, restarts the Dart VM, and goes through the entire lifecycle from main to the final rendering of the user interface.

Hot Restart differs from a full rebuild in that it uses already compiled binary libraries and the Flutter framework without recompiling native wrappers. This reduces the development cycle time from several minutes to several seconds. According to a Flutter developer survey (2024), the average Hot Restart time is 2.1 seconds, which is approximately 97% faster than a full project rebuild using the flutter build command.

The mechanism is especially in demand when developing user interfaces that require frequent checking of visual changes. The developer can change the color, size, or position of an element and instantly see the result on a simulator or physical device without losing development context to lengthy compilation. This radically accelerates iterative prototyping.

How Does the Hot Restart Mechanism Work?

When executing a Hot Restart command, a sequence of operations occurs: saving changed files, incremental compilation of changed Dart files into machine code, restarting the Dart VM, and re-executing the application entry point. The Dart VM is a virtual machine that executes Dart code in JIT (Just-In-Time) mode during development and AOT (Ahead-Of-Time) in production builds.

Lifecycle During Hot Restart

During Hot Restart, the application goes through a full lifecycle: calling the main function, initializing WidgetsFlutterBinding, launching runApp, and building the entire widget tree from scratch. All previous widget states, variables, and caches are cleared. This guarantees that the application is in a clean state, fully identical to the state after a fresh installation on the device.

The process can be represented as a sequence of steps: the developer presses the Hot Restart button in the IDE, the Flutter tooling sends a command to the device, the device saves the current application skeleton, restarts the Dart VM with the new code, and launches main again. All dependencies registered in the dependency injection container are recreated from scratch.

A key feature is that the binary code of the native shell (plugins, Kotlin code, Swift code) is not recompiled. Hot Restart only affects the Dart layer of the application, which ensures the high speed of restart. If changes affect native code, a full flutter build is required.

Technical Implementation in Flutter

Flutter uses an architecture where Dart code runs on the Dart VM and the UI is rendered through the Skia or Impeller engine. During Hot Restart, the Flutter tooling restarts an isolated instance of the Dart VM (isolate), loads updated .dill files (Dart Intermediate Language), and re-runs the main function. The entire UI is rebuilt from scratch via the runApp call, guaranteeing that all widgets are up to date.

dart
import 'package:flutter/material.dart';

void main() {
  // After Hot Restart, this function runs again
  var prefs = await SharedPreferences.getInstance();
  var themeMode = prefs.getString('theme') ?? 'light';
  runApp(MyApp(themeMode: themeMode));
}

Hot Restart vs Hot Reload: Key Differences

Hot Restart and Hot Reload are two rapid development mechanisms that are often confused. Hot Reload loads changes into the running application without losing the current state, while Hot Restart completely restarts the application. Hot Reload works faster (0.1–1 second) but does not apply changes that affect initialization or static class fields.

Application State Preservation

The main difference is application state. Hot Reload preserves the current state of widgets: scroll position, entered data, open modal windows. Hot Restart resets all state to initial. If the change only affects the code in the build method, Hot Reload is sufficient. If the change affects main, global variables, or dependencies, Hot Restart is required.

Hot Reload applies changes by injecting updated code into the Dart VM without restarting the isolate. This is only possible for changes that do not break type structure and do not require widget reinitialization. During Hot Restart, the isolate restarts completely, allowing any changes to be applied, including deleting or renaming classes and methods.

Performance and Scenarios

According to the Flutter team, Hot Reload takes less than 1 second for most changes, while Hot Restart takes 1 to 3 seconds. For approximately 80% of user interface changes, Hot Reload is sufficient. Hot Restart is required when changing application configurations, global variables, native plugins in the Dart wrapper, and architectural decisions.

The following strategy is recommended: use Hot Reload for visual UI edits and minor logic changes; switch to Hot Restart when changing data structures, adding dependencies, or editing initialization code. This minimizes waiting time and keeps development productivity high.

Hot Restart Implementation in Popular Frameworks

The hot restart mechanism is implemented differently depending on the framework and programming language. Flutter provides the most mature implementation of Hot Restart through Dart VM JIT compilation, while React Native uses a similar mechanism through Metro Bundler and JavaScript Core or Hermes.

Hot Restart in Flutter

In Flutter, Hot Restart is activated by the r command in the terminal after starting the application via flutter run. Alternatively, use the Hot Restart button in Android Studio, VS Code, or IntelliJ IDEA. Hot Restart only works in debug mode and is not available in profile and release builds. When executed, the Flutter tooling recompiles the changed files into kernel format and sends them to the device.

dart
// Before Hot Restart: old version
class Counter extends StatefulWidget {
  final int initialValue = 0;
  // After Hot Restart: new value will take effect
  // final int initialValue = 10;
}

class CounterState extends State<Counter> {
  int _count = 0;
  // Hot Reload keeps _count, Hot Restart resets to 0
}

A limitation of Hot Restart in Flutter is the inability to preserve debug state. After restarting, all breakpoints are preserved, but the variable values in the debugger are reset. To preserve state between restarts, the State Restoration mechanism is used.

Hot Restart in React Native

In React Native, hot restart is implemented through Metro Bundler, a JavaScript module bundler. When code changes, Metro rebuilds the changed modules and sends the updated bundle to the device. React Native supports Fast Refresh, an analogue of Hot Reload that preserves the state of functional components using React hooks.

A full restart (Reload) in React Native reloads the JavaScript engine and the entire application as a whole. This is fully analogous to Hot Restart in Flutter. To trigger it, use Cmd+R on the iOS simulator or double press R on Android. The full restart time in React Native varies from 2 to 8 seconds depending on the bundle size.

When to Use Hot Restart in Development

Hot Restart is an indispensable tool in a number of development scenarios. The first and most obvious one is changing the global configuration of the application: themes, localization, state providers. If you changed a provider at the root of the widget tree or added a new module to the DI container, Hot Restart guarantees correct initialization of all components.

The second scenario is changing static variables and constants. In Dart, static fields are initialized once when the class is loaded. Hot Reload does not apply changes to static fields, so Hot Restart is required to update them. This is especially relevant when working with configuration constants, API URLs, and feature flags.

The third scenario is debugging initialization: checking the operation of the main function, splash screen, dependency loading. With each Hot Restart, the application goes through a full initialization cycle, which allows identifying errors that occur only at startup — problems with SharedPreferences, database connection errors, initialization timeouts.

The fourth scenario is testing empty state. Hot Restart resets all application state, allowing you to check the behavior on first launch: displaying onboarding, requesting permissions, empty lists, and placeholder screens. For repeatable testing, this is significantly faster than reinstalling the application.

Frequently Asked Questions

How does Hot Restart differ from Hot Reload?

Hot Restart completely restarts the application and the Dart VM, resetting the state to initial. Hot Reload injects changes into the running application, preserving the current UI state. Hot Reload is faster but cannot be used for initialization changes and global variables.

How to perform a Hot Restart in Flutter?

In the terminal after launching flutter run, press the R key (Shift+R) for Hot Restart. In Android Studio or VS Code, use the Hot Restart button on the debug panel. The command is only available in debug mode.

How long does a Hot Restart take?

A typical Hot Restart takes 1 to 3 seconds for medium-sized projects. The time depends on the number of Dart files, the complexity of the widget tree, and device performance. For large projects, the time can reach 5–8 seconds.

Does Hot Restart work in release build?

No, Hot Restart is only available in debug mode. Release and profile builds use AOT compilation, which does not support hot reloading. Updating code in release requires a full rebuild.

Can Hot Restart be used with native plugins?

Hot Restart does not affect native code — Kotlin, Swift, or Java plugins. If changes are made to the native plugin code, a full project rebuild is required. Hot Restart is only effective for the Dart layer of the application.

Summary

  • Hot Restart — a mechanism for completely restarting the application with updated Dart code, resetting the state to initial.
  • Difference from Hot Reload — full restart of the Dart VM and reinitialization of all components, including global variables and static fields.
  • Execution time — 1–3 seconds for a typical project, which is 97% faster than a full rebuild via flutter build.
  • Use cases — changing global configuration, static variables, DI containers, and initialization code.
  • Limitations — does not apply to native code (Kotlin/Swift), only available in debug mode, resets debug state.
  • Usage strategy — Hot Reload for UI edits, Hot Restart for architecture and initialization changes, full rebuild for native code.
  • Implementation — Flutter uses Dart VM JIT compilation, React Native uses Metro Bundler with JS engine reload.

We will develop a mobile application turnkey

IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.

Discuss the project

Read also