Where does the iPhone simulator save the sqllite database
Asked Answered
D

6

6

I have seen this question asked a few times on SO - but the answer always seems to be roughly the same:

 /Users/myName/Library/Application Support/iPhone Simulator/4.2/ ...

See related questions:

iOS 4.2 simulator files?

Where does the iPhone Simulator store its data?

where database store in iphone simulator (for Mac OS)?

Yet - when I don't seem to have this path on my machine. I don't have 'Library' folder in my User folder

I can find a library folder in the root of the drive, with an Application Support folder in there - but there's no iPhone Simulator subfolder there. The only place I can find an iPhone Simulator folder is where the actual simulator executable is stored - but there doesn't seem to be any data files there either.

I have Mac OS X 10.7.4 and Xcode 4.2

Everything seems to be working fine - I can run the simulator and use the database - I just can't find where it's stored on the host machine.

Are there any other standard folders where this data might be saved?

Downwards answered 1/8, 2012 at 14:42 Comment(2)
Couldn't you NSLog the path you are using to access the database? If you can't see the folders they might be hidden for some reason.Chokefull
Ostensibly, yes. However I'm using a Managed Object framework on top of Core Data so I don't have a easy access to the db path - turns out it was OS X simply hiding folders in the Finder, D'oh!Downwards
S
20

Are you looking for the Library directory through Finder, or on the command line? By default from Lion onwards the Library is hidden. You can unhide it by typing

/usr/bin/chflags nohidden ~/Library

at the terminal, or just navigate there via command line eg:

open ~/Library/Application\ Support/iPhone\ Simulator/
Sicanian answered 1/8, 2012 at 14:49 Comment(1)
Good thinking. It was a case of OS X protecting itself from meddling developers! ;) Found it now :)Downwards
H
8

Since OS X Lion the Library folder in your User folder is hidden by default. In Finder open the 'Go' menu and press option (alt), you'll notice the appearance of the 'Library' folder.

Hewes answered 1/8, 2012 at 14:51 Comment(0)
A
3

Libary is hidden in your standard finder.

To be able to find it, navigate to your top user directory (~/) and Press Cmd-Shift-G.

A text box appears so type Library and then follow the yellow brick road.

Advection answered 1/8, 2012 at 14:52 Comment(0)
M
1

I think 4.2 is your version of iOS simulator, because at that path you must select you simulator version. Under that, there must be a folder called Applications, under that there are some intersted named folders(i thing these names are MD5 or something else) and each of these folders stand for an individual application. Find the folder related to the application you are looking for, under Documents folder there must be the database file

Medlar answered 1/8, 2012 at 14:49 Comment(0)
E
1

For similar purposes, I recommend a command line tool called Musical Chairs. With it installed, you can open the last altered simulator app directory with chairs open. It's an easily installed ruby gem, sudo gem install chairs. It's main purpose is actually to cache app data instances, more here.

Excommunication answered 14/5, 2013 at 11:39 Comment(0)
S
0

So, far the best one is SimPholder. It saves the icon at the top. Once you run the application, click at the Simpholer icon it will show the application you were running and take you derie

Sixpenny answered 22/12, 2014 at 16:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.