| 1 |
# dev |
| 2 |
|
| 3 |
Run the application in developer mode. |
| 4 |
|
| 5 |
## Usage |
| 6 |
|
| 7 |
To run your application in development mode on the current platform's default output format: |
| 8 |
|
| 9 |
```console |
| 10 |
$ briefcase dev |
| 11 |
``` |
| 12 |
|
| 13 |
To run your application for a different platform: |
| 14 |
|
| 15 |
```console |
| 16 |
$ briefcase dev <platform> |
| 17 |
``` |
| 18 |
|
| 19 |
To run your application using a specific output format: |
| 20 |
|
| 21 |
```console |
| 22 |
$ briefcase dev <platform> <output format> |
| 23 |
``` |
| 24 |
|
| 25 |
Briefcase will create a clean virtual environment in which to run your app. The first time the application runs in developer mode, any requirements listed in a [`requires`][] configuration item in `pyproject.toml` will be installed into that environment. |
| 26 |
|
| 27 |
## Options |
| 28 |
|
| 29 |
The following options can be provided at the command line. |
| 30 |
|
| 31 |
### `-a <app name>` / `--app <app name>` |
| 32 |
|
| 33 |
Run a specific application target in your project. This argument is only required if your project contains more than one application target. The app name specified should be the machine-readable package name for the app. |
| 34 |
|
| 35 |
### `-r` / `--update-requirements` |
| 36 |
|
| 37 |
Update application requirements. |
| 38 |
|
| 39 |
### `--no-isolation` |
| 40 |
|
| 41 |
Use the currently active virtual environment (i.e., the environment where Briefcase is installed), rather than an isolated virtual environment to run the app. |
| 42 |
|
| 43 |
### `--no-run` |
| 44 |
|
| 45 |
Do not run the application; only install application requirements. |
| 46 |
|
| 47 |
### `--test` |
| 48 |
|
| 49 |
Run the test suite in the development environment. |
| 50 |
|
| 51 |
### Passthrough arguments |
| 52 |
|
| 53 |
If you want to pass any arguments to your app's command line, you can specify them using the `--` marker to separate Briefcase's arguments from your app's arguments. For example: |
| 54 |
|
| 55 |
```console |
| 56 |
$ briefcase dev -- --wiggle --test |
| 57 |
``` |
| 58 |
|
| 59 |
will run the app in normal mode, passing the `--wiggle` and `--test` flags to the app's command line. The app will *not* run in *Briefcase's* test mode; the `--test` flag will be left for your own app to interpret. |
| 60 |
|
| 61 |
## Environment variables |
| 62 |
|
| 63 |
By default, `briefcase dev` will use the following environment variables: |
| 64 |
|
| 65 |
- `PYTHONDEVMODE=1` activates additional runtime checks, e.g., [`DeprecationWarning`][] (see also [`PYTHONDEVMODE`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONDEVMODE)) |
| 66 |
- `PYTHONUNBUFFERED=1` forces the `stdout` and `stderr` streams to be unbuffered (see also the Python [`PYTHONUNBUFFERED`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUNBUFFERED)) |
| 67 |
- `PYTHONUTF8=1` forces the usage of the UTF-8 encoding (see also [`PYTHONUTF8`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUTF8)). |
| 68 |
|
| 69 |
To deactivate this behavior, you can explicitly set the environment variables to empty strings: |
| 70 |
|
| 71 |
- For one command execution on Linux or macOS: `PYTHONDEVMODE= briefcase dev` |
| 72 |
- For the current shell on Linux or macOS: `export PYTHONDEVMODE=` |
| 73 |
- For the current shell in Windows PowerShell: `$env:PYTHONDEVMODE = ""` |