File size: 953 Bytes
1e05caf
b50f2a2
 
 
 
 
 
1e05caf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
#
#  Copyright © 2025 Agora
#  This file is part of TEN Framework, an open source project.
#  Licensed under the Apache License, Version 2.0, with certain conditions.
#  Refer to the "LICENSE" file in the root directory for more information.
#
set -euo pipefail

work_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
build_dir="${work_dir}/build-ios"

mkdir -p "${build_dir}"
cd "${build_dir}"

# Step 1: Generate Xcode project for iOS device
echo "[Info] Generating Xcode project"
cmake "${work_dir}" \
  -DCMAKE_SYSTEM_NAME=iOS \
  -DCMAKE_OSX_SYSROOT="iphoneos" \
  -DCMAKE_OSX_ARCHITECTURES="arm64" \
  -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY="Apple Development" \
  -DCMAKE_OSX_DEPLOYMENT_TARGET=12.1 \
  -DCMAKE_INSTALL_RPATH="@executable_path/Frameworks" \
  -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
  -G Xcode


# Step 2: Use Xcode to open the project in build-ios directory
# Step 3: Build and run the project in Xcode IDE