# Hot reloading on Linux 4.20

**URL:** <https://forums.unrealengine.com/t/hot-reloading-on-linux-4-20/455213>\
**Category:** Platform & Builds\
**Tags:** Linux, UE4-20, unreal-engine, CPP, question, hot-reload\
**Created:** [September 11, 2019, 10:37pm UTC](https://forums.unrealengine.com/t/hot-reloading-on-linux-4-20/455213 "2019-09-11T22:37:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_b86aa7a1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b86aa7a1](https://forums.unrealengine.com/u/anonymous_user_b86aa7a1)\
**Post date:** [September 11, 2019, 10:37pm UTC](https://forums.unrealengine.com/t/hot-reloading-on-linux-4-20/455213/1 "2019-09-11T22:37:59Z")

</div>

I couldn’t get hot reloading to work on 4.20. Previous answers had used a `ModuleWithSuffix` argument to add a random number to the end. Instead, this script builds normally using cmake (from a CLion project) and then copies the resulting libraries and appends a new random number. Unreal seems to hot reload based on the presence of a `libUE4Editor-PROJECT_NAME-XXXX` based library string…if anyone reading is having trouble with a different version and this script doesn’t work, it may give you a hint.

```
#!/bin/bash
# Used with Unreal version 4.20

UNREAL_PATH=${HOME}/Developer/UnrealEngine;
RANDNUM=$(( ( RANDOM % 1000 ) + 1000 ));
CURR_DIR=`pwd`;
UPROJECT_FILE="$1";
UPROJECT_PATH=$(dirname "${UPROJECT_FILE}");
PROJ_NAME="$(basename "${UPROJECT_FILE%.uproject}")";
PROJ_NAME_EDITOR="${PROJ_NAME}Editor"
OUTPUT_BASE_NAME="libUE4Editor-"
N_CPUS=$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')
  
# make using cmake
cmake --build "${UPROJECT_PATH}/cmake-build-debug" --target "${PROJ_NAME_EDITOR}" -- -j ${N_CPUS}

# copy the created files to have the random number appended, this will trigger a hot reload
if [$? -eq 0]; then
  BINARY_BASENAME="${UPROJECT_PATH}/Binaries/Linux/${OUTPUT_BASE_NAME}${PROJ_NAME}"
  cp "${BINARY_BASENAME}.debug" "${BINARY_BASENAME}-${RANDNUM}.debug"
  cp "${BINARY_BASENAME}.so" "${BINARY_BASENAME}-${RANDNUM}.so"
  cp "${BINARY_BASENAME}.sym" "${BINARY_BASENAME}-${RANDNUM}.sym"
  echo "Successfully hot reloaded"
fi

```

---

<div class="post-metadata">

**Author:** ![staseg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@staseg](https://forums.unrealengine.com/u/staseg)\
**Post date:** [November 13, 2021, 8:51pm UTC](https://forums.unrealengine.com/t/hot-reloading-on-linux-4-20/455213/2 "2021-11-13T20:51:43Z")

</div>

Hot reload works on 4.26. But it is slow as hell on Linux.
