How to Compile the iOS Version

  1. First setup the development environment, see How to Setup the Development Environment.

  2. Install XCode from AppStore (Last tested 12.4)

  3. Install XCode command-line tools

    $ xcode-select --install

    Or in case of errors try to download and install it from Apple site:
  4. Log in into XCode account In case if you don't have Apple Developer account. Open XCode and go to preferences (via top menu)

    Preferences -> Accounts 

    Press + button. You can log in with your AppleID (login and password from your iOS/macOS devices). Follow XCode instructions. For OsmAnd team members: send your AppleID login, so you will be added to to developers list. When you'll get email with invite message activate it. Close XCode.

  5. Install command-line tools- cmake, svn, cocoapods

    $ /bin/bash -c "$(curl -fsSL"
    $ brew install svn
    $ sudo gem install cocoapods
    $ brew install cmake # tested on 3.19, 3.11
  6. Patch system header files (to avoid duplicates with macros)

    $ CLANG_VERSION=$(ls /Applications/
    $ echo $CLANG_VERSION
    $ sudo nano /Applications/{CLANG_VERSION}/include/ia32intrin.h

    Comment out __bsfd, __bsrd lines and save file.

    // #define _bit_scan_forward(A) __bsfd((A))
    // #define _bit_scan_reverse(A) __bsrd((A))
  7. Run to compile QT library and download external dependencies

    $ cd ios
    $ ./

    Error: Xcode not set up properly. You may need to confirm the license.... Solution: switch XCodeCommandLineTools to XCode app, confirm the license and swith it back.

    $ sudo xcode-select -s /Applications/
    $ sudo xcodebuild -license accept
    $ sudo xcode-select --switch /Library/Developer/CommandLineTools

    Solution 2: check if xcrun is available: /usr/bin/xcrun -find xcrun. If you've got: xcrun: error: unable to find utility "xcrun", not a developer tool or in PATH. Then open Xcode > Preferences > Locations and in field "Command Line Tools" select your command line tools "Xcode XX.X" And run $ ./ again.

  8. Open osmand.xcworkspace in XCode

  9. First build. Set the build target to OsmAnd Maps. (Near play/stop buttons). Selet as target your device or as one of IOS simulators. But don't use default 'Any IOS Device (arm64)'. Build the project (play button).

  10. Troubleshooting.

  • In case of build erros you can press in XCode: Product -> Clean build folder
  • Close XCode. Delete baked and binaries folders in OsmAnd directory (if it already exists).
  • Delete XCode DerivedData folder: sudo rm -R ~/Library/Developer/Xcode/DerivedData/*
  • Check that all repositories are up to date and on correct branches.
  • Restart your computer. (Yes, it can help).
  • Then run $ ./ and try to build the project again.

Did this doc help you?

Privacy policy

Help us make these docs great!

All OsmAnd docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.