iPhone simulator folder not in Application Support
Asked Answered
T

11

21

I am creating an application that write some data to the database. For checking I need to open the database in applications.

I think it should be in

~/Library/Application Support/iphone simulator....

I have not found the iphone simulator folder in Application Support.I have installed ios 4.2, and simulator is working properly.

Where can I find it?

Tympanites answered 7/5, 2011 at 8:29 Comment(2)
Try this method.My answer posted here. #7732018Abbotsen
Possible duplicate of Is there any way to see the file system on the iOS simulator?Fernando
B
29

Xcode versions 3.x-5.x

Simulator usually is installed together with SDK so most probably you should look (e.g., if you installed Xcode 3.1 and SDK 4.3 in their default locations) within:

/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iOS Simulator.app

Apps that are installed on your iPhone Simulator should be (if for example compiled for iOS 4.3) located in:

~/Library/Application Support/iPhone Simulator/4.3/Applications/[app GUID]

If you are looking for .sqlite database within Application, it should reside in:

~/Library/Application Support/iPhone Simulator/4.3/Applications/[app GUID]/Documents/[appname].sqlite 

Xcode 6

The simulator devices are located in:

~/Library/Developer/CoreSimulator/Devices/

so your application data (e.g. application database in app Document folder) will be in

~/Library/Developer/CoreSimulator/Devices/[simulator device id]/data/Applications/[app GUID]/Documents/[appname.sqlite]
Brundage answered 7/5, 2011 at 8:42 Comment(5)
Yes It is there. But how can I view the database file.Tympanites
If you want a free SQLite viewer, go here: itunes.apple.com/us/app/sqlvue-lite/id433341470?mt=12Frankfurter
There's a nice add-on for FireFox available: addons.mozilla.org/en-US/firefox/addon/sqlite-managerLanark
We are now up to simulator 5.0 and 6 is in beta 4 stage. I would suggest testing with: ls -la ~/Library/Application\ Support/iPhone\ Simulator/*.*/ApplicationsLynwoodlynx
was getting error "tmp" could not be removed because you do not have permission when trying to launch simulator, clearing out ~/Library/Developer/CoreSimulator/Devices/ and resetting the settings in the simulator fixed everythingIves
C
15

On Mac OS X 10.7 the users/[username]/Library is hidden. Reveal it using:

chflags nohidden ~/Library
Cattleya answered 7/2, 2013 at 16:12 Comment(1)
Run these 2 commands in Terminal to see this directory in the Finder: 1) defaults write com.apple.finder AppleShowAllFiles TRUE 2) killall FinderMarcellamarcelle
P
9

In IOS5, follow this step

  1. Right Click finder in Dock.
  2. Click 'Go to Folder'.
  3. Give folder name as "/Users/'USER NAME'/Library/Application Support/iPhone Simulator/"

It will take you there.

Proclus answered 2/3, 2012 at 8:56 Comment(1)
This works, thanks heaps. PEOPLE Ensure that you type in your Macs name where it says "User Name"Brewster
D
5

NOTE: When you run the simulator, it creates a directory under your home directory located at:

~/Library/Application Support/iPhone Simulator/

When you install an application onto the simulator, it creates a sandbox for the application in a path that looks something like this:

~/Library/Application Support/iPhone Simulator/user/Applications/<GUID>

Where <GUID> is a directory with the name being a GUID assigned to the application during the installation process. The GUID isn’t particularly necessary to find for you application, and the path to your application’s sandbox can be found with a quick display of command-line foo. From the ~/Library/Application Support, run:

Deminem$ find ./ -name "AppName.app"

And, voila. It will return a list of all the sandbox directories which contains this application. The "private" data for your app inside the directory:

~/Library/Application Support/iPhone Simulator/user/Applications/<GUID>/Documents

Good luck! ;)

Duvalier answered 7/5, 2011 at 9:14 Comment(8)
But here is not a directory named iphone simulator in Application Support.Tympanites
I mentioned run inside the ~/Library/Application Support, so it will list down all the sandbox paths for your app. Or you can run it from users directory /Users/Deminem which will show you all the paths for this file.Duvalier
Do I need to reinstall iphone simulatorTympanites
Have you execute the above command? and if you can print the trace here so i can track the problem.Duvalier
Yes I have run find ./ iphone\ simulator, find: iphone simulator: No such file or directoryTympanites
Ah men! i told you run this command on terminal: find ./ -name "YourAppName.app". But before running this make sure that you've created the app in the sandbox by run your project one time.Duvalier
This way we will know the exact location of your apps sandbox. Or may be helps to tackle down the actual issue.Duvalier
The actual solution I found on another Stack Overflow article. i had the same issue. The iPhone Simulator folder is hidden by default: type this in a terminal screen: chflags nohidden ~/Library/Benzaldehyde
F
2

Now on ios 8 the application data is located at Library/Developer/CoreSimulator/Devices/DEVICE NUMBER/data/Containers/Data/Application/APPLICATION ID

Freeborn answered 21/7, 2014 at 16:33 Comment(1)
Note that APPLICATION ID above changes every run, but -[NSFileManager URLsForDirectory:inDomains:] and NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) will always use the current value. Your code should not depend on the full path to persist between runs of the application.Muhammadan
B
2

On XCode 8. the sqlite file is in

~/Library/Developer/CoreSimulator/Devices/[DEVICE ID ]/data/Containers/Data/Application/B4813EE5-CC8E-4728-872E-41918AD1C14D/Documents/[APPLICATION NAME].sqlite

I don't know the mean by "B4813EE5-CC8E-4728-872E-41918AD1C14D".

The way to get DEVICE ID:

  1. Click to dropdown the simulators list

enter image description here

  1. Click "Add Additional Simulators..." enter image description here

  2. Select the simulator you are using

Boffin answered 6/7, 2016 at 9:43 Comment(0)
L
1

We are now up to simulator 5.0 and iOS 6 is in beta 4 stage. All previous answers and comments are out of date.

I would suggest testing with

ls -la ~/Library/Application\ Support/iPhone\ Simulator/*.*/Applications

To answer the specific question about databases

find ~/Library/Application\ Support/iPhone\ Simulator/*.*/Applications -name \*.sqlite

That should last until Apple makes a drastic change.

Lynwoodlynx answered 6/8, 2012 at 21:36 Comment(0)
K
0

It sounds like you're talking about the SQLite file used by Core Data – if so, that file should be in ~Library/Application Support/iPhone Simulator/4.2/Applications/[AppID]/Library/ (assuming you're simulating iOS 4.2). If it's not there, I'm not sure where else it would be.

Kmeson answered 7/5, 2011 at 9:8 Comment(0)
E
0

You can find it here

/Users/YOURUSER/Library/Application Support/iPhone Simulator/5.1/Applications

or

/Users/YOURUSER/Library/Application Support/iPhone Simulator/6.0/Applications

Evers answered 8/1, 2013 at 2:59 Comment(0)
F
0

You can also write two lines of code that will tell you exactly where your app is located.

NSString *appFolderPath = [[NSBundle mainBundle] resourcePath];
NSLog(@"%@", appFolderPath);
Fadeless answered 28/6, 2015 at 17:59 Comment(0)
H
0

In iOS 10, Xcode 8.3.3,

Find the Document path from NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.userDomainMask, true)

then you can find the sqlite file in path printed

Helbon answered 24/7, 2017 at 8:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.