/fcitx5-ios

Fcitx5 iOS edition, currently developer beta. 小企鹅输入法 iOS 开发者公测 https://t.me/fcitx5macos/16126

Primary LanguageSwiftGNU General Public License v3.0GPL-3.0

Fcitx5 iOS

Fcitx5 input method framework ported to iOS.

Build for simulator

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

Below assumes Apple Silicon. For Intel, replace all SIMULATORARM64 with SIMULATOR64.

Install dependencies

brew install cmake extra-cmake-modules gettext
./scripts/install-deps.sh SIMULATORARM64

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/SIMULATORARM64 -G Xcode \
  -DURL_SCHEME=fcitx \
  -DCHINESE_ADDONS=ON \
  -DHALLELUJAH=ON \
  -DMOZC=ON \
  -DRIME=ON \
  -DPLATFORM=SIMULATORARM64
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/SIMULATORARM64/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