Dev mode

This page was machine-translated. The Japanese page is the official version.

Overview

Dev mode is a mechanism that allows you to run and debug applications under development on ActcastOS via actdk. By enabling development mode on a device registered to Actcast, you can begin app development directly on that device.

Features & Benefits

Feature Description
Device Sharing Enables app development on Actcast-registered devices without swapping SD cards or devices.
actdk Integration Allows local app execution with debugging capabilities such as log viewing and step execution.
VS Code Dev Container Enables direct code editing and behavior checks on the device via container access.
SSH Key Authentication Registers your public key when enabling development mode, allowing secure shell access.

Prerequisites

  • A device with ActcastOS 4 installed
  • SSH public key (e.g., ~/.ssh/id_ed25519.pub)
  • actdk version v1.41.0 or later
  • Visual Studio Code
  • VS Code Extensions:
    • Remote - SSH
    • Dev Containers

How to Enable Dev mode

  1. Open the Actcast Console β†’ [Target Device]
  2. Click the power icon and select Enable Dev mode
  3. Paste your SSH public key into the dialog β†’ Save
  4. Dev mode will be enabled, allowing app testing via ActDK and SSH access to the device.

Tip

If a DEV badge appears next to the device details, you’re all set.

How to Disable Dev mode

  1. Open the Actcast Console β†’ [Target Device]
  2. Click the power icon and select Disable Dev mode
  3. Dev mode will be disabled, and ActDK and SSH access will no longer be available.

Development Workflow Using VS Code Dev Container

Here is a typical workflow for debugging directly on a device using VS Code + Dev Container from a local PC (macOS/Linux).

  1. Power on the device and connect it to the network

    • Confirm that ActcastOS boots and the device status in Actcast Console shows Found.
  2. Enable Dev mode

  3. Add an actdk remote

    actdk remote add <NAME>@<DEVICE_IP>
    • <DEVICE_IP> is the device’s IP or hostname (e.g., raspberrypi.local).
    • <NAME> is an arbitrary remote name.

    Tip

    If you want to use hostnames, mDNS must be enabled.

  4. Create a manifesto

    Tip

    If you modify the manifesto, a rebuild will be required.

  5. Build

    actdk build <NAME>
    • <NAME> is the remote name you added with actdk remote add.
    • The app will be built on the device.
  6. Launch the debug container on the device

    actdk debug container <NAME>
  7. Launch VS Code

  8. Install Remote - SSH & Dev Containers extensions (only once)

    • Search and install Remote - SSH and Dev Containers in the Extensions view.
  9. Connect to the device via Remote - SSH

    • Click the blue button in the bottom left β†’ Remote-SSH: Connect to Host... β†’ select actcast@<DEVICE_IP>. Click the blue button and select Remote-SSH: Connect to Host
    • Enter the passphrase for your SSH key when prompted by VS Code.
    • After connection, a new VS Code window will open showing the device’s filesystem.
  10. Attach to the Dev Container

    • Click the blue button in the bottom left β†’ Dev Containers: Attach to Running Container... β†’ select the container. Click the blue button and select Dev Containers: Attach to Running Container
    • Enter the passphrase for your SSH key when prompted by VS Code.
    • The container environment will open as your workspace, with code completion and debugging available.
  11. Edit the code

    • Modify and save the code.

    Tip

    These changes are made within the container. You’ll need to sync them manually to your local environment if needed.

  12. Run the application

    • From the VS Code menu: View > Terminal to open the terminal.
    • Run the app using ./main to test its behavior. If ActLog output is generated, it will appear here. debug in container
    • Validate functionality by checking camera preview or sensor output.

    Tip

    While the app is running, you can test Take Photo functionality by running actdk photo <NAME> from your local terminal.

  13. Sync changes to local environment

    • Copy any changes made within the container back to your local environment.

    Note

    Code changes made inside the container are not automatically reflected in your local repository.

  14. Stop the debug container

    actdk stop <NAME>
  15. Disable development mode

Frequently Asked Questions (FAQ)

Question Answer
I want to update my SSH key Disable development mode once, then re-register the new public key.
I want to try the production app during development mode Stop the debug container using actdk stop <NAME>, then install the app from Actcast Console.
I want to see low-level kernel logs SSH into the device and run dmesg or journalctl.
I can’t connect via SSH in VS Code Check if the public key is correctly registered and review your ~/.ssh/known_hosts file.
Last updated on