Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading a file from a hard drive in iPhone simulator

Is it possible to read a file (from my normal file system) into a iPhone App running on the iPhone Simulator?

I understand that the iPhone itself has not got a (user accessible) file system but this is simply for testing and will only ever be run in the simulator.

The file will be a text file that can be edited while the application is running, it will be read every-time a method is called.

like image 819
Richard Stelling Avatar asked May 01 '09 15:05

Richard Stelling


People also ask

How do I access iOS simulator files?

# Open application folder in Finder First, copy the path to the app folder from Xcode console. Then open Finder, click on Go -> Go to Folder and paste the application directory path. You will now be able to browse all the files in your application folder.

Where does the iPhone simulator store its data?

type: ~/Library/Application Support/iPhone Simulator. The Directories are the iOS version of the different Simulators. The Sub Directories are the Apps install on the simulator.

Where are simulator files saved?

Where are simulator files saved? You also may just go to the ~/Library/Developer/CoreSimulator/Devices/ folder in Finder ( Shift+Cmd+G ), and then click on the Date modified tab on the top of the folder menu. You'll get the most recently used simulator folder without UDID.


1 Answers

Yes, you can, and it doesn't matter where it is. Just give it an absolute path name when you load it (Xcode won't recognize a different working directory when running the simulator).

like image 67
Jesse Beder Avatar answered Oct 06 '22 10:10

Jesse Beder