Skip to content

Restart ​

Restart makes deployment results that require a lifecycle refresh or process reload take effect. Jugg decides whether to restart the Activity, restart the app, or keep the current process running based on deployment data, Run configuration, and the Debug entry point.

Restart triggers ​

ScenarioCurrent supportRestart behavior
Refresh the current UI after Apply ChangesSupportedRestarts the Activity
Hot Fix class or push-only overlaySupportedRestarts the app
Deploy generated ARouter route, Provider, or interceptor registration indexesSupportedRestarts the app to rebuild registration caches
User selects always restartSupportedRestarts the app after deployment succeeds
Debug executor startsSupportedRestarts the app after successful deployment, then attaches the debugger
Detect JVMTI after the first agent pushSupportedRestarts the app so the system loads the startup agent
Start the app after installSupportedThe deployment flow starts the app after installation

How it takes effect ​

text
Generate deployment data
  -> Determine the deployment action and lifecycle boundary
  -> Push the JVMTI agent when needed
  -> restart app / restart activity / start app according to deployment type and user settings
  -> Attach the Java debugger in Debug scenarios

Hot Fix classes, push-only overlays, and some process-level caches require an app restart. Regular non-empty incremental deployments that do not require an app restart recreate the Activity. The Debug entry point restarts the app after deployment by default so that the debugging session starts from the new process state.

ARouter registration indexes trigger an app restart whenever they appear in the current deployment artifacts, including identical indexes recompiled from cached generated sources. Ordinary route classes and property injection helpers do not trigger this rule on their own; deploying registration indexes in the same Run still restarts the app.

How the launch target is selected ​

Restart, start after install, and Recover start share the same launch-target selection. It falls back in order across the whole APK set, including split APKs:

OrderLaunch targetMatch conditionFinal action
1Launch ActivityMAIN + LAUNCHER/LEANBACK_LAUNCHERStarts that Activity
2HOME Activityenabled, exported, and declares MAIN + HOMEStarts that Activity
3Stop the appNeither of the two above existsam force-stop <package>

The fallback runs in stages across all APKs: Jugg scans every APK for a launch Activity first, and only then scans every APK for a HOME Activity. A launch Activity in a later split APK therefore still wins over a HOME Activity in an earlier APK. When neither exists, Jugg does not start some other regular Activity; it only stops the app.

During a restart the start command carries -S, and in Debug it carries -D; the second level keeps those flags too. At the third level the restart has completed, but the app is stopped rather than started, and Restart does not clear app data because of it.

Relationship to deployment strategies ​

StrategyRestart behavior
Code SwapDoes not require an app restart; a regular non-empty deployment still usually recreates the Activity
Full SwapRestarts the Activity
Hot FixRestarts the app
Clean ReinstallStarts the app after reinstallation
JVMTI agent updateUsually requires an app restart before detection