Overview
========

The FreeRDP iOS port allows users to enjoy FreeRDP features on Apple iOS devices.
The application was written to be compatible with devices running iOS 15.0 or higher. 

More documentation might be found at https://github.com/FreeRDP/FreeRDP/wiki/Compilation

Build requirements
==================

The following prerequisites are required in order to build the iOS port:

- cmake version >= 3.13
- latest Xcode installed (>= 26.0)
- installed Provisioning Profile and iOS Developer Certificate for code signing
	(not required for simulator builds)
- pre-build static OpenSSL libraries
- pre-build FFmpeg libraries for H.264 support

* cJSON for Azure logon support
* MIT or Heimdal kerberos for kerberos support

Building
========

Run the following commands in the top level FreeRDP directory:

For a real iOS device (pass your signing team):

cmake -S client/iOS -B build/ios.client.build \
  -DCMAKE_TOOLCHAIN_FILE="$PWD/cmake/ios.toolchain.cmake" \
  -DPLATFORM=OS64 \
  -DDEPLOYMENT_TARGET=15.0 \
  -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=XXXXXXXXXX \
  -G Xcode
cmake --build build/ios.client.build

For the simulator (no signing team required):

cmake -S client/iOS-B build/ios-sim.client.build \
      -DCMAKE_TOOLCHAIN_FILE="$PWD/cmake/ios.toolchain.cmake" \
      -DPLATFORM=SIMULATORARM64 \
      -DDEPLOYMENT_TARGET=15.0 \
      -G Xcode
cmake --build build/ios-sim.client.build

The Xcode project is generated under the build directory, e.g.
build/ios.client.build/ifreerdp/src/ifreerdp-build/iFreeRDP.xcodeproj - open it to
build, sign or run the app from Xcode (set the Team under Signing & Capabilities
if you did not pass FREERDP_IOS_DEVELOPMENT_TEAM).

Notes: 
     
* XCode, by default will build the application into its derived data location (usually in ~/Library/Developer/...).
If you want to specify an output directory add CONFIGURATION_BUILD_DIR=<output-path-here> to the end of above command line.

* If using XCode select the generated project, e.g. "open build/ios.client.build/ifreerdp/src/ifreerdp-build/iFreeRDP.xcodeproj".

* Use a separate build directory per platform (build/ios.client.build, build/ios-sim.client.build as shown
  above). That keeps the device and simulator CMake caches apart, so there is no
  need to delete CMakeCache.txt / CMakeFiles when switching platforms.


cmake variables
===============

CMAKE_TOOLCHAIN_FILE
* the toolchain file to use must be cmake/ios.toolchain.cmake

PLATFORM (used by the toolchain file, default "OS64")
* the platform for which to build iFreeRDP. OS64 builds for arm64 iOS devices,
  SIMULATOR64 for the x86_64 iOS Simulator and SIMULATORARM64 for the arm64
  Simulator.

DEPLOYMENT_TARGET / IOS_TARGET_SDK
* minimum iOS version to build for (15.0 in the examples above)

WITH_FFMPEG / WITH_VIDEO_FFMPEG / WITH_VIDEOTOOLBOX
* enable the FFmpeg H.264/AVC GFX

AVCODEC_LIBRARIES / AVUTIL_LIBRARIES / AVCODEC_INCLUDE_DIRS / AVUTIL_INCLUDE_DIRS
* absolute paths into the pre-built FFmpeg.framework (binary and Headers); set
  these to bypass FindFFmpeg and use the framework built by the script above

FREERDP_IOS_DEVELOPMENT_TEAM / FREERDP_IOS_CODE_SIGN_STYLE / CODE_SIGN_IDENTITY
* code signing team / style / identity for device builds
