Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions content/hardware/02.uno/boards/uno-q/tutorials/06.adb/adb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: Connect to UNO Q via ADB
description: Learn how to connect to the UNO Q's shell via ADB.
author: Karl Söderby
tags: [UNO Q, ADB, Linux]
---

The Linux OS running on the [Arduino UNO Q](https://store.arduino.cc/products/uno-q) can be accessed over USB, using a tool called Android Debug Bridge (ADB).

ADB is a tool that you install on your computer, where you can access the board's shell and run operations on the system.

## Requirements

The following hardware is required:
- [Arduino UNO Q](https://store.arduino.cc/products/uno-q)
- [USB-C® type cable](https://store.arduino.cc/products/usb-cable2in1-type-c)

You will also need to have the following software installed on your OS:
- [Android Debug Bridge](https://developer.android.com/tools/releases/platform-tools)

## Installing ADB (Host Computer)

The ADB command line tool is supported on MacOS, Windows & Linux. For more specific instructions for your OS, see the sections below.

***You can find more information and download the latest version for the tool for all operating systems directly from the [Android SDK Platform Tools](https://developer.android.com/tools/releases/platform-tools#downloads) page.***

### MacOS

To install the ADB tools on **MacOS**, we can use `homebrew`. Open the terminal and run the following command:

```
brew install android-platform-tools
```

To verify the tool is installed, run `adb version`.

### Windows

To install the ADB tools on **Windows**, we can use `winget`, supported on Windows 11 and on some earlier Windows 10 versions.

Open a terminal and run the following:

```
winget install Google.PlatformTools
```

To verify the tool is installed, run `adb version`.

### Linux

To install ADB tools on a **Debian/Ubuntu Linux distribution**, open a terminal and run the following command:

```
sudo apt-get install android-sdk-platform-tools
```

To verify the tool is installed, run `adb version`.

## Connect via ADB

1. Connect the UNO Q board to your computer via USB-C®.
2. Run `adb devices` in the terminal. This should list the connected devices.

![Connected devices](assets/connected-devices.png)

>Note that it may take up to a minute for the device to appear after connecting it.

3. Run `adb shell`. If you have not set up your board prior to this via the Arduino App Lab, you may be required to provide a password, which is `arduino`.
4. You should now be inside your board's terminal.

![Terminal on the board.](assets/board-terminal.png)

5. You are now able to run commands via the terminal on your board! To exit from the terminal, simply type `exit`.

## Summary

Connecting via ADB is an easy way to gain access to your board's shell, allowing you to perform actions such as installing packages, editing files and running scripts.

The `arduino-app-cli` can also be used directly via the shell, allowing you to launch Apps directly from the command line. You can read more about that in the link below:
- [Arduino App CLI: Manage Apps from the Command Line](/software/app-lab/tutorials/cli/)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 17 additions & 53 deletions content/software/app-lab/tutorials/03.cli/apps-lab-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,15 @@ The following hardware is required:
- [Arduino UNO Q](https://store.arduino.cc/products/uno-q)
- [USB-C® type cable](https://store.arduino.cc/products/usb-cable2in1-type-c)

You will also need to have the following software installed:
To access the board via `adb` (over USB), you will also need to have the following software installed:
- [Android Debug Bridge](https://developer.android.com/tools/releases/platform-tools)

## Installing ADB (Host Computer)

***Note: if you are using the board as a Single Board Computer (SBC Mode (Preview) without a host computer), you do not need to install ADB. You can run `arduino-app-cli` directly from the terminal.***

The ADB command line tool is supported on MacOS, Windows & Linux. For more specific instructions for your OS, see the sections below.

***You can find more information and download the latest version for the tool for all operating systems directly from the [Android SDK Platform Tools](https://developer.android.com/tools/releases/platform-tools#downloads) page.***

### MacOS

To install the ADB tools on **MacOS**, we can use `homebrew`. Open the terminal and run the following command:

```sh
brew install android-platform-tools
```

To verify the tool is installed, run `adb version`.

### Windows

To install the ADB tools on **Windows**, we can use `winget`, supported on Windows 11 and on some earlier Windows 10 versions.

Open a terminal and run the following:

```sh
winget install Google.PlatformTools
```

To verify the tool is installed, run `adb version`.

### Linux

To install ADB tools on a **Debian/Ubuntu Linux distribution**, open a terminal and run the following command:

```sh
sudo apt-get install android-sdk-platform-tools
```

To verify the tool is installed, run `adb version`.
You can also access the board via SSH, which is typically installed on your system by default.

## Connect via ADB

***To learn more about setting up `adb`, check out the [Connect to UNO Q via ADB](/tutorials/uno-q/adb/) tutorial. This guide will walk you through the installation steps.***

1. Connect the UNO Q board to your computer via USB-C.
2. Run `adb devices` in the terminal. This should list the connected devices.

Expand Down Expand Up @@ -104,7 +68,7 @@ To manage Apps, we use the `app` command.

To create an app, we can use:

```sh
```
arduino-app-cli app new "test"
```

Expand All @@ -118,13 +82,13 @@ If you are accessing the board via `adb`, you can **pull** and **push** the file

To pull the file, use:

```sh
```
adb pull /home/arduino/ArduinoApps /path/to/localfolder
```

And to push it, use:

```sh
```
adb push /path/to/localfolder /home/arduino/ArduinoApps
```

Expand All @@ -134,23 +98,23 @@ adb push /path/to/localfolder /home/arduino/ArduinoApps

Once an App is created and edited, it can be launched through the following command:

```sh
```
arduino-app-cli app start "/home/arduino/ArduinoApps/test"
```

This will launch the App on your UNO Q board.

To stop the App, use:

```sh
```
arduino-app-cli app stop "/home/arduino/ArduinoApps/test"
```

### Read App Logs

To monitor the logs of a running App, use the `logs` command:

```sh
```
arduino-app-cli app logs /home/arduino/ArduinoApps/test --all
```

Expand All @@ -163,7 +127,7 @@ This will list the logs of the App:

To run built-in examples and Apps that we create, we can use the `user` and `examples` shortcut (instead of specifying path).

```sh
```
# run your own app
arduino-app-cli app start user:my-app

Expand All @@ -175,7 +139,7 @@ arduino-app-cli app start examples:blink

To list available Apps, use the `app list` command.

```sh
```
arduino-app-cli app list
```

Expand All @@ -187,7 +151,7 @@ This will list all available Apps (including examples), and their status:

To set a board name using the `arduino-app-cli`, we can use the `set-name` command.

```sh
```
arduino-app-cli board set-name "my-board"
```

Expand All @@ -199,22 +163,22 @@ The `system` command allows you to manage system configurations and updates on y

To check for updates, run:

```sh
```
arduino-app-cli system update
```
This will prompt you to install any available updates.

To enable or disable the network mode, use:

```sh
```
arduino-app-cli system network enable/disable
```

Network mode will enable SSH and allows clients to connect to the board over a local network.

Finally, you can gain back some storage space by cleaning up unused containers and images by running:

```sh
```
arduino-app-cli system cleanup
```

Expand All @@ -224,7 +188,7 @@ Currently, it is only possible to list available Bricks and specific details for

This is done by running:

```sh
```
# List out Bricks installed on the board
arduino-app-cli brick list
# Details for a specific Brick
Expand Down
Loading