iOS Simulator doesn't work with network user homes (AFP or SMB)

Originator:michalm.mac
Number:rdar://18393117 Date Originated:19.9.2014
Status:Open Resolved:
Product:Developer Tools Product Version:5.1.1, 6.0.1
Classification:Serious Bug Reproducible:Always
 
Summary:
I am preparing deployment of OS X and Xcode for our new Apple classroom.
Our infrastructure uses NFS network user home folders. I am currently testing my deployment workflow with AFP and SMB network homes (OS X Server). My testing OS X instances run inside VMware Fusion (tested with bot version 6 and new 7)

I run into serious problem with iOS Simulator which doesn't like to have its support files stored on AFP or SMB network volume (~/Library/Developer/CoreSimulator or ~/Library/Application Support/iPhone Simulator for older Xcode versions).

I am able to reproduce issue with multiple versions of OS X, OS X Server and Xcode. I also found workaround (See additional notes).

Steps to Reproduce:
1. Setup OS X Server (Open Directory Master + File Share (AFP or SMB) for user home folders)
2. Create few Local Network Users in Server.app with network homes
3. Install clean OS X Client on different Mac or VM with latest stable Xcode version 4. Bind client OS X to OpenDirectory
5. On client log in as a network user
6. Launch Xcode, create new project, store it in network home folder - f.e. ~/Desktop (iOS single view app, Obj-c, iPhone only)
7. Hit Build and run button -> iPhone app launches in iOS Simulator


Expected Results:
No problems with iOS Simulator. Ability to repeatedly test apps in simulator with no issues.

Actual Results:
NOTE: First launch of app in simulator sometimes work. Subsequent launches suffer from problem describet bellow.

RESULT:
Xcode Alert: Unable to run app in Simulator
An error was encountered while running (Domain = FBSOpenApplicationErrorDomain, Code = 4)

When I try again (Simulator still opened, black screen)
Xcode Alert: Unable to run app in Simulator
An error was encountered while running (Domain = LaunchServicesError, Code = 0)

I Quit Simulator and build & run again
-> iOS Simulator now gives me this error: 
“tmp” couldn’t be removed.

+ Xcode alert
Unable to run app in Simulator
An error was encountered while running (Domain = DTiPhoneSimulatorErrorDomain, Code = 2)

Version:
Xcode 5.1.1 stable & OS X 10.9.4 13E28 + Server 3.1.2 13S4517
Xcode 6.0.1 6A317 & OS X 10.9.4 13E28 + Server 3.1.2
Xcode 6.0.1 6A317 & OS X 10.9.5 13F34 + Server 3.1.2
Xcode 6.0.1 6A317 & OS X 10.9.5 13F34 + Server 3.2.1 13S5179

Notes:
Workaround
Create symlink in nework users home Library: ~/Library/Developer/CoreSimulator pointing to CoreSimulator folder on local hard drive f.e. -> /Users/Shared/${USER}/CoreSimulator

After applying this workaround, iOS Simulator stores its files on local HFS+ filesystem and work just fine. I have a hunch that this issue is somehow conneted to file locking.

I had same problem with Xcode 5.1.1 where its simulator used ~/Library/Application Support/iPhone Simulator folder. This http://stackoverflow.com/questions/8328767/running-ios-simulator-on-network-user-accounts pointed me into right direction.

+ I am going to test this with NFS in few weeks

Configuration:
- Client OS X 10.9 Mavericks (in my case VM in VMware Fusion 6 and 7)
- Server OS X 10.9 Mavericks with OS X Server 3 (OD + File Shares)  (VM in VMware Fusion 6 and 7)
- Xcode 5.1.1 with bundled iOS 7 Simulator or Xcode  6.0.1 with bundled iOS 8 simulator
- Logged in user has network home folder mounted via AFP or SMB protocol

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!