On-Device Functionality

Build Preparation

Enable Required Build Settings

Start by ensuring that the Hot Reload Runtime is included in your build by satisfying all build requirements listed in the Hot Reload Window under "Settings/On-Device/Build" Settings Checklist. To automatically update your build settings for Hot Reload Runtime support, click the Fix All button.

Configure Build Machine Support

After enabling the required build settings, Hot Reload generates configuration files under Assets/HotReload on your local PC. To use a different machine for building, transfer the generated configuration files to the build machine using your preferred version control system or another file transfer method. Also, verify that the Player Build settings on the remote PC are compatible with Hot Reload Runtime (refer to the previous section).

Connection Issues

Resolve Auto-Pair Connection Problems

Hot Reload Runtime attempts to connect to the IP address used by your build machine during the build process by default. This may not work if you use a dedicated build machine or if your device and Editor were not connected to the same network during the build process.

To manually connect to the Editor:

  1. Connect both the Editor and running application to the same WiFi network.
  2. Ensure Hot Reload is running in the Editor.
  3. Find the IP address in the Editor by navigating to Hot Reload Window/Settings/On-Device/Manual connect.
  4. Enter the IP address you found earlier in your application's input field and press Reconnect.

Troubleshoot Failed Connections

If the manual connection fails, double-check that you completed all steps in the previous section. Additionally, try disabling your PC's firewall to determine if it interferes with Hot Reload's on-device functionality. If disabling the firewall resolves the issue but you prefer not to keep it disabled during Hot Reload usage, follow your operating system's process to whitelist Hot Reload through the firewall.

To add Hot Reload to the list of allowed apps on Windows, for example:

  1. Open the Start menu, type Allow an app through Windows Firewall, and select it from the list of results.
  2. Click Change settings. You might be prompted for an administrator password or to confirm your choice.
  3. To add an app, check the box next to the app, or select Allow another app and enter the app's path (usually under C:\Users\<User>\AppData\Local\singularitygroup-hotreload\executables_<Version>. Replace <User> with the current user and <Version> with the current Hot Reload version, replacing dots with dashes, such as 1-9-4).

Handling Different Commits

If code differences exist between your on-device build and Editor when connecting, some discrepancies can cause patches to fail, such as when certain members, like classes, are only present in the Editor and are included in patched methods.

However, some code differences might be permissible under specific conditions:

  • If the differences between the device and Editor are only within method bodies, patching those methods should not be a problem.
  • If code differences are in areas not intended for patching, patching other code is still possible. However, the running application may exhibit different behavior than what you expect from the Editor code. When the commits only modify the contents of functions, you can safely ignore the warning.

In this case, Hot Reload will work, even though the build and editor don't have identical code.

When the commits modify code outside of functions, we recommend you initially pay close attention to your editor's console for warnings.

Patching code that uses or modifies that code will likely fail, possibly with warnings.

Patching code that does not use or modify that code will likely still work.

Copyright © 2023 Hot Reload for Unity