> For the complete documentation index, see [llms.txt](https://tiago-s.gitbook.io/mobilert/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tiago-s.gitbook.io/mobilert/docs/tools.md).

# Tools commands

## Check code coverage

Here are the commands to generate the code coverage report:

```shell
find build_debug/* -name *.gcda | xargs rm;
pushd build_debug;
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=debug ../app;
cmake --build .;
popd;
lcov -c -i -d . --no-external --ignore-errors mismatch -o code_coverage_base.info;
./build_debug/bin/UnitTestsd;
lcov -c -d . --no-external --ignore-errors mismatch -o code_coverage_test.info;
lcov -a code_coverage_base.info -a code_coverage_test.info -o code_coverage.info;
lcov --remove code_coverage.info '*third_party*' '*build*' '*Unit_Testing*' -o code_coverage_filtered.info;
genhtml code_coverage.info -o code_coverage_report --no-branch-coverage -t MobileRT_code_coverage;
bash <(curl -s https://codecov.io/bash);
```

## Check code duplication

Here are the commands to generate the [code duplication report](https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md):

```shell
jscpd -c .jscpd.json .;
```

## Check dependency updates

Here are the commands to generate the dependency updates report in `app/report.html`:

```shell
sh gradlew dependencyUpdates -Drevision=release -DoutputFormatter=html -DoutputDir=.;
```

And the commands to generate the dependency report in `app/build/reports/project/dependencies/root.app.html`:

```shell
sh gradlew htmlDependencyReport;
```

## Cancel Workflow runs

Here are the commands to cancel the workflow runs from all branches except the master.

```shell
user=TiagoMSSantos repo=MobileRT; gh api repos/${user}/${repo}/actions/runs --paginate -q '.workflow_runs[] | select(.head_branch != "master") | "\(.id)"' | xargs -n1 -I % gh api repos/${user}/${repo}/actions/runs/%/cancel -X POST;
```

## Delete Workflow runs

Here are the commands to delete the workflow runs from all branches except the master.

```shell
user=TiagoMSSantos repo=MobileRT; gh api repos/${user}/${repo}/actions/runs --paginate -q '.workflow_runs[] | select(.head_branch != "master") | "\(.id)"' | xargs -n1 -I % gh api repos/${user}/${repo}/actions/runs/% -X DELETE;
```

## Delete local branches which are not in remote

Here are the commands to delete the git local branches that are not on the remote server.

```shell
git fetch --all --tags;
git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D;
git tag -l | xargs -I {} git tag -d {};
git fetch --all --tags;
```

## Remove all docker containers and volumes

Here are the commands to remove all docker containers and mounted volumes.

```shell
docker system df;
docker system prune --volumes --force;
docker builder prune --all --force;
docker buildx prune --all --force --verbose;
docker network prune --force;
docker volume prune --force;
docker system df;
```

## Delete cache from conan package manager

Here are the commands to delete all the cache from the conan package manager.

```shell
conan remove "*" --builds --src --system-reqs --force;
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tiago-s.gitbook.io/mobilert/docs/tools.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
