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?
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]
On Mac OS X 10.7 the users/[username]/Library is hidden. Reveal it using:
chflags nohidden ~/Library
In IOS5, follow this step
- Right Click finder in Dock.
- Click 'Go to Folder'.
- Give folder name as "/Users/'USER NAME'/Library/Application Support/iPhone Simulator/"
It will take you there.
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! ;)
Now on ios 8 the application data is located at Library/Developer/CoreSimulator/Devices/DEVICE NUMBER/data/Containers/Data/Application/APPLICATION ID
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:
- Click to dropdown the simulators list
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.
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.
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
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);
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
来源:https://stackoverflow.com/questions/5919959/iphone-simulator-folder-not-in-application-support