Skip to content

Latest commit

 

History

History
55 lines (46 loc) · 1.99 KB

README.md

File metadata and controls

55 lines (46 loc) · 1.99 KB

Fcitx5 iOS

Fcitx5 input method framework ported to iOS.

Build

This project is NOT managed by Xcode, but Xcode is needed for iOS SDK.

Install dependencies

brew install cmake extra-cmake-modules gettext
IOS_PLATFORM=SIMULATOR ./scripts/install-deps.sh

Apply patches

git apply --directory=fcitx5 patches/fcitx5.patch
git apply --directory=engines/libime/src/libime/core/kenlm patches/kenlm.patch
git apply --directory=engines/fcitx5-rime patches/rime.patch # if building with Rime
git clone https://github.com/google/mozc engines/fcitx5-mozc/mozc --depth=1 --recurse-submodules # if building with Mozc

Build with CMake

cmake -B build -G Xcode \
  -DURL_SCHEME=fcitx \
  -DCHINESE_ADDONS=ON \
  -DHALLELUJAH=ON \
  -DMOZC=ON \
  -DRIME=ON \
  -DIOS_PLATFORM=SIMULATOR
cmake --build build --config Debug

You can also use Cmd+Shift+B in VSCode to execute a task.

Play with simulator

xcrun simctl list devices
xcrun simctl boot UUID
open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
xcrun simctl install booted build/src/Debug-iphonesimulator/Fcitx5.app

After the first time you execute xcrun simctl install, you need to add Fcitx5 in Settings -> General -> Keyboard -> Keyboards -> Add New Keyboard.

  • Simulator is not emulator (virtual machine). Simulator file system is mapped from host filesystem. A process in simulator is a process in macOS.
  • App and input method (custom keyboard extension) are different programs. They share a directory (via App Group) in ~/Library/Developer/CoreSimulator/Devices/UUID/data/Containers/Shared/AppGroup.

Credits