You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/learn/develop/local-mode.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,14 +30,14 @@ To use local mode on a device:
30
30
31
31
## Scan the network and find your device
32
32
33
-
Before you can get your app running on your device in local mode, you have to find your device. You can find the `short-uuid` and local IP address of the device from the device dashboard or by scanning the network. To perform a scan, login to the {{ $names.company.lower }} CLI and use `{{ $names.company.short }} scan` to find any local {{ $names.os.lower }} devices. All {{ $names.os.lower }} devices advertise themselves on the network using [Avahi][avahi]. The names take the form `<short-uuid>.local`, where the `short-uuid` is the UUID you see on your device dashboard.
33
+
Before you can get your app running on your device in local mode, you have to find your device. You can find the `short-uuid` and local IP address of the device from the device dashboard or by scanning the network. To perform a scan, login to the {{ $names.company.lower }} CLI and use `{{ $names.company.short }} device detect` to find any local {{ $names.os.lower }} devices. All {{ $names.os.lower }} devices advertise themselves on the network using [Avahi][avahi]. The names take the form `<short-uuid>.local`, where the `short-uuid` is the UUID you see on your device dashboard.
34
34
35
-
__Note:__ You may need administrator privileges to run `{{ $names.company.short }} scan` as it requires access to all network interfaces.
35
+
__Note:__ You may need administrator privileges to run `{{ $names.company.short }} device detect` as it requires access to all network interfaces.
36
36
37
37
**Command**
38
38
39
39
```bash
40
-
sudo {{ $names.company.short }} scan
40
+
sudo {{ $names.company.short }} device detect
41
41
```
42
42
43
43
**Output**
@@ -66,7 +66,7 @@ Reporting scan results
66
66
67
67
## Push over a new project
68
68
69
-
When local mode has been activated, {{ $names.company.lower }} CLI can push code directly to the local device instead of going via the {{ $names.cloud.lower }} builders. As code is built on the device and then executed, this can significantly speed up development when requiring frequent changes. To do this, we use the `{{ $names.company.lower }} push` command providing either the local IP address or `<short-uuid>.local`, obtained from the preceding `{{ $names.company.short }} scan` command.
69
+
When local mode has been activated, {{ $names.company.lower }} CLI can push code directly to the local device instead of going via the {{ $names.cloud.lower }} builders. As code is built on the device and then executed, this can significantly speed up development when requiring frequent changes. To do this, we use the `{{ $names.company.lower }} push` command providing either the local IP address or `<short-uuid>.local`, obtained from the preceding `{{ $names.company.short }} device detect` command.
70
70
71
71
__Note:__ By default `{{ $names.company.short }} push` will build from the current working directory, but it is also possible to specify the project directory via the `--source` option.
72
72
@@ -167,48 +167,48 @@ By default, when pushing code to a device in local mode using the {{ $names.comp
When detached, the services continue to run on the device, and you can access the logs using the `{{ $names.company.short }} logs` command, again passing the local IP address or `<short-uuid>.local`.
170
+
When detached, the services continue to run on the device, and you can access the logs using the `{{ $names.company.short }} device logs` command, again passing the local IP address or `<short-uuid>.local`.
This command will output logs for the system and all running services. You may optionally filter the output to include only system or specific service logs using the available `--system` (`-S`) and `--service` (`-s`) options. For example, to output only the system logs:
To filter logs by a service, use the `--service` option. You may specify this option multiple times to output logs from multiple services.
183
183
184
184
```bash
185
-
{{ $names.company.short }} logs 63ec46c.local --service main
186
-
{{ $names.company.short }} logs 63ec46c.local --service first --service second
185
+
{{ $names.company.short }} device logs 63ec46c.local --service main
186
+
{{ $names.company.short }} device logs 63ec46c.local --service first --service second
187
187
```
188
188
189
189
These options can be combined to output system and selected service logs e.g.
190
190
191
191
```bash
192
-
{{ $names.company.short }} logs 827b231.local --system --service first --service second
192
+
{{ $names.company.short }} device logs 827b231.local --system --service first --service second
193
193
```
194
194
195
195
__Note:__ You may also specify the `--service` and `--system` options using the `{{ $names.company.short }} push` command to filter the log output.
196
196
197
197
## SSH into the running app container or host OS
198
198
199
-
To access the local device over [SSH][ssh], use the `{{ $names.company.short }} ssh` command specifying the device IP address or `<short-uuid>.local`. By default, SSH access is routed into the host OS shell and, from there, we can check system logs and [perform other troubleshooting tasks][troubleshooting]:
199
+
To access the local device over [SSH][ssh], use the `{{ $names.company.short }} device ssh` command specifying the device IP address or `<short-uuid>.local`. By default, SSH access is routed into the host OS shell and, from there, we can check system logs and [perform other troubleshooting tasks][troubleshooting]:
__Note:__ If an IP address or a `.local` hostname is used (instead of a fleet name or device UUID), `{{ $names.company.short }} ssh` establishes a direct connection to the device on port `22222` that does not rely on cloudlink.
211
+
__Note:__ If an IP address or a `.local` hostname is used (instead of a fleet name or device UUID), `{{ $names.company.short }} device ssh` establishes a direct connection to the device on port `22222` that does not rely on cloudlink.
Copy file name to clipboardExpand all lines: shared/general/container-ssh.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,31 +14,31 @@ A terminal session should be initiated for you in a second or two. If you would
14
14
15
15
__Note:__ To copy and paste in the terminal window, you cannot use the normal Ctrl + C and Ctrl + V shortcuts. You can either select Copy and Paste from a menu, or use Ctrl + Insert for copy and Shift + Insert for Paste. For MacOS users, ⌘ + C and ⌘ + V work as expected.
16
16
17
-
## Using `{{ $names.company.short }} ssh` from the CLI
17
+
## Using `{{ $names.company.short }} device ssh` from the CLI
18
18
19
19
To use the CLI, first [install it][cli-install] and [add an SSH key to {{ $names.cloud.lower }}][add-ssh-key]. Then run the following command on your development machine's terminal:
`<device-uuid>` is the unique identifier for the device you want to access, which can be found via the dashboard or in the output of the `{{ $names.company.short }} devices` CLI command. By default, SSH access is routed into the host OS shell. However, you can SSH into a service by specifying its name as part of the command:
25
+
`<device-uuid>` is the unique identifier for the device you want to access, which can be found via the dashboard or in the output of the `{{ $names.company.short }} device list` CLI command. By default, SSH access is routed into the host OS shell. However, you can SSH into a service by specifying its name as part of the command:
26
26
27
27
```shell
28
-
$ {{ $names.company.short }} ssh <device-uuid> main
28
+
$ {{ $names.company.short }} device ssh <device-uuid> main
29
29
```
30
30
31
31
This also works in multicontainer fleets; simply pass the name of the appropriate service (as defined in docker-compose.yml) instead of `main`.
32
32
33
-
__Note:__ To run a command in a non-interactive way, you can pipe commands to the CLI's stdin. For example, `echo "uptime; exit;" | balena ssh <device-uuid>`.
33
+
__Note:__ To run a command in a non-interactive way, you can pipe commands to the CLI's stdin. For example, `echo "uptime; exit;" | balena device ssh <device-uuid>`.
34
34
35
35
When a fleet name or device UUID is used as above, `{{ $names.company.short }}` ssh uses Cloudlink to create a secure tunnel to the device and then forward SSH traffic between the device and your development machine.
36
36
37
37
If an IP address or a .local hostname is used (instead of a fleet name or device UUID), `{{ $names.company.short }}` ssh establishes a direct connection that does not rely on Cloudlink:
38
38
39
39
```shell
40
-
$ balena ssh 192.168.1.23
41
-
$ balena ssh <device-uuid>.local
40
+
$ balena device ssh 192.168.1.23
41
+
$ balena device ssh <device-uuid>.local
42
42
```
43
43
44
44
When used with a [production variant of {{ $names.os.lower }}][development-image], this
@@ -70,19 +70,19 @@ Development variants of {{ $names.os.lower }} allow unauthenticated access and s
70
70
directly exposed to the public internet.
71
71
72
72
The IP address will typically be a private IP address of a local network. For remote devices,
73
-
see [{{ $names.company.short }} tunnel][balena-tunnel].
73
+
see [{{ $names.company.short }} device tunnel][balena-tunnel].
74
74
75
-
## {{ $names.company.short }} tunnel
75
+
## {{ $names.company.short }} device tunnel
76
76
77
77
The SSH server of a {{ $names.os.lower }} device (host OS) listens on TCP port `22222`.
78
78
This port is not blocked by any firewall on the device itself, but external firewalls or NAT
79
79
routers will often block access at the network level. To get around this, you can use the
80
-
`{{$names.company.short }} tunnel` command of the {{ $names.cli.lower }}, which tunnels a
80
+
`{{$names.company.short }} device tunnel` command of the {{ $names.cli.lower }}, which tunnels a
81
81
TCP connection between a localhost port and a port on the device. For example, the following
82
82
command maps local port `4321` to remote port `22222` on the device:
0 commit comments