FFI Bindings
Build C, C++, and Swift bindings for embedding in other languages.
For use in other languages, a small FFI crate is provided. Example C programs
can be found in the ffi/examples
directory.
C
Build the FFI library:
cd ffi
cargo build --releaseThen compile the examples with CMake:
cd ffi/examples
mkdir build && cd build
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release --parallelExample programs include afc.c, lockdownd.c, process_control.c,
heartbeat.c, connect.c, list_apps.c, and more.
C++
C++ bindings are provided in the cpp/ directory, offering smoother and safer
usage in C++ codebases. Build the examples:
cd cpp/examples
mkdir build && cd build
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release --parallelExample programs include afc.cpp, installation_proxy.cpp, screenshot.cpp,
syslog_relay.cpp, wda.cpp, and more.
Swift
Swift bindings and an XCFramework are available in the swift/ directory.
Building the XCFramework requires a Mac:
just xcframeworkThis produces swift/IDevice.xcframework, which can be dropped into an Xcode
project. A Swift Package Manager manifest (Package.swift) is also included.