# Building from source code

To ensure a smooth development experience, follow the steps below to set up your development environment:

## 3.1 Prerequisites:

* **Operating System:** This project is compatible with Windows, macOS, and Linux.
* **IDE (Integrated Development Environment):** We recommend using [Visual Studio](https://visualstudio.microsoft.com/) or [JetBrains Rider](https://www.jetbrains.com/rider/) as your IDE for C# development. Make sure to install the necessary extensions and plugins for a better development experience.

  If you are using [JetBrains Rider](https://www.jetbrains.com/rider/) you should install [AvaloniaRider](https://docs.avaloniaui.net/docs/reference/jetbrains-rider-ide/jetbrains-rider-setup#install-the-avalonia-plugin) plugin to be able working with axaml files using a preview.

  If you are using [Visual Studio](https://visualstudio.microsoft.com/) you should install [Avalonia for Visual Studio](https://docs.avaloniaui.net/docs/get-started/set-up-an-editor#visual-studio) plugin to be able working with axaml files using a preview.

## 3.2 .NET Installation:

* This project is built using [.NET 8.0](https://dotnet.microsoft.com/download/dotnet/8.0), the latests version of the .NET platform. We recommend installing .NET 8.0 by following the instructions provided on the official [.NET website](https://dotnet.microsoft.com/download/dotnet/8.0).

  ```bash
  # Check your current .NET version
  dotnet --version
  ```

## 3.3 Version Control:

* If you haven't already, install a version control system such as [Git](https://git-scm.com/) to track changes and collaborate with other developers.

## 3.4 Clone the Repository:

* Clone the project repository to your local machine using the following command:

  ```bash
  git clone https://github.com/asv-soft/asv-drones.git
  ```

## 3.5 Restore Dependencies:

* Navigate to the platform project directory and restore the required dependencies. There is 3 possible platform directories to build and debug our app: **Asv.Drones.Gui.Desktop**, **Asv.Drones.Gui.Android**, **Asv.Drones.Gui.iOS**. For example we will use **Asv.Drones.Gui.Desktop** platform, so you have to execute the following command:

  ```bash
  cd asv-drones/src/Asv.Drones.Gui.Desktop
  dotnet workload restore
  dotnet workload repair
  ```

## 3.6 Build and Run:

* After restore you have to build the project to ensure that everything is set up correctly, and if it's not - try to restore workloads again:

  ```bash
  dotnet build
  ```
* Run the project:

  ```bash
  dotnet run
  ```

Congratulations! Your development environment is now set up, and you are ready to start contributing to the project. If you encounter any issues during the setup process, refer to the project's documentation or reach out to the development team for assistance.

## Building for Android

To build applications for Android, additional setup is required for JDK and Android SDK installation. Follow the instructions below based on your operating system.

* Navigate to the platform project directory and restore the required dependencies:

  ```bash
  cd asv-drones/src/Asv.Drones.Gui.Android
  dotnet workload restore
  dotnet workload repair
  ```

### Windows

1. Install the .NET MAUI Check tool to verify your environment is ready for .NET MAUI development:

   ```
   dotnet tool install -g Redth.Net.Maui.Check
   maui-check
   ```
2. For Android SDK managing we recommend to install Android Studio.
3. Using Android Studio's SDK Manager, download Android 13.0 (Tiramisu) and API level 33. It's highly recommended to create an Android Virtual Device (AVD) with these settings, preferably with tablet configurations for better testing experience.
4. Build the project for Android:

   ```
   dotnet build -t:Run -f net7.0-android /p:AndroidSdkDirectory=${AndroidSdkPath}
   ```

* The `${AndroidSdkPath}` should be replaced with the actual path to your Android SDK installation.

### Linux

1. Install Android Studio to manage Android SDKs:

   ```
   sudo snap install android-studio --classic
   ```
2. Install OpenJDK 11:

   ```
   sudo apt install openjdk-11-jdk
   ```
3. Using Android Studio's SDK Manager, download Android 13.0 (Tiramisu) and API level 33. It's highly recommended to create an Android Virtual Device (AVD) with these settings, preferably with tablet configurations for better testing experience.
4. Build the project for Android:

   ```
   dotnet build -f net7.0-android /p:AndroidSdkDirectory=${AndroidSdkPath}
   ```

* The `${AndroidSdkPath}` should be replaced with the actual path to your Android SDK installation.

### macOS

1. Install Android Studio:

   ```
   brew install --cask android-studio
   ```
2. Install JDK through Homebrew or any preferred method:

   ```
   brew install openjdk
   ```
3. Using Android Studio's SDK Manager, download Android 13.0 (Tiramisu) and API level 33. It's highly recommended to create an Android Virtual Device (AVD) with these settings, preferably with tablet configurations for better testing experience.
4. Build the project for Android, specifying the Android SDK directory:

   ```
   dotnet build -f net7.0-android /p:AndroidSdkDirectory=${AndroidSdkPath}
   ```

* The `${AndroidSdkPath}` should be replaced with the actual path to your Android SDK installation.

## Additional Notes

* If you want to run application after build you should start your previously created AVD and wait until it's startup processes are complete. Then you have to execute following command:

  ```
  dotnet run -f net7.0-android /p:AndroidSdkDirectory=${AndroidSdkPath}
  ```
* The `${AndroidSdkPath}` should be replaced with the actual path to your Android SDK installation.

### Windows environment setup example

![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-1e0c7e5a16636666fc4fba08ce87d2cb94bdbcfe%2Fwindows-download-dotnet-sdk.png?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-51f4499cc48a62c11391ecfea2252fedb8fb781c%2Fwindows-install-dotnet-sdk-1.png?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-554276d6e766db78111757b9b0fb96cef0098187%2Fwindows-install-dotnet-sdk-2.png?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-ec8eacb36875ade4d17126db683e5855305fa323%2Fwindows-install-dotnet-sdk-3.png?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-3f6cd17d88541576ad572e2caabe542ba6e56fe6%2Fwindows-git-clone-asv-drones-repo.png?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-72c2adff52b7d3248a1c9fc8ada3e6c6c9600fe9%2Fwindows-asv-drones-repo-platform-select.png?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-7dcaeb60e4d7dffdf9bee6bea5ab9c46d6c8b649%2Fwindows-asv-drones-desktop-workload-restore.png?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-5e70a7fa9dc4ac662bcb02f48e55d22a9797df52%2Fwindows-asv-drones-desktop-workload-repair.png?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-d62cf11029bd69b8edcba489de5585a0161b8a85%2Fwindows-asv-drones-desktop-build.png?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-9100b46212e2c1537860c279e6da01cf0f13c407%2Fwindows-asv-drones-desktop-run.png?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-609990f07fd6b2079d5cea158d2c79c017ab201c%2Fwindows-asv-drones-desktop.png?alt=media)

### Ubuntu environment setup example

![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-e1ed65d030d657d9a56452654768518b90f7bded%2Fubuntu-apt-get-dotnet-sdk-install.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-3cf1a6c2d0c6b2965b2a8626ed1822f898b93bc1%2Fubuntu-apt-get-dotnet-sdk-install-complete.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-4b6cdff5662669b153ef1cfaa262f7e2134ab63a%2Fubuntu-apt-get-dotnet-sdk-check-version.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-38127d2903bfe2e6ea949348804071f851e1a27e%2Fubuntu-clone-asv-drones-repo.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-951f8401f796483f969a5724d284e3a990f3862f%2Fubuntu-select-asv-drones-repo-platform-to-build.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-4ef12fc5d65b5e14c2cfca37c932e6b4956fd080%2Fubuntu-asv-drones-repo-desktop-workload-restore.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-3d4b5496e166f4792bd08914961a62a6516c6409%2Fubuntu-asv-drones-repo-desktop-build.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-174ac094f99b1e0125fbe8924f2d12a805cbe3f9%2Fubuntu-asv-drones-repo-desktop.jpg?alt=media)

### macOS environment setup example

![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-e6eed3ec50db07bf11a3fee3582f829f28cc93bd%2Fmacos-dotnet-sdk-install.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-d3b374cba3a05da12ca74b1f0cf5dd4c9b0b85c9%2Fmacos-dotnet-sdk-install-complete.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-8ed2552733485f2c333df1f76d1ed3f4bf3c185b%2Fmacos-asv-drones-repo.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-9c08dc2358beb34e27164d6124ce705e9b13ac83%2Fmacos-asv-drones-repo-complete.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-328c88f99fea7c01b0c21169101e6108fd8ed9b3%2Fmacos-asv-drones-repo-desktop-workload-restore.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-23ccad0358f4e80e1d10cdb197fe6c55efa1076f%2Fmacos-asv-drones-repo-desktop-workload-restore-complete.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-96548414bcfa918900f1b4ab4f8bc420f99dffb6%2Fmacos-asv-drones-repo-desktop-build.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-fa90557c79cfe667b7d7c22a36e600736a34301f%2Fmacos-asv-drones-repo-desktop-build-complete.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-a82b8685524ad2ef4445a14f9ed415882b526a1d%2Fmacos-asv-drones-repo-desktop-run.jpg?alt=media) ![](https://1971512749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89kZVDkCsTPUIdsj8tit%2Fuploads%2Fgit-blob-a91977adc9ad0cd95c3893c207232145329fbee8%2Fmacos-asv-drones-repo-desktop.jpg?alt=media)


---

# Agent Instructions: 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://docs.asv.me/overview/installation-and-setup/building-from-source-code.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.
