The installer puts the SDK files in the user’s home directory, and the setup guide recommends using paths like
$(HOME)/Library/SDKs/ArcGIS/iOS/ in Xcode projects to find the framework’s headers and libraries. This works fine as long as one is using Xcode as a user who has installed the SDK. However, it causes problems if one wants to set up an Xcode bot to automatically build and test the app. The Xcode service that runs bots executes under the
_teamsserver user account, and by default that user’s home directory does not exist, and you can’t log in as that user to run the SDK installer. So attempts to create a bot to build the app just result in “ArcGIS.h not found” compilation errors.
After I bit of Googling and experimentation, I came up with a solution:
- Install the SDK in my user account (or another normal account), following Esri’s installer and instructions.
- Make my
chmod 755 ~/Library
- Create the
/var/teamsserverhome directory for the
sudo mkdir /var/teamsserver
- Create the
/var/teamsserver/Librarydirectory for the
sudo mkdir /var/teamsserver/Library
_teamsserveras the owner of the directories:
sudo chown -R _teamsserver:_teamsserver /var/teamsserver/
- Set permissions on the directories:
sudo chmod -R 770 /var/teamsserver/
- Create a symbolic link to the SDK installation:
sudo ln -s ~/Library/SDKs /var/teamsserver/Library/SDKs
This works. It could be argued that it would be better to set up the symbolic links in some shared location (
/usr/local, etc.) and then use a full path in the Xcode project to find them, but I prefer this solution because it doesn’t require any extra steps for developers who don’t need to set up a bot.