# Installation iOS

We have 2 different methods for building for iOS:

1. Installation for an iOS Application using XCode (no Unity)\
   \- This will build an iOS app that only streams data
2. Installation for an iOS Deployed Unity App **(Unity Plugin)**\
   \- This will build a Unity AR iOS app so you can stream data while running an AR app

&#x20;Both will use the binaries we have already built for each platform and architecture. If you want to see how the binaries were built you can check out `3rdparty/build_ios_dep.sh`

To rebuild dependencies, in a git bash terminal

```
cd Sensor-Stream-Pipe/3rdparty
./buid_ios_dep.sh
```

This will download/build/install dependencies in a `tmp` directory. The result is a `*_ssp_iosdep.tar.gz` file.

{% hint style="info" %}
**Problems?! (shocker)**

Reach out on [our discord](https://discord.gg/9r2HH4xH) and we will get you going!
{% endhint %}

## Building for an iOS App (no Unity)

### 1.0 Pre-Installation Requirements

1.1 Install [Xcode](https://developer.apple.com/xcode/)

1.2 Install Xcode command line tools

```
sudo xcode-select --install
```

1.3 Install cmake

```
brew install cmake
```

1.4 Install pkg-config

```
brew install pkg-config
```

### 2.0 Download and Install SSP

2.1 FOR DEVICE - To download and make iOS

```
git clone https://github.com/moetsi/Sensor-Stream-Pipe.git
cd Sensor-Stream-Pipe
mkdir build-ios && cd build-ios
cmake -G Xcode \
    -DCMAKE_TOOLCHAIN_FILE=../3rdparty/ios.toolchain.cmake \
    -DPLATFORM=OS64 \
    ..
open ssp.xcodeproj
```

### 3.0 Use it!

Now checkout Streaming [iOS ARKit RGB-D Data](https://sensor-stream-pipe.moetsi.com/streaming-ios-arkit-rgb-d-data) to see how you can stream ARFrame data with Sensor Stream Server to Sensor Stream Client.

## Building for an iOS deployed Unity App (Unity Plugin)

### 1.0 Pre-Installation Requirements

1.1 Install [Xcode](https://developer.apple.com/xcode/)

1.2 Install Xcode command line tools

```
sudo xcode-select --install
```

1.3 Install cmake

```
brew install cmake
```

### 2.0 Download and Install SSP

2.1 To download and make iOS Device

```
git clone https://github.com/moetsi/Sensor-Stream-Pipe.git
cd Sensor-Stream-Pipe
mkdir build-ios && cd build-ios
cmake -G Xcode \
    -DCMAKE_TOOLCHAIN_FILE=../3rdparty/ios.toolchain.cmake \
    -DPLATFORM=OS64 \
    ..
cmake --build . --target unity --config Release
```

2.2 Moving the built libraries into the Unity Project

* Move the library built in build-ios/ssp\_plugin\_unity to the Assets/Plugins/iOS folder of the Unity project cloned in [this step](https://sensor-stream-pipe.moetsi.com/streaming-ios-arkit-rgb-d-data#id-3.0-setup-unity-project)

{% hint style="info" %}
If you get this issue

<https://github.com/leetal/ios-cmake/issues/52>

Run this:

`sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer`
{% endhint %}

### 3.0 Use it!

Now checkout Streaming [iOS ARKit RGB-D Data](https://sensor-stream-pipe.moetsi.com/streaming-ios-arkit-rgb-d-data) to see how you can stream ARFrame data with Sensor Stream Server to Sensor Stream Client.
