I am working on an iPad app that uses the ArcGIS Runtime SDK for iOS. Esri provides an easy-to-use installer and instructions for setting up the SDK so that it can be used with Xcode.
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
~/Library
directory world-readable:chmod 755 ~/Library
- Create the
/var/teamsserver
home directory for the_teamsserver
user:sudo mkdir /var/teamsserver
- Create the
/var/teamsserver/Library
directory for the_teamsserver
user:sudo mkdir /var/teamsserver/Library
- Set
_teamsserver
as 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 (/Library
, /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.