5

Is there a way to configure the iOS Simulator application directory?

I'm using Xcode 4.3 and it's currently under

/Users/<Username>/Library/Application Support/iPhone Simulator/5.1/Applications/

When I run an app in Xcode it gets copied to a sub-directory:

/Users/<Username>/Library/Application Support/iPhone Simulator/5.1/Applications/<APP-UUID>/<AppName>.app

"Documents", "Library" and "tmp" dirs are next to the the app itself. Any file access that I'm doing within my app is using this directory as root.

The reason for asking this is that I want to keep the files on an SSD that is not my startup volume. So any hard links won't work either.

I haven't looked at Xcode 4.4 or 4.5 yet, but I could use those as well.

UPDATE:

Actually soft links work:

First delete

rm -R /Users/<Username>/Library/Application Support/iPhone Simulator/5.1/Applications/

Then create the soft link

ln -s /Volumes/<YourSSDVolume>/Applications/ /Users/<Username>/Library/Application Support/iPhone Simulator/5.1/Applications/

Thanks to John.K.Doe for forcing me to try it again;)

Klaas
  • 22,394
  • 11
  • 96
  • 107
  • why won't soft-links work? you can use soft-links to link onto other volumes, so long as those volumes always end up in the same place, and you could also use a soft-link to link to someplace that you then configure whenever your SSD is attached. – john.k.doe Jul 22 '12 at 04:23
  • You are right. In my first try something went wrong. I was able to map the whole "Applications" directory. If you write an answer, I'll award you the bounty. – Klaas Jul 26 '12 at 21:37

2 Answers2

3

you can use soft-links to link onto other volumes, so long as those volumes always end up in the same place, and you could also use a soft-link to link to someplace that you then configure whenever your SSD is attached.

john.k.doe
  • 7,533
  • 2
  • 37
  • 64
0

I think you can use a parameter to launch Simulator. See this SO answer: https://stackoverflow.com/a/4894178/801466.

Community
  • 1
  • 1
Artem Oboturov
  • 4,344
  • 2
  • 30
  • 48
  • I had a look, but the link you provides gives no answer on how to change the directory. They are talking about some hidden simulator command line arguments without giving their names. – Klaas Jul 26 '12 at 21:35
  • -SimulateApplication path_to_your_app/YourFavouriteApp.app/YourFavouriteApp – Artem Oboturov Jul 27 '12 at 06:57
  • Now I get, but I was rather looking for a solution to configure the directory without having to configure too much in my Xcode project. The solution from @john.k.doe works globally for all regular Xcode iOS projects. Thanks anyway! – Klaas Jul 27 '12 at 08:53