Skip to content

Building Monal

Thilo Molitor edited this page Aug 2, 2024 · 27 revisions

Software needed to build Monal:

Build steps:

  1. clone repo
git clone https://github.com/monal-im/Monal.git
cd Monal
  1. init and update submodules (localizations)
git submodule update --init --recursive
  1. build rust libs (see Setting up RUST below)
bash rust/build-rust.sh
  1. install dependencies (see below how to install cocoapods properly!!)
cd Monal
pod install --repo-update
  1. open in Xcode
open Monal.xcworkspace
  1. Add LibMonalRustSwiftBridge as a local project, if not present: In Xcode, go to File -> Add packages... -> Add local , select the rust/LibMonalRustSwiftBridge directory under Monal's source tree. Make sure that Monal is selected in Add to project and the selected target is monalxmpp and finally add the package.

  2. Build :)

Read here how to use logging with the Monal UDP Logger to debug things.

Developing without Mac

If you are interested in building Monal but don't have a Mac you can virtualize:

Direct download links to all XCode versions If you want to connect your physical iPhone to XCode inside your VM, use this (tested by Monal devs)

Alpha builds (bleeding edge)

If you want to live on the edge and use all new bleeding-edge features that just got implemented, you can use the alpha builds of Monal, too. Just sent the UDID of your device (the serial number visible via lsusb on a Linux system) to [email protected]. Once your device has been added, you can download and install the build. For each new commit to the develop branch a new build will go down the pipeline.

Please be reminded that the alpha builds obviously might be unstable, slower or come with other severe issues.

Read here how to use logging with the Monal UDP Logger to debug things.

Installing Cocoapods

You'll need to use homebrew to install cocoapods, other ways to install cocoapods may result in strange errors.

Step #1: Install Homebrew

Go to https://brew.sh/ and follow the instructions to install homebrew.
Don't forget to follow the "next steps" printed to your terminal once homebrew finishes.

Step #2: Install Cocoapods via Homebrew

In the terminal type brew install cocoapods

Setting up RUST

  1. Install rustup by running curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh as mentioned in https://www.rust-lang.org/tools/install
  2. Assuming we're in monal's source directory, run chmod +x rust/build-rust.sh to make the script executable
  3. Assuming we're in monal's source directory, run rust/build-rust.sh to build our rust lib. If the following error pops up, follow the first answer here: https://stackoverflow.com/questions/68565356/xcrun-error-sdk-iphoneos-cannot-be-located
    error: failed to get iphoneos SDK path: process exit with error: xcrun: error: SDK "iphoneos" cannot be located
    xcrun: error: SDK "iphoneos" cannot be located
    xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'