-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve dev env setup & iOS compilation instructions #647
base: main
Are you sure you want to change the base?
Conversation
Please specify in comment to PR where are formatting changes , text changes and where are important changes |
- Update last tested Xcode version to `16.2`. - Update the `external` folder name to `externals`. - Restructure the Error–Solution section in Step 8. - Add short description for the Kotlin Native Xcode Plugin. - Improve grammar, formatting and phrasing.
This will allow copying them with a single click.
It's better not to change a long-standing reference.
``` | ||
|
||
Solution 5: If you've got error like this: ```Failed to configure 'qtbase-ios' for 'ios.simulator.clang.static', aborting...```. Go to folded ```core/external/qtbase-ios/``` and delete all folders starting with ```upstream```. And run `$ ./prepare.sh` again. | ||
1. Set up the **[development environment](setup-the-dev-environment.md)** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Fix grammar
- Formatting and wording changes
|
||
Solution 5: If you've got error like this: ```Failed to configure 'qtbase-ios' for 'ios.simulator.clang.static', aborting...```. Go to folded ```core/external/qtbase-ios/``` and delete all folders starting with ```upstream```. And run `$ ./prepare.sh` again. | ||
1. Set up the **[development environment](setup-the-dev-environment.md)** | ||
2. Install Xcode from the App Store (the last tested version is `16.2`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update last tested Xcode version to 16.2
.
3. Install Command Line Tools for Xcode: | ||
|
||
``` | ||
$ xcode-select --install | ||
``` | ||
Or—in case of an error—try to download and install it from Apple's website: <https://developer.apple.com/download/all/?q=xcode> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting and wording changes
``` | ||
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
$ brew install svn | ||
$ brew install cmake # tested on 3.25.2, 3.19, 3.11 | ||
|
||
# for intel | ||
$ sudo gem install cocoapods | ||
|
||
# for m1 | ||
$ brew install cocoapods | ||
``` | ||
6. Download and instal Java jdk 17 | ||
``` | ||
# for intel | ||
https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-x64_bin.dmg | ||
|
||
# for m1 | ||
https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-aarch64_bin.dmg | ||
``` | ||
|
||
7. Create new text file. Or update if it exist. | ||
``` | ||
$ mkdir ~/.gradle | ||
$ nano ~/.gradle/gradle.properties | ||
``` | ||
|
||
Paste this content into it. Save file and restart computer. | ||
|
||
``` | ||
## Project-wide Gradle settings. | ||
# | ||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
# | ||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
# Default value: -Xmx10248m -XX:MaxMetaspaceSize=256m | ||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
org.gradle.daemon=true | ||
|
||
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
# | ||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
|
||
org.gradle.parallel=true | ||
org.gradle.caching=true | ||
|
||
#Fri Apr 08 18:47:31 EEST 2016 | ||
# android.useDeprecatedNdk=true | ||
``` | ||
|
||
8. Run `prepare.sh` to compile Qt library and download external dependencies | ||
``` | ||
$ cd ios | ||
$ ./prepare.sh | ||
``` | ||
|
||
Error: `Xcode not set up properly. You may need to confirm the license...`. | ||
Solution: switch XcodeCommandLineTools to Xcode app, confirm the license and switch it back. | ||
``` | ||
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | ||
$ 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 `$ ./prepare.sh` again. | ||
|
||
Solution 3: Error: `CMake Error ... iphoneos is not an iOS SDK`. | ||
``` | ||
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | ||
``` | ||
|
||
Solution 4: If you've got error like this: ``` CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 3.21.2 or higher is required. You are running version 3.11.2 ```. Then download dmg installer from CMake web site and perfom manual instalation. And run `$ ./prepare.sh` again. | ||
``` | ||
https://cmake.org/download/ | ||
``` | ||
|
||
Solution 5: If you've got error like this: ```Failed to configure 'qtbase-ios' for 'ios.simulator.clang.static', aborting...```. Go to folded ```core/external/qtbase-ios/``` and delete all folders starting with ```upstream```. And run `$ ./prepare.sh` again. | ||
1. Set up the **[development environment](setup-the-dev-environment.md)** | ||
2. Install Xcode from the App Store (the last tested version is `16.2`) | ||
3. Install Command Line Tools for Xcode: | ||
|
||
``` | ||
$ xcode-select --install | ||
``` | ||
Or—in case of an error—try to download and install it from Apple's website: <https://developer.apple.com/download/all/?q=xcode> | ||
|
||
4. Log in to Xcode account (optional) | ||
|
||
In case you don't have an Apple Developer account. | ||
|
||
1. Open Xcode and go to _Preferences_ → _Accounts_ (via the top menu) | ||
2. Press the `+` button. You can log in with your Apple ID (login and password from your iOS/macOS devices). Follow Xcode instructions. | ||
3. _For OsmAnd team members:_ send your Apple ID login, so you will be added to the list of developers. You'll get email with an invite message—activate it. | ||
4. Close Xcode. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Break down instructions to steps
- Formatting and wording changes
3. _For OsmAnd team members:_ send your Apple ID login, so you will be added to the list of developers. You'll get email with an invite message—activate it. | ||
4. Close Xcode. | ||
|
||
5. Install command-line tools: `cmake`, `svn`, `cocoapods`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting changes
``` | ||
# for intel | ||
https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-x64_bin.dmg | ||
|
||
# for m1 | ||
https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-aarch64_bin.dmg | ||
``` | ||
|
||
7. Create new text file. Or update if it exist. | ||
``` | ||
$ mkdir ~/.gradle | ||
$ nano ~/.gradle/gradle.properties | ||
``` | ||
|
||
Paste this content into it. Save file and restart computer. | ||
|
||
``` | ||
## Project-wide Gradle settings. | ||
# | ||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
# | ||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
# Default value: -Xmx10248m -XX:MaxMetaspaceSize=256m | ||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
org.gradle.daemon=true | ||
|
||
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
# | ||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
|
||
org.gradle.parallel=true | ||
org.gradle.caching=true | ||
|
||
#Fri Apr 08 18:47:31 EEST 2016 | ||
# android.useDeprecatedNdk=true | ||
``` | ||
|
||
8. Run `prepare.sh` to compile Qt library and download external dependencies | ||
``` | ||
$ cd ios | ||
$ ./prepare.sh | ||
``` | ||
|
||
Error: `Xcode not set up properly. You may need to confirm the license...`. | ||
Solution: switch XcodeCommandLineTools to Xcode app, confirm the license and switch it back. | ||
``` | ||
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | ||
$ 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 `$ ./prepare.sh` again. | ||
|
||
Solution 3: Error: `CMake Error ... iphoneos is not an iOS SDK`. | ||
``` | ||
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | ||
``` | ||
|
||
Solution 4: If you've got error like this: ``` CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 3.21.2 or higher is required. You are running version 3.11.2 ```. Then download dmg installer from CMake web site and perfom manual instalation. And run `$ ./prepare.sh` again. | ||
``` | ||
https://cmake.org/download/ | ||
``` | ||
|
||
Solution 5: If you've got error like this: ```Failed to configure 'qtbase-ios' for 'ios.simulator.clang.static', aborting...```. Go to folded ```core/external/qtbase-ios/``` and delete all folders starting with ```upstream```. And run `$ ./prepare.sh` again. | ||
1. Set up the **[development environment](setup-the-dev-environment.md)** | ||
2. Install Xcode from the App Store (the last tested version is `16.2`) | ||
3. Install Command Line Tools for Xcode: | ||
|
||
``` | ||
$ xcode-select --install | ||
``` | ||
Or—in case of an error—try to download and install it from Apple's website: <https://developer.apple.com/download/all/?q=xcode> | ||
|
||
4. Log in to Xcode account (optional) | ||
|
||
In case you don't have an Apple Developer account. | ||
|
||
1. Open Xcode and go to _Preferences_ → _Accounts_ (via the top menu) | ||
2. Press the `+` button. You can log in with your Apple ID (login and password from your iOS/macOS devices). Follow Xcode instructions. | ||
3. _For OsmAnd team members:_ send your Apple ID login, so you will be added to the list of developers. You'll get email with an invite message—activate it. | ||
4. Close Xcode. | ||
|
||
5. Install command-line tools: `cmake`, `svn`, `cocoapods`: | ||
|
||
``` | ||
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
$ brew install svn | ||
$ brew install cmake # tested on 3.25.2, 3.19, 3.11 | ||
|
||
# for Intel | ||
$ sudo gem install cocoapods | ||
|
||
# for Apple silicon | ||
$ brew install cocoapods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct chip series' name and capitalization.
|
||
7. Create new text file. Or update if it exist. | ||
``` | ||
$ mkdir ~/.gradle | ||
$ nano ~/.gradle/gradle.properties | ||
``` | ||
|
||
Paste this content into it. Save file and restart computer. | ||
|
||
``` | ||
## Project-wide Gradle settings. | ||
# | ||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
# | ||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
# Default value: -Xmx10248m -XX:MaxMetaspaceSize=256m | ||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
org.gradle.daemon=true | ||
|
||
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
# | ||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
|
||
org.gradle.parallel=true | ||
org.gradle.caching=true | ||
|
||
#Fri Apr 08 18:47:31 EEST 2016 | ||
# android.useDeprecatedNdk=true | ||
``` | ||
|
||
8. Run `prepare.sh` to compile Qt library and download external dependencies | ||
``` | ||
$ cd ios | ||
$ ./prepare.sh | ||
``` | ||
|
||
Error: `Xcode not set up properly. You may need to confirm the license...`. | ||
Solution: switch XcodeCommandLineTools to Xcode app, confirm the license and switch it back. | ||
``` | ||
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | ||
$ 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 `$ ./prepare.sh` again. | ||
|
||
Solution 3: Error: `CMake Error ... iphoneos is not an iOS SDK`. | ||
``` | ||
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | ||
``` | ||
|
||
Solution 4: If you've got error like this: ``` CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 3.21.2 or higher is required. You are running version 3.11.2 ```. Then download dmg installer from CMake web site and perfom manual instalation. And run `$ ./prepare.sh` again. | ||
``` | ||
https://cmake.org/download/ | ||
``` | ||
|
||
Solution 5: If you've got error like this: ```Failed to configure 'qtbase-ios' for 'ios.simulator.clang.static', aborting...```. Go to folded ```core/external/qtbase-ios/``` and delete all folders starting with ```upstream```. And run `$ ./prepare.sh` again. | ||
1. Set up the **[development environment](setup-the-dev-environment.md)** | ||
2. Install Xcode from the App Store (the last tested version is `16.2`) | ||
3. Install Command Line Tools for Xcode: | ||
|
||
``` | ||
$ xcode-select --install | ||
``` | ||
Or—in case of an error—try to download and install it from Apple's website: <https://developer.apple.com/download/all/?q=xcode> | ||
|
||
4. Log in to Xcode account (optional) | ||
|
||
In case you don't have an Apple Developer account. | ||
|
||
1. Open Xcode and go to _Preferences_ → _Accounts_ (via the top menu) | ||
2. Press the `+` button. You can log in with your Apple ID (login and password from your iOS/macOS devices). Follow Xcode instructions. | ||
3. _For OsmAnd team members:_ send your Apple ID login, so you will be added to the list of developers. You'll get email with an invite message—activate it. | ||
4. Close Xcode. | ||
|
||
5. Install command-line tools: `cmake`, `svn`, `cocoapods`: | ||
|
||
``` | ||
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
$ brew install svn | ||
$ brew install cmake # tested on 3.25.2, 3.19, 3.11 | ||
|
||
# for Intel | ||
$ sudo gem install cocoapods | ||
|
||
# for Apple silicon | ||
$ brew install cocoapods | ||
``` | ||
|
||
6. Download and install Java JDK 17 | ||
|
||
- For Intel-based Macs: <https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-x64_bin.dmg> | ||
- For Apple silicon Macs: <https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-aarch64_bin.dmg> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format links in fenced code blocks as links.
- For Intel-based Macs: <https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-x64_bin.dmg> | ||
- For Apple silicon Macs: <https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-aarch64_bin.dmg> | ||
|
||
7. Create a new text file or update if it exists: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting change
|
||
``` | ||
## Project-wide Gradle settings. | ||
# | ||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
# | ||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
# Default value: -Xmx10248m -XX:MaxMetaspaceSize=256m | ||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
org.gradle.daemon=true | ||
|
||
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
# | ||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
|
||
org.gradle.parallel=true | ||
org.gradle.caching=true | ||
|
||
#Fri Apr 08 18:47:31 EEST 2016 | ||
# android.useDeprecatedNdk=true | ||
``` | ||
|
||
8. Run `prepare.sh` to compile Qt library and download external dependencies | ||
``` | ||
$ cd ios | ||
$ ./prepare.sh | ||
``` | ||
|
||
Error: `Xcode not set up properly. You may need to confirm the license...`. | ||
Solution: switch XcodeCommandLineTools to Xcode app, confirm the license and switch it back. | ||
``` | ||
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | ||
$ 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 `$ ./prepare.sh` again. | ||
|
||
Solution 3: Error: `CMake Error ... iphoneos is not an iOS SDK`. | ||
``` | ||
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | ||
``` | ||
|
||
Solution 4: If you've got error like this: ``` CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 3.21.2 or higher is required. You are running version 3.11.2 ```. Then download dmg installer from CMake web site and perfom manual instalation. And run `$ ./prepare.sh` again. | ||
``` | ||
https://cmake.org/download/ | ||
``` | ||
|
||
Solution 5: If you've got error like this: ```Failed to configure 'qtbase-ios' for 'ios.simulator.clang.static', aborting...```. Go to folded ```core/external/qtbase-ios/``` and delete all folders starting with ```upstream```. And run `$ ./prepare.sh` again. | ||
1. Set up the **[development environment](setup-the-dev-environment.md)** | ||
2. Install Xcode from the App Store (the last tested version is `16.2`) | ||
3. Install Command Line Tools for Xcode: | ||
|
||
``` | ||
$ xcode-select --install | ||
``` | ||
Or—in case of an error—try to download and install it from Apple's website: <https://developer.apple.com/download/all/?q=xcode> | ||
|
||
4. Log in to Xcode account (optional) | ||
|
||
In case you don't have an Apple Developer account. | ||
|
||
1. Open Xcode and go to _Preferences_ → _Accounts_ (via the top menu) | ||
2. Press the `+` button. You can log in with your Apple ID (login and password from your iOS/macOS devices). Follow Xcode instructions. | ||
3. _For OsmAnd team members:_ send your Apple ID login, so you will be added to the list of developers. You'll get email with an invite message—activate it. | ||
4. Close Xcode. | ||
|
||
5. Install command-line tools: `cmake`, `svn`, `cocoapods`: | ||
|
||
``` | ||
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
$ brew install svn | ||
$ brew install cmake # tested on 3.25.2, 3.19, 3.11 | ||
|
||
# for Intel | ||
$ sudo gem install cocoapods | ||
|
||
# for Apple silicon | ||
$ brew install cocoapods | ||
``` | ||
|
||
6. Download and install Java JDK 17 | ||
|
||
- For Intel-based Macs: <https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-x64_bin.dmg> | ||
- For Apple silicon Macs: <https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-aarch64_bin.dmg> | ||
|
||
7. Create a new text file or update if it exists: | ||
|
||
``` | ||
$ mkdir ~/.gradle | ||
$ nano ~/.gradle/gradle.properties | ||
``` | ||
|
||
1. Paste this content into it: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Break down instructions to steps
- Remove seemingly unnecessary empty lines
- Formatting changes
8. Run `prepare.sh` to compile the Qt library and download external dependencies: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting and wording changes
1. Open Xcode and go to _Preferences_ → _Accounts_ (via the top menu) | ||
2. Press the `+` button. You can log in with your Apple ID (login and password from your iOS/macOS devices). Follow Xcode instructions. | ||
3. _For OsmAnd team members:_ send your Apple ID login, so you will be added to the list of developers. You'll get email with an invite message—activate it. | ||
4. Close Xcode. | ||
|
||
5. Install command-line tools: `cmake`, `svn`, `cocoapods`: | ||
|
||
``` | ||
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
$ brew install svn | ||
$ brew install cmake # tested on 3.25.2, 3.19, 3.11 | ||
|
||
# for Intel | ||
$ sudo gem install cocoapods | ||
|
||
# for Apple silicon | ||
$ brew install cocoapods | ||
``` | ||
|
||
6. Download and install Java JDK 17 | ||
|
||
- For Intel-based Macs: <https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-x64_bin.dmg> | ||
- For Apple silicon Macs: <https://download.oracle.com/java/17/archive/jdk-17.0.11_macos-aarch64_bin.dmg> | ||
|
||
7. Create a new text file or update if it exists: | ||
|
||
``` | ||
$ mkdir ~/.gradle | ||
$ nano ~/.gradle/gradle.properties | ||
``` | ||
|
||
1. Paste this content into it: | ||
|
||
``` | ||
## Project-wide Gradle settings. | ||
# | ||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
# | ||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
# Default value: -Xmx10248m -XX:MaxMetaspaceSize=256m | ||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
org.gradle.daemon=true | ||
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
|
||
org.gradle.parallel=true | ||
org.gradle.caching=true | ||
|
||
#Fri Apr 08 18:47:31 EEST 2016 | ||
# android.useDeprecatedNdk=true | ||
``` | ||
|
||
2. Save the file | ||
3. Restart your computer | ||
|
||
8. Run `prepare.sh` to compile the Qt library and download external dependencies: | ||
|
||
``` | ||
$ cd ios | ||
$ ./prepare.sh | ||
``` | ||
|
||
1. **Error:** `Xcode not set up properly. You may need to confirm the license...` | ||
|
||
**Solution 1:** switch _Command Line Tools for Xcode_ to the Xcode app, confirm the license and switch it back: | ||
|
||
``` | ||
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | ||
$ 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`: open _Xcode → Preferences → Locations_ and in field _Command Line Tools_ select your command line tools _Xcode XX.X_ and run `./prepare.sh` again. | ||
|
||
2. **Error:** `CMake Error ... iphoneos is not an iOS SDK` | ||
|
||
**Solution:** Run: | ||
``` | ||
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | ||
``` | ||
|
||
3. **Error:** `CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 3.21.2 or higher is required. You are running version 3.11.2` | ||
|
||
**Solution:** Download the `.dmg` installer from the CMake website and perfom a manual installation: <https://cmake.org/download/>. Then run `./prepare.sh` again. | ||
|
||
4. **Error:** `Failed to configure 'qtbase-ios' for 'ios.simulator.clang.static', aborting...` | ||
|
||
**Solution:** Go to folder `core/externals/qtbase-ios` and delete all folders starting with `upstream`. Then run `./prepare.sh` again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Logically restructure & reformat errors and solutions
- Update
external
folder name toexternals
- Format link in fenced code blocks as link
- Further improve formatting
10. First build | ||
|
||
1. Set the build target to _OsmAnd Maps_ (near Play/Stop buttons) | ||
2. Select your device or one of iOS simulators as the target device. Don't use the default _Any iOS Device (arm64)_! | ||
3. Build the project (Play button) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Break down instructions to steps
- Improve formatting
11. In case of build errors: clean temp files | ||
|
||
- Select _Product_ → _Clean Build Folder..._ in Xcode | ||
- Close Xcode | ||
- Delete the `baked` and `binaries` folders in the `OsmAnd` directory (if they exist) | ||
- Go to folder `core/externals/qtbase-ios` and delete all folders starting with `upstream` | ||
- Delete the Xcode `DerivedData` folder: | ||
``` | ||
rm -rf ~/Library/Developer/Xcode/DerivedData | ||
``` | ||
- Check that all repositories are up to date and on correct branches | ||
- Restart your computer (yes, it can help) | ||
- Run `./prepare.sh` | ||
- Open Xcode and try to build the project again | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Update
external
folder name toexternals
- Fix typo
- Formatting and wording changes
12. **Error:** `ld: library not found for -lOsmAndCore_static_standalone` on Apple silicon Macs | ||
|
||
- Open _Project Navigator_ and click on *OsmAnd_projects* | ||
- Click on *OsmAnd_projects* under the _PROJECT_ section | ||
- Open _Build Settings_ → _All_ → _Architectures_ → _Excluded Architectures_ → _Debug_ | ||
- Add a string field of type `Any IOS Simulator SDK` with the value `arm64` (you will need to add it after each `./prepare.sh` run) | ||
- Build the project | ||
- In case of errors, follow all instructions in the previous numbered step and run `./prepare.sh` again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Restructure and clarify steps
- Correct chip series' name
- Formatting and wording changes
13. Kotlin debug addon (optional) | ||
``` | ||
$ brew install xcode-kotlin | ||
$ xcode-kotlin install | ||
$ xcode-kotlin sync | ||
``` | ||
|
||
15. Qt debug addon (optional). If you want to see Qt values in debug mode run this: | ||
``` | ||
$ mkdir -p ~/qtlldb | ||
$ git clone https://github.com/gbooker/lldb-qt-formatters ~/qtlldb | ||
$ touch ~/.lldbinit | ||
$ echo "command script import ~/qtlldb/both.py" >> ~/.lldbinit | ||
``` | ||
After set this parameters reboot your computer. | ||
|
||
Install the Kotlin Native Xcode Plugin for debugging Kotlin code. Run: | ||
|
||
``` | ||
brew install xcode-kotlin | ||
xcode-kotlin install | ||
xcode-kotlin sync | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add step description
- Remove
$
from start of lines to make them easier to copy & paste into e.g. Warp
15. Qt debug addon (optional). If you want to see Qt values in debug mode run this: | ||
``` | ||
$ mkdir -p ~/qtlldb | ||
$ git clone https://github.com/gbooker/lldb-qt-formatters ~/qtlldb | ||
$ touch ~/.lldbinit | ||
$ echo "command script import ~/qtlldb/both.py" >> ~/.lldbinit | ||
``` | ||
After set this parameters reboot your computer. | ||
|
||
Install the Kotlin Native Xcode Plugin for debugging Kotlin code. Run: | ||
|
||
``` | ||
brew install xcode-kotlin | ||
xcode-kotlin install | ||
xcode-kotlin sync | ||
``` | ||
|
||
15. Qt debug addon (optional) | ||
|
||
If you want to see Qt values in debug mode, run: | ||
|
||
``` | ||
mkdir -p ~/qtlldb | ||
git clone https://github.com/gbooker/lldb-qt-formatters ~/qtlldb | ||
touch ~/.lldbinit | ||
echo "command script import ~/qtlldb/both.py" >> ~/.lldbinit | ||
``` | ||
|
||
Then reboot your computer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Remove
$
from start of lines to make them easier to copy & paste into e.g. Warp - Formatting and wording changes
# How to Setup the Development Environment | ||
# How to Set Up the Development Environment | ||
|
||
|
||
To setup the development environment, you need to install the [repo utility](https://source.android.com/setup/develop#repo) and use the following [repo manifest](https://github.com/osmandapp/OsmAnd-manifest/blob/master/readonly.xml) or [any other configuration](https://github.com/osmandapp/OsmAnd-manifest). | ||
To set up the development environment, you need to install the [`repo` utility](https://source.android.com/setup/develop#repo) and use the following [`repo` manifest](https://github.com/osmandapp/OsmAnd-manifest/blob/master/readonly.xml) or [any other configuration](https://github.com/osmandapp/OsmAnd-manifest). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Fix grammar
- Formatting changes
You can also use just `git` and checkout the following `git` repositories to their correct folder names: | ||
* Folder `android` – **[Osmand](https://github.com/osmandapp/Osmand.git)**: | ||
``` | ||
git clone https://github.com/osmandapp/Osmand.git android | ||
``` | ||
* Folder `ios` – **[OsmAnd-ios](https://github.com/osmandapp/OsmAnd-ios.git)**: | ||
``` | ||
git clone https://github.com/osmandapp/OsmAnd-ios.git ios | ||
``` | ||
* Folder `resources` – **[OsmAnd-resources](https://github.com/osmandapp/OsmAnd-resources.git)**: | ||
``` | ||
git clone https://github.com/osmandapp/OsmAnd-resources.git resources | ||
``` | ||
* Folder `core` – **[OsmAnd-core](https://github.com/osmandapp/OsmAnd-core.git)**: | ||
``` | ||
git clone https://github.com/osmandapp/OsmAnd-core.git core | ||
``` | ||
* Folder `help` – **[osmandapp.github.io](https://github.com/osmandapp/osmandapp.github.io.git)**: | ||
``` | ||
git clone https://github.com/osmandapp/osmandapp.github.io.git help | ||
``` | ||
* Folder `core-legacy` – **[OsmAnd-core-legacy](https://github.com/osmandapp/OsmAnd-core-legacy.git)**: | ||
``` | ||
git clone https://github.com/osmandapp/OsmAnd-core-legacy.git core-legacy | ||
``` | ||
* Folder `build` – **[OsmAnd-build](https://github.com/osmandapp/OsmAnd-build.git)**: | ||
``` | ||
git clone https://github.com/osmandapp/OsmAnd-build.git build | ||
``` | ||
* Folder `tools` – **[OsmAnd-tools](https://github.com/osmandapp/OsmAnd-tools.git)** (servers, map creation): | ||
``` | ||
git clone https://github.com/osmandapp/OsmAnd-tools.git tools | ||
``` | ||
* Folder `web` – **[web](https://github.com/osmandapp/web.git)** (web-only): | ||
``` | ||
git clone https://github.com/osmandapp/web.git web | ||
``` | ||
* Folder `misc` – **[OsmAnd-misc](https://github.com/osmandapp/OsmAnd-misc.git)** (standalone utilities): | ||
``` | ||
git clone https://github.com/osmandapp/OsmAnd-misc.git misc | ||
``` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting changes
``` | ||
|
||
|
||
You might not need all repositories to get `tools`, `android` or `ios` working, just the ones described in the [`repo` configurations'](https://github.com/osmandapp/OsmAnd-manifest) XML files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Update reference
- Formatting and wording changes
@vshcherb Done! I hope this is what you meant. |
16.2
. Thanks a lot for your help with the compilation process, @vshcherb! :)external
folder name toexternals
.