---
# System prepended metadata

title: iOS system app build

---


# iOS system app build

- Install Xcode 13.4
    - https://developer.apple.com/xcode/resources/
    
- Install brew
```bash=
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

- iOS: swiftlint, carthage
```bash=
brew install swiftlint carthage
```

- Set up Xcode command line tools (https://stackoverflow.com/a/41536029)

    - Open **Xcode** and choose a version to point
        - Xcode -> Preferences -> Locations -> Command Line Tools -> XX.XX

- Download keyman repo
```bash=
git clone https://github.com/keymanapp/keyman.git
```

- Checkout stable-16.0 branch
```bash=
cd keyman
git checkout stable-16.0
```

- Carthage bootstrap
```bash=
cd ios
carthage bootstrap --platform iOS --new-resolver --use-xcframeworks
```

- Carthage update
```bash=
cd ios
carthage update --platform iOS --new-resolver --use-xcframeworks --no-use-binaries
```

- Install `nodejs jq python pyenv openjdk@8`
```bash=
brew install node jq python3 pyenv openjdk@8
```

- Configure pyenv
```bash=
pyenv install 2.7.18
pyenv global 2.7.18
echo 'eval "$(pyenv init --path)"' >> ~/.zshrc
```

- Configure JDK vars
```bash=
echo 'export PATH="/usr/local/opt/openjdk@8/bin:$PATH"' >> ~/.zshrc
# export CPPFLAGS="-I/usr/local/opt/openjdk@8/include"
```

- Replace keyboard `*.kmp` file
    - Open `keyman/ios/samples/KMSample2/KMSample2.xcodeproj`
    - Replace `ekwtamil99uni.kmp` by `chechen_latin.kmp` (from [here](https://keyman.com/keyboards/chechen_latin?bcp47=ce-latn)) in `keyboards` folder at right side panel
    - Edit `ViewController` to add the keyboard:
    ```bash=
    let kmpFileURL = Bundle.main.url(forResource: "chechen_latin", withExtension: "kmp")!
    let keyboardID = FullKeyboardID(keyboardID: "chechen_latin", languageID: "ce-latn")
    ```

- Build KeymanEngine
```bash=
cd keyman/ios/samples/KMSample2/
./build.sh
```

- Return to XCode and run app in Simulator


## Alternative tips
- Modify `build.sh`
```bash=
#!/bin/sh
TARGET=KMSample2
source ../build_common.sh "$@"
```

- Run Build with argumets
```bash=
./build.sh -lib-ignore -no-codesign
```