I’m new to iOS programming.
I want to know how a database is created on a real iPhone device for the first time.
I have created a database from the terminal and copied it to the project directory and used it for insert/update/delete/etc as shown in many of the tutorials. But how will it be created when I run the app on a real device?
you can use core data as well as sqlite .
when you add sqlite file in you application, and run it in device , then sqlite file will automatically saved to document directory .
you can find that file for simulator in :
/Users/URNAME/Library/Application Support/iPhone Simulator/4.3/Applications/1B787527-0608-4BC1-8022-DFDB3CC35F66/mysqlite.sqlite.
For more detail see
How to get Sqlite database file when application is running on device
For Add sqlite in your app see
http://www.icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/