- Debug running OpModes while updating them
- Deploy app changes without rebooting
- Clone this repo into a folder adjacent to your FtcRobotController folder.
~/dev$ ls
FtcRobotController
~/dev$ git clone https://github.com/VCInventerman/ftc-hotpatch.git
Cloning into 'ftc-hotpatch'...
Unpacking objects: 100% (43/43), 21.48 KiB | 39.00 KiB/s, done.
~/dev$ ls
FtcRobotController ftc-hotpatch
~/dev$
- Copy the .run folder from this repo to FtcRobotController. This installs the script that deploys hotpatches.
~/dev$ cp -r ftc-hotpatch/.run FtcRobotController/
- Include this repo's source code to your gradle project.
~/dev$ echo "android { sourceSets { main { java { srcDirs('../../ftc-hotpatch/src/') } } } }" >> FtcRobotController/FtcRobotController/build.gradle
- Open the FtcRobotController project in Android Studio. Open FtcOpModeRegister in the folder below.

- Edit FtcOpModeRegister
// Copy this line directly below the other lines starting with "import"
import com.karrmedia.ftchotpatch.SupervisedClassManager;
// Copy this line directly below the line starting with "public void register"
SupervisedClassManager.init(manager);
- Modify an existing OpMode to be hotpatchable
- Add the following under existing import statements
import com.karrmedia.ftchotpatch.SupervisedOpMode; import com.karrmedia.ftchotpatch.Supervised;- Change the
@TeleOpor@Autonomousannotation to@Supervised, and inherit fromSupervisedOpModeinstead ofLinearOpModeorOpMode
- @TeleOp(name="Basic OpMode", group="Iterative Opmode") + @Supervised(name="Basic OpMode", group="Iterative Opmode", autonomous=false) - public class BasicOmniOpMode extends LinearOpMode { + public class BasicOmniOpMode extends SupervisedOpMode {
- Patch existing methods to loop
- public void runOpMode() { + public void init() { - waitForStart(); + } + + public void start() { - while (opModeIsActive()) { + } + + public void loop() { ... - }

