### Create Debian VM Disk and Install Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/docs/BUILD_OS_IMAGE.md Creates a qcow2 disk image and starts a QEMU VM to install Debian using a downloaded ISO. ```bash wget -O debian.iso https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.5.0-amd64-netinst.iso qemu-img create -f qcow2 ./debian.qcow2 5G qemu-system-x86_64 -cpu host -accel kvm -m 8192 -smp 8 -cdrom debian.iso -drive file=./debian.qcow2 ``` -------------------------------- ### Create Windows 10 VM Disk and Install Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/docs/BUILD_OS_IMAGE.md Creates a qcow2 disk image for Windows 10 and starts a QEMU VM for installation. ```bash mkdir -p os-images qemu-img create -f qcow2 ./os-images/windows10.qcow2 32G qemu-system-x86_64 -cpu host -accel kvm -m 4096 -smp 2 -cdrom -drive file=./os-images/windows10.qcow2 ``` -------------------------------- ### Setup Rust for iOS Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ios/BuildInstructions.md Installs Rust and the necessary iOS targets for building the application. This script ensures the correct Rust toolchain is configured. ```bash ./scripts/setup-rust ios ``` -------------------------------- ### Install Build Prerequisites Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.macos.md Install essential packages like protobuf, GCC, OpenJDK, and Rustup. ```bash brew install protobuf gcc openjdk@21 rustup-init python3 ``` -------------------------------- ### Navigate to Desktop Directory Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Change the current directory to the 'desktop' folder. This is the first step before installing dependencies or starting the app. ```bash cd desktop ``` -------------------------------- ### Install Go 1.21 Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ios/BuildInstructions.md Installs Go version 1.21 using Homebrew. Ensure Go is available in your PATH after installation. ```bash brew install go@1.21 ``` -------------------------------- ### Install Release Dependencies on Linux (Debian/Ubuntu) Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/scripts/release/README.md Installs `sequoia-pgp`, `sequoia-pgp-verify`, and `GitHub CLI` using apt. ```bash sudo apt install sq sqv gh ``` -------------------------------- ### Install JavaScript Dependencies Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Install all necessary JavaScript dependencies for the project. This command should be run from the 'desktop' directory. ```bash npm run install ``` -------------------------------- ### Install Protobuf Compiler Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ios/BuildInstructions.md Installs the protobuf compiler using Homebrew, which is required for building certain Rust dependencies. ```bash brew install protobuf ``` -------------------------------- ### Install Rust Toolchain and Components Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Installs the latest stable Rust toolchain and default targets/components for the specified platform. ```bash ./scripts/setup-rust android|ios|windows|linux|macos ``` -------------------------------- ### Download and Install Android SDK, NDK, and Build Tools Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.md Downloads the latest command-line tools for Android, sets up the SDK and NDK, and installs specific platform and build tools. Ensure ANDROID_HOME is set correctly. ```bash cd /opt/android # Or some other directory to place the Android SDK export ANDROID_HOME=$PWD wget https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip mkdir -p cmdline-tools unzip commandlinetools-linux-13114758_latest.zip -d cmdline-tools-latest mv cmdline-tools-latest/cmdline-tools cmdline-tools/latest && rm -d cmdline-tools-latest ./cmdline-tools/latest/bin/sdkmanager "platforms;android-36" "build-tools;36.0.0" "platform-tools" "ndk;27.3.13750724" ``` -------------------------------- ### Complete Configuration Example Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/test-manager/docs/config.md A comprehensive configuration including test location settings and definitions for both a Debian 12 and a Windows 11 VM. ```json { "test_locations": [ { "test_wireguard_over_shadowsocks": ["se-got"] }, { "test_multihop": ["se-got"] }, { "test_quantum_resistant_tunnel": ["se-got"] }, { "test_quantum_resistant_multihop_udp2tcp_tunnel": ["se-got"] }, { "test_quantum_resistant_multihop_shadowsocks_tunnel": ["se-got"] }, { "test_ui_tunnel_settings": ["se-got"] }, { "*": ["se", "no", "fi", "dk"] } ], "mullvad_host": "stagemole.eu", "vms": { "debian12": { "vm_type": "qemu", "image_path": "$VM_IMAGES/debian12.qcow2", "os_type": "linux", "package_type": "deb", "architecture": "x64", "provisioner": "ssh", "ssh_user": "test", "ssh_password": "test", "disks": [], "artifacts_dir": "/opt/testing", "tpm": false }, "windows11": { "vm_type": "qemu", "image_path": "$VM_IMAGES/windows11.qcow2", "os_type": "windows", "package_type": null, "architecture": "x64", "provisioner": "noop", "ssh_user": null, "ssh_password": null, "disks": ["$TESTRUNNER_IMAGES/windows-test-runner.img"], "artifacts_dir": "E:\\", "tpm": false } } } ``` -------------------------------- ### Start VM with QEMU Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/docs/BUILD_OS_IMAGE.md Launches a QEMU virtual machine with specified resources and a Windows 10 qcow2 image. Ensure the image path is correct. ```bash qemu-system-x86_64 -cpu host -accel kvm -m 4096 -smp 2 -drive file="./os-images/windows10.qcow2" ``` -------------------------------- ### Install Packer using Homebrew Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ci/ios/create-vm/README.md Installs HashiCorp Packer using Homebrew, including tapping the necessary repository. ```bash brew tap hashicorp/tap brew install hashicorp/tap/packer ``` -------------------------------- ### Minimal Configuration Example Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/test-manager/docs/config.md A basic configuration that is valid but does not include any virtual machine definitions. ```json { "mullvad_host": "stagemole.eu", "vms": {} } ``` -------------------------------- ### Install yeetd Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ios/MullvadVPNUITests/README.md Installs the yeetd tool, which may be required for certain testing or build processes. Download the package and install it using the installer. ```shell wget https://github.com/biscuitehh/yeetd/releases/download/1.0/yeetd-normal.pkg sudo installer -pkg yeetd-normal.pkg -target yeetd ``` -------------------------------- ### Initialize Rustup Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.macos.md Complete the Rust toolchain installation using rustup-init. ```bash rustup-init ``` -------------------------------- ### Install Tart using Homebrew Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ci/ios/create-vm/README.md Installs the Tart VM management tool using the Homebrew package manager. ```bash brew install cirruslabs/cli/tart ``` -------------------------------- ### Build Mullvad VPN App Installers Source: https://github.com/mullvad/mullvadvpn-app/blob/main/README.md Perform sanity checks on the working directory state and then build installers for the Mullvad VPN app. ```bash ./build.sh ``` -------------------------------- ### Build the Mullvad App with Optimizations Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Use this script to build the entire Mullvad app and generate an installer. Add the --optimize flag for a smaller installer and binaries, though it will increase build time. ```bash ./build.sh [--optimize] ``` -------------------------------- ### Install Linux Testing Tools (Debian/Ubuntu) Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/README.md Installs essential tools and libraries for running tests on Debian/Ubuntu Linux guests, including QEMU, networking utilities, and rootless containers. ```bash apt install qemu-utils qemu-system-x86 libpcap-dev slirp4netns rootlesskit dnsmasq nftables ``` -------------------------------- ### Install Release Dependencies on MacOS Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/scripts/release/README.md Installs `sequoia-pgp`, `sequoia-pgp-verify`, and `GitHub CLI` using Homebrew. ```bash brew install sequoia-sq sequoia-sqv gh ``` -------------------------------- ### Install Development Dependencies on Fedora/RHEL Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Installs necessary development packages for building the daemon and installer on Fedora/RHEL systems. ```bash # For building the daemon sudo dnf install gcc dbus-devel # For building the installer sudo dnf install rpm-build ``` -------------------------------- ### Install Android SDK Tools Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.macos.md Install necessary Android SDK components including platforms, build tools, platform tools, and NDK. ```bash ~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-36" "build-tools;36.0.0" "platform-tools" "ndk;27.3.13750724" ``` -------------------------------- ### Install Volta on macOS Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Installs Volta, a JavaScript toolchain manager, using Homebrew on macOS. ```bash brew install volta && volta setup ``` -------------------------------- ### Install Android Studio via Homebrew Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.macos.md Install Android Studio using Homebrew if it's not already present on your system. ```bash brew install --cask android-studio ``` -------------------------------- ### Example VM Shared Folder and Variables Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ci/ios/create-vm/README.md Shows the expected content of the VM shared folder and the format for the Packer variables file. ```bash % ls vm_shared_folder Xcode_15.0.1.xip ``` ```hcl xcode_version = "15.1" xcode_xip_name = "Xcode_15.1.xip" ``` -------------------------------- ### Install Development Dependencies on Debian/Ubuntu Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Installs necessary development packages for building the daemon and installer on Debian/Ubuntu systems. ```bash # For building the daemon sudo apt install gcc libdbus-1-dev # For building the installer sudo apt install rpm ``` -------------------------------- ### Launch Windows 11 VM with TPM and UEFI Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/docs/BUILD_OS_IMAGE.md Launches a QEMU VM for Windows 11 installation, configuring TPM, UEFI, and secure boot. ```bash qemu-system-x86_64 -cpu host -accel kvm -m 4096 -smp 2 -cdrom -drive file=./os-images/windows11.qcow2 \ -tpmdev emulator,id=tpm0,chardev=chrtpm -chardev socket,id=chrtpm,path=".tpm/tpmsock" -device tpm-tis,tpmdev=tpm0 \ -global driver=cfi.pflash01,property=secure,value=on \ -drive if=pflash,format=raw,unit=0,file=/usr/share/OVMF/OVMF_CODE.secboot.fd,readonly=on \ -drive if=pflash,format=raw,unit=1,file=./OVMF_VARS.secboot.fd \ -machine q35,smm=on ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/mullvad/mullvadvpn-app/blob/main/desktop/packages/mullvad-vpn/scripts/README.md Installs Python dependencies from a requirements file. Ensure pip3 is available. ```bash pip3 install -r requirements.txt ``` -------------------------------- ### Install ios-deploy and jq Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ios/MullvadVPNUITests/README.md Installs `ios-deploy` for deploying applications to iOS devices and `jq` for processing JSON data, both commonly used in mobile development workflows. ```shell brew install ios-deploy jq ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ios/MullvadVPNUITests/README.md Installs the necessary command line tools for Xcode development. This is a prerequisite for many other development tasks. ```shell xcode-select --install ``` -------------------------------- ### Install Shellcheck using Homebrew Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ci/ios/create-vm/README.md Installs the Shellcheck static analysis tool for shell scripts using Homebrew. ```bash brew install shellcheck ``` -------------------------------- ### Install Node.js Dependencies Source: https://github.com/mullvad/mullvadvpn-app/blob/main/desktop/packages/mullvad-vpn/locales/README.md Installs the necessary JavaScript dependencies for managing translations. Run this command from the 'mullvad-vpn' node workspace. ```bash npm i -w packages/mullvad-vpn/ ``` -------------------------------- ### Install JDK and Dependencies on Debian/Ubuntu Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.md Installs the necessary Java Development Kit (OpenJDK 21) and zip utility required for building on Debian-based systems. ```bash sudo apt install zip openjdk-21-jdk ``` -------------------------------- ### Install Linux Testing Tools (Fedora) Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/README.md Installs essential tools and libraries for running tests on Fedora Linux guests, including build tools, containerization, and networking utilities. ```bash dnf install git gcc protobuf-devel libpcap-devel qemu \n podman golang-github-rootless-containers-rootlesskit slirp4netns dnsmasq \n dbus-devel pkgconf-pkg-config swtpm edk2-ovmf \n wireguard-tools ``` -------------------------------- ### Install Git Hook for Rust Toolchain Management Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Installs a git post-checkout hook to automatically run the setup-rust script when the Rust version changes. ```bash .scripts/setup-rust install-hook ``` -------------------------------- ### Install Android Rust Targets Script Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.md Execute the setup-rust script to install the necessary Rust targets for Android development. This script is typically found in the project's scripts directory. ```bash ./scripts/setup-rust android ``` -------------------------------- ### Install macOS Development Tools Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/README.md Installs necessary tools for macOS development, including Tart for VM management, wireguard-tools, protobuf compiler, and OpenSSL. ```bash brew install cirruslabs/cli/tart wireguard-tools pkg-config openssl protobuf ``` -------------------------------- ### NixOS Router Configuration Example Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ci/ios/test-router/README.md Example of a NixOS configuration for a router, including network settings and WireGuard parameters. This is used when creating a new NixOS configuration entry in 'flake.nix'. ```nix nixosConfigurations.app-team-ios-lab-iso = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ (import ./router-config.nix { ssid = "app-team-ios-tests"; lanMac = "48:21:0b:36:bb:52"; wanMac = "48:21:0b:36:43:a3"; lanIp = "192.168.105.1/24"; wgIpv4 = "10.64.9.184/32"; wgIpv6 = "fc00:bbbb:bbbb:bb01::a40:9b8/128"; }) "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" { isoImage.squashfsCompression = "lz4"; } ]; }; ``` -------------------------------- ### Install Mullvad Daemon on Fedora for RISC-V Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Install the Mullvad VPN daemon package on Fedora systems for RISC-V architecture. ```bash sudo dnf install dist/mullvad-vpn-daemon__riscv64.rpm ``` -------------------------------- ### Install Xcode on VM Image with Packer Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ci/ios/create-vm/README.md Runs a Packer build specifically to install Xcode dependencies onto an existing VM image. ```bash packer build -var-file="variables.pkrvars.hcl" install-build-dependencies.pkr.hcl ``` -------------------------------- ### E2E Test Properties Setup Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/TestSuite.md Configure essential properties in `~/.gradle/properties.gradle` to run end-to-end tests against different backends and services. ```bash # For running the e2e tests on the production backend mullvad.test.e2e.prod.accountNumber.valid=INSERT_VALID_ACCOUNT_NUMBER_HERE mullvad.test.e2e.prod.accountNumber.invalid=1111222233334444 # For running the e2e tests on the stagemole backend mullvad.test.e2e.stagemole.partnerAuth=INSERT_PARTNER_AUTH_TOKEN_HERE mullvad.test.e2e.stagemole.accountNumber.invalid=1111222233334444 # For running e2e tests that require the RAAS router # (see: mullvadvpn-app/ci/ios/test-router) mullvad.test.e2e.config.raas.host=INSERT_RAAS_HOST_HERE mullvad.test.e2e.config.raas.enable=true ``` -------------------------------- ### Install Homebrew and Dependencies Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ios/MullvadVPNUITests/README.md Installs Homebrew, the package manager for macOS, and essential dependencies like `xcbeautify`, `wget`, and `protobuf` for building and testing iOS applications. ```shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install xcbeautify wget protobuf ``` -------------------------------- ### Example of using Page abstraction in UI Automator tests Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/TestSuite.md Demonstrates how to use the `Page` class abstraction for creating UI Automator tests, including launching the app, logging in, interacting with page elements, and handling system dialogs. ```kotlin import org.junit.Test class ConnectPage : Page() { // ... page elements and methods fun clickConnect() { /* ... */ } fun waitForConnectedLabel() { /* ... */ } } class LoginPage : Page() { // ... page elements and methods fun enterUsername(username: String) { /* ... */ } fun enterPassword(password: String) { /* ... */ } fun clickLogin() { /* ... */ } } // Assuming AccountTestRule and Device are available // Assuming app is an instance of AppLauncher @Test fun testConnect() { // Given app.launchAndLogIn(accountTestRule.validAccountNumber) on { clickConnect() } device.acceptVpnPermissionDialog() on { waitForConnectedLabel() } } ``` -------------------------------- ### Run E2E Tests Locally with ADB Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/test/e2e/README.md Install and run end-to-end tests using ADB. This method requires manual APK installation and provides a way to pass test parameters directly to the test runner. ```bash adb shell 'CLASSPATH=$(pm path androidx.test.services) app_process / \ androidx.test.services.shellexecutor.ShellMain am instrument -w \ -e clearPackageData true \ -e mullvad.test.e2e.prod.accountNumber.valid XXXX \ -e mullvad.test.e2e.prod.accountNumber.invalid XXXX \ -e targetInstrumentation net.mullvad.mullvadvpn.test.e2e/androidx.test.runner.AndroidJUnitRunner \ androidx.test.orchestrator/.AndroidTestOrchestrator' ``` -------------------------------- ### Enable sshd Service Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/docs/BUILD_OS_IMAGE.md Ensures that the SSH daemon service is enabled to start on boot. ```bash systemctl enable sshd.service ``` -------------------------------- ### Install Rust and iOS Targets Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ios/MullvadVPNUITests/README.md Installs Rust via `rustup` and adds necessary targets for iOS development (`aarch64-apple-ios` and `aarch64-apple-ios-sim`). This enables cross-compilation for iOS devices and simulators. ```shell curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup target install aarch64-apple-ios aarch64-apple-ios-sim ``` -------------------------------- ### Install Dependencies for Cross-Compiling RISC-V on Debian/Ubuntu AMD64 Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Install necessary dependencies, including the RISC-V architecture and GCC toolchain, for cross-compiling the Mullvad VPN daemon on Debian/Ubuntu AMD64 systems. ```bash # As root dpkg --add-architecture riscv64 && \ apt update && \ apt install libdbus-1-dev:riscv64 gcc-riscv64-linux-gnu ``` -------------------------------- ### Install Ruby via RVM Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ios/MullvadVPNUITests/README.md Installs Ruby using the Ruby Version Manager (RVM). RVM allows managing multiple Ruby environments, which can be useful for projects with specific Ruby version requirements. ```shell curl -sSL https://get.rvm.io | bash ``` -------------------------------- ### Develop Mullvad VPN App Source: https://github.com/mullvad/mullvadvpn-app/blob/main/README.md Run the develop command to start the app with live-reload enabled for rapid development cycles. ```bash $ npm run develop ``` -------------------------------- ### Run Translations Converter Tool Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/translations-converter/README.md Execute this command to run the translations converter tool. Requires Rust and Cargo to be installed. ```bash cargo run ``` -------------------------------- ### Run Sequential E2E Tests Source: https://github.com/mullvad/mullvadvpn-app/blob/main/desktop/packages/mullvad-vpn/README.md Execute end-to-end tests sequentially against the installed app. Specify the test path to run specific test suites. ```bash npm run e2e:sequential installed/ ``` -------------------------------- ### Basic Listbox with Accordion Functionality Source: https://github.com/mullvad/mullvadvpn-app/blob/main/desktop/packages/mullvad-vpn/src/renderer/lib/components/listbox/README.md Demonstrates how to implement a Listbox with selectable options, managing the selected value using React's useState hook. This example shows a typical setup for a dropdown or selection menu. ```tsx export function Accordion() { const [value, setValue] = React.useState('value 1'); return ( Values Option 1 Option 2 ); } ``` -------------------------------- ### Clone Mullvad VPN App Repository Source: https://github.com/mullvad/mullvadvpn-app/blob/main/README.md Clone the main repository and initialize one level of submodules. This is the recommended way to get the source code unless you need all submodule sources. ```bash git clone https://github.com/mullvad/mullvadvpn-app.git cd mullvadvpn-app git submodule update --init ``` -------------------------------- ### Set up build user permissions Source: https://github.com/mullvad/mullvadvpn-app/blob/main/building/README.md When using `sudo` to switch to a `build` account, set tty permissions to allow Podman to prompt for GPG key passphrases. ```bash realuser@server $ sudo chown build:build $(tty) realuser@server $ sudo -u build -i ``` -------------------------------- ### Install Fastlane Dependencies Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ci/ios/upload-vm/README.md Invoke this command to install the necessary Fastlane dependencies specified in the Gemfile. ```bash bundle install ``` -------------------------------- ### Run Full Release Build with Container Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.md Execute this command for a full release build after configuring a signing key. The script handles building the app for release distribution. ```bash ../building/containerized-build.sh android fullRelease ``` -------------------------------- ### Build App via Command Line Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.macos.md Assemble all native libraries and the application using Gradle from the `android/` directory. ```bash ./gradlew debug ``` -------------------------------- ### Install Mullvad Daemon on Debian/Ubuntu for RISC-V Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Install the Mullvad VPN daemon package on Debian or Ubuntu systems for RISC-V architecture. ```bash sudo dpkg -i dist/mullvad-vpn-daemon__riscv64.deb ``` -------------------------------- ### Build and Publish Container Image Source: https://github.com/mullvad/mullvadvpn-app/blob/main/desktop/packages/management-interface/README.md Run this script on the build server to build and publish the container image. Ensure you are in the correct directory before execution. ```bash cd desktop/packages/management-interface bash building/build-and-publish-container-image.sh ``` -------------------------------- ### Configure LLDB Startup Commands for Rust Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/DebugInstructions.md Import LLDB Python scripts and source command files to enhance the debugging experience for Rust types like String. Replace SYSROOT_PATH with your actual rustc sysroot path. ```bash command script import SYSROOT_PATH/lib/rustlib/etc/lldb_lookup.py command source SYSROOT_PATH/lib/rustlib/etc/lldb_commands ``` -------------------------------- ### Enter Nix Development Shell Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Enters the Nix development shell environment, which provides all necessary tools and dependencies for building the application. ```bash nix develop ``` -------------------------------- ### Install Ruby Gems for Fastlane Source: https://github.com/mullvad/mullvadvpn-app/blob/main/ios/README.md Navigate to the ios directory and install the necessary third-party Ruby gems required for Fastlane tools, including screenshot automation. ```shell cd ios bundle install ``` -------------------------------- ### Configure Podman for sigstore fetching Source: https://github.com/mullvad/mullvadvpn-app/blob/main/building/README.md Configure Podman to fetch image signatures from the in-repo sigstore directory. ```yaml docker: ghcr.io/mullvad: sigstore: file://${repo}/building/sigstore ``` -------------------------------- ### Pack Mullvad VPN App for Distribution Source: https://github.com/mullvad/mullvadvpn-app/blob/main/README.md Use the pack command to prepare the app for distribution. Replace with the target operating system (linux, mac, or win). ```bash $ npm run pack: ``` -------------------------------- ### Install GNU sed on macOS Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/README.md If you encounter issues with 'sed' on macOS when running 'scripts/tidy.sh', install the GNU version of 'sed' using Homebrew and set it as the default. ```bash brew install gnu-sed ``` -------------------------------- ### Configure Linux Test Environment Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/README.md Sets up a Linux test environment using the test-manager. Assumes the OS image has a test runner service and configures SSH for provisioning. ```bash # Create or edit configuration # The image is assumed to contain a test runner service set up as described in ./docs/BUILD_OS_IMAGE.md cargo run --bin test-manager set debian11 qemu ./os-images/debian11.qcow2 linux \ --package-type deb --architecture x64 \ --provisioner ssh --ssh-user test --ssh-password test # Try it out to see if it works - you should reach the VM's graphical desktop environment cargo run --bin test-manager run-vm debian11 ``` -------------------------------- ### Build App with Container Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.md Execute this command to build the Android app using the provided build container. This ensures a consistent and reproducible build environment. ```bash ../building/containerized-build.sh android assembleOssProdRelease ``` -------------------------------- ### Prepare Alpha Release Script Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.md Run the prepare-release.sh script to automate the process of creating an alpha release. Provide the desired alpha version as an argument. ```bash # Replace `202X.X-alphaX` with the alpha version you intend to create. ./scripts/prepare-release.sh 202X.X-alphaX ``` -------------------------------- ### Generate Signing Key and Keystore Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/docs/BuildInstructions.md Use the keytool command to generate a new Java keystore for signing release builds. Remember to securely store the keystore file and its passwords. ```bash keytool -genkey -v -keystore app-keys.jks -alias release -keyalg RSA -keysize 4096 -validity 10000 ``` -------------------------------- ### Create Windows 11 VM Disk Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/docs/BUILD_OS_IMAGE.md Creates a qcow2 disk image for Windows 11 with at least 64GB of space. ```bash mkdir -p os-images qemu-img create -f qcow2 ./os-images/windows11.qcow2 64G ``` -------------------------------- ### Build Android App with Containerized Build Source: https://github.com/mullvad/mullvadvpn-app/blob/main/android/README.md Use this command to build the Android project via a containerized environment. Requires podman. ```bash ../building/containerized-build.sh android ``` -------------------------------- ### Build Test Runner for Linux Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/README.md Builds the test runner binary for Linux using a containerized script, recommended with Podman. ```bash ./scripts/container-run.sh ./scripts/build-scripts/test-runner.sh linux ``` -------------------------------- ### Build nseventforwarder (Debug) Source: https://github.com/mullvad/mullvadvpn-app/blob/main/desktop/packages/nseventforwarder/README.md Run this command to build nseventforwarder in debug mode. Ensure you have a supported version of Node and Rust installed. ```sh $ npm run build-debug ``` -------------------------------- ### Build and publish container image Source: https://github.com/mullvad/mullvadvpn-app/blob/main/building/README.md Build a new container image, push it to the registry, sign it, and commit the signatures to git. This script can build for Linux or Android. ```bash # Builds a new container image, pushes it to the registry, signs it and commits the signatures in git ./build-and-publish-container-image.sh (linux|android) ``` ```bash # Pushes the new sigstore entry GIT_SSH_COMMAND="ssh -i ~/.ssh/id_ed25519-mullvadvpn-app-deploy" git push ``` -------------------------------- ### Build Standalone Test Executable Source: https://github.com/mullvad/mullvadvpn-app/blob/main/desktop/packages/mullvad-vpn/README.md Compile the end-to-end tests into a standalone executable. This artifact can be run on any machine with the Mullvad VPN app installed. ```bash npm run build-test-executable ``` -------------------------------- ### Release Network in Windows Command Prompt Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/docs/BUILD_OS_IMAGE.md Releases the IP address in a Windows command prompt, useful for bypassing network requirements during setup. ```cmd ipconfig /release ``` -------------------------------- ### Configure macOS Test Environment Source: https://github.com/mullvad/mullvadvpn-app/blob/main/test/README.md Sets up a macOS test environment using the test-manager and Tart. It clones a base VM image and configures SSH for deploying the test runner. ```bash # Download some VM image tart clone ghcr.io/cirruslabs/macos-ventura-base:latest ventura-base # Create or edit configuration # Use SSH to deploy the test runner since the image doesn't contain a runner cargo run --bin test-manager set macos-ventura tart ventura-base macos \ --architecture aarch64 \ --provisioner ssh --ssh-user admin --ssh-password admin # Try it out to see if it works cargo run -p test-manager run-vm macos-ventura ``` -------------------------------- ### Build and Package Mullvad Daemon for RISC-V Source: https://github.com/mullvad/mullvadvpn-app/blob/main/BuildInstructions.md Build and package the Mullvad VPN daemon and CLI for RISC-V systems, including RVA22 and RVA23 profiles. Use --daemon-only and --optimize for this purpose. ```bash ./build.sh --daemon-only --optimize ```