Introduction to the iOS simulator.
The simulator is one of the fundamental tools in the development of any mobile application. It allows us a fast way to test most functionalities on different devices with different characteristics: iPhone, iPad, and so on.
In this section we collect a set of solutions for many of the questions that are difficult to find in Apple's official documentation about the simulator. Therefore, in addition to what is presented here, it is equally advisable to consult the official documentation.
- 3.1 How to close applications?
- 3.2 File system
- 3.3 Place images so that they are available in the camera roll
- 3.4 Network
- 3.5 Screenshots
- 3.6 GPS position simulation
- 3.7 Device rotation
- 3.8 Gesture simulation: zoom, rotation
- 3.9 Using iCloud
- 3.10 Create a simulator with an older iOS version
- 3.11 Simulator limitations
- 3.12 Performance
3.1 How to close applications?
To activate application closing mode, you must press (cmd + shift + H) and press the H twice.

3.2 File system
The file system is mapped into the Mac file system within a directory structure. It is very useful to access this structure directly to check the files recorded by an application, change files manually, and so on. In the simulator the file area is not encrypted. Let us remember that on devices, from iOS 9 onward, the file system is encrypted by default.
Each device model is stored inside a different device identifier. In this case, the iPhone 5S corresponds to 78861B99-605D-4AD0-8D4C-EDDEEEB42C7E. These device identifiers vary on each Mac.
/Users/<username>/Library/Developer/CoreSimulator/Devices/78861B99-605D-4AD0-8D4C-EDDEEEB42C7E/
Then comes the common path where the document area of each application is located
data/Containers/Data/Application/
Finally, each application has a unique identifier and in the following path the base of the documents area is found:
7FE0BBE9-1502-47AA-83BA-3923B98A1AD0/Library/Application Support
The final path to the documents area of one particular application is this one.
/Users/<username>/Library/Developer/CoreSimulator/Devices/78861B99-605D-4AD0-8D4C-EDDEEEB42C7E/data/Containers/Data/Application/7FE0BBE9-1502-47AA-83BA-3923B98A1AD0/Library/Application Support

3.3 Place images so that they are available in the camera roll
Simply drag an image from our Mac onto the Camera Roll opened in the simulator.

3.4 Network
The simulator uses the network interface of our Mac. This gives us a very simple mechanism to access local servers in our organization. We must associate an IP address with our local server inside the hosts file of our Mac. The simulator will use this local name resolution and will also be able to access the server.
The hosts file is located at:
/private/etc/hosts
3.5 Screenshots
Screenshots are taken by pressing (cmd + S) or from the File menu.
It is important to emphasize that screenshots are taken with the zoom level at which the simulator is currently set. For screenshots to be useful when registering the application in the Apple Store, the zoom level must be 100% from the menu window/scale/100%. In that way the screen size matches the size of the physical device.
3.6 GPS position simulation
From the menu Debug/Location certain geographical coordinates can be set.
3.7 Device rotation
From the Hardware menu we have access to Rotate Left and Rotate Right. Selecting these options causes the emulator to rotate immediately.

We should not confuse this with having detailed information about the degrees of rotation on the X, Y and Z axes provided by the accelerometer and gyroscope. This information is not available from the simulator.
3.8 Gesture simulation: zoom, rotation
To simulate gestures we must press the alt key over the simulator. At that moment circular handlers appear that allow us to simulate gestures with mouse movements.

3.9 Using iCloud
iCloud can be used from the simulator. We only have to configure the account from inside the simulator in the same way as we would do on the physical device.

3.10 Create a simulator with an older iOS version
Within Xcode, in the menu Xcode/Preferences.../Downloads, the iOS versions that can be downloaded from Apple appear. Only those versions that Apple still supports are shown.

Once the version has been downloaded we go to the Xcode menu Windows/Devices.

We click on the add button located at the bottom and select "Add Simulator". We select the iOS 8.4 version that we just downloaded.

3.11 Simulator limitations
The most important limitations of the iOS simulator are the following:
- Reception of remote notifications, that is, push notifications.
- The simulator cannot simulate the cameras and microphone of the device.
- Motion sensors such as accelerometer and gyroscope.
- Proximity sensor.
- Barometer.
- Ambient light sensor.
- Compass.
These capabilities must be tested directly on the physical device.
3.12 Performance
The performance of the application in the part related to complex interfaces, the use of large images, video or the use of the OpenGL graphics library requires a final review on the device.
Recommended testing workflow
Use the simulator for fast iteration, layout checks, navigation flows, local storage inspection and screenshots. Move to a physical device when testing push notifications, camera, microphone, sensors, memory pressure, battery behavior and graphics performance. Treat both environments as complementary rather than interchangeable.
A practical checklist is to test the same feature on at least one small screen, one large screen and one real device before considering the mobile workflow complete.