Harazi
Harazi

Reputation: 122

access iPhone simulator root and home directories

I need to find a path where iPhone simulator root / and home ~ directories lies. With NSFileManager I can print their contents, however I need to place some files there so that I could open them with my application in simulator.

My operating system is OS X 10.9.4 on mac-mini.

Update:

Basically what I need to access simulators file system and not the sand-boxed location that is relative to an app, and this is because I need to test my app with absolute paths. For example if that would be an sd card or just some other known location.

To emphasize what I am asking for. With this code:

    NSFileManager* fileManager = [NSFileManager defaultManager];
    NSArray* rootContent = [fileManager contentsOfDirectoryAtPath:@"/" error:nil];
    NSLog (@"ROOT dir contains:");
    for (NSString* fileName in rootContent)
        NSLog (@"%@", fileName);

I get this output:

2014-07-18 11:08:02.893 appName[34509:60b] ROOT dir contains:
2014-07-18 11:08:02.893 appName[34509:60b] .DocumentRevisions-V100
2014-07-18 11:08:02.894 appName[34509:60b] .file
2014-07-18 11:08:02.894 appName[34509:60b] .fseventsd
2014-07-18 11:08:02.894 appName[34509:60b] .hotfiles.btree
2014-07-18 11:08:02.894 appName[34509:60b] .PKInstallSandboxManager
2014-07-18 11:08:02.894 appName[34509:60b] .Spotlight-V100
2014-07-18 11:08:02.894 appName[34509:60b] .Trashes
2014-07-18 11:08:02.895 appName[34509:60b] .vol
2014-07-18 11:08:02.895 appName[34509:60b] Applications
2014-07-18 11:08:02.895 appName[34509:60b] bin
2014-07-18 11:08:02.895 appName[34509:60b] cores
2014-07-18 11:08:02.895 appName[34509:60b] dev
2014-07-18 11:08:02.895 appName[34509:60b] etc
2014-07-18 11:08:02.895 appName[34509:60b] home
2014-07-18 11:08:02.895 appName[34509:60b] Library
2014-07-18 11:08:02.896 appName[34509:60b] mach_kernel
2014-07-18 11:08:02.896 appName[34509:60b] net
2014-07-18 11:08:02.896 appName[34509:60b] Network
2014-07-18 11:08:02.896 appName[34509:60b] private
2014-07-18 11:08:02.896 appName[34509:60b] sbin
2014-07-18 11:08:02.896 appName[34509:60b] System
2014-07-18 11:08:02.896 appName[34509:60b] tmp
2014-07-18 11:08:02.897 appName[34509:60b] User Information
2014-07-18 11:08:02.897 appName[34509:60b] Users
2014-07-18 11:08:02.897 appName[34509:60b] usr
2014-07-18 11:08:02.897 appName[34509:60b] var
2014-07-18 11:08:02.897 appName[34509:60b] Volumes

So this is a root / directory content and I want to access it in my OS-X file system, if that is possible, well and if it is not possible it would be great to know if there is any other location which I could access with my application and file system with a known absolute path.

Upvotes: 0

Views: 3500

Answers (4)

MeloS
MeloS

Reputation: 7938

If you are trying to open the folder on your Mac, you can use a software named SimHolder. If you want to access these folders in your iPhone Application on iOS simulator, you can't open any folder outside your iOS app's sandbox.

Upvotes: 1

The dude
The dude

Reputation: 7924

I suggest you use an app called simpholders: http://simpholders.com/

It will place an icon in your mac menu bar that will allow you to easily access the folders of any iOS app you run on your simulator.

Upvotes: 1

Dheeraj Kumar
Dheeraj Kumar

Reputation: 441

Another easy way is this:

Open up finder From the finder menu bar (at the top) find the go option and select "Go to Folder"

Put your path - /Users/userName/Library/Application Support/iPhone Simulator - in the go to folder option.

The folder that you want opens up.

You can now pull it to your favorites in the left hand side of your finder.

Upvotes: 1

dasdom
dasdom

Reputation: 14063

On my machine all the installed applications live in:

/Users/dom/Library/Application\ Support/iPhone\ Simulator/7.1/Applications/

Upvotes: 0

Related Questions