I collected this information for about a year, but it is still relevant (summer 2014). I am not an employee of the Apple Corporation, but some Apple-related people helped me a lot. In the article I will try to talk about the development stages of devices, internal software and something else.
For the article I use pictures only from open sources, but if Giktaim people support me, in the second part I will show live videos made by me.
iphone
Apple by 2006 already had some kind of working software for iPhone, and closer to 2007, it was completely usable, but even at the presentation itself they were very afraid that the iPhone would hang.

')
The first diagnostic shell was called SkankPhone and was designed to debug iron.
The "desktop" (he is SpringBoard) was absent, because Apple tried to keep the secret with all its might,
although it could well have been simply not ready .
Starting with iPhone 3G and 2.0, debugging was done using SwitchBoard:

But access to the SkankPhone still remained.
The same thing happened to 3G [S], with the only difference that they added new features to the firmware (my photo):

I think you all remember that forgotten iPhone in the bar? It worked just on such firmware that it stood in iPhone 3G [S]. Why is that?
Build firmware
Earlier, I naively believed that for each device separately assemble the firmware. It turned out that nothing like that.
The “universal firmware” build-up, in our case, firmware 4.0 was suitable for all devices at once (ie, internal firmware contains support for all devices).
To "configure" it under the device use PurpleBuildSanitizer (my photo):

Bootchain compiles, but works between devices. You can run the bootchain from 4S on 4 / 3G [S] (but you need some magic).
Starting from 5.0 (not from 4.3), iOS is built only under ARMv7, starting from iOS 7 - ARMv7s (which is why some old ARMv7 devices (iPhone 4 / 4S and iPad 2/3) have had problems with the speed of this OS.
Starting from 7.0 there is also a separate assembly branch - for A7 and later. For them, use a new container - img4.
iPad
Apple itself did not really hope for the success of the very first iPad, but began to actively develop it in 2009. By the way, it was then that the first prototype working on the diagnostic OS for iPhone 3G [S] appeared:

The iPhone 4 itself is very close to the iPhone 3G [S], because Jobs was satisfied with the performance of 3G [S], the new A4 chip was decided to be tried on the iPad. The Quartet itself began to be made just in 2009.
Stages of device development
According to the roadmap that is used in Apple, the idea of ​​a new device appears. Consider the example of the iPad 3. Everyone has long been waiting for the retina. In order not to lose the race, they were forced to urgently make The New iPad.
Stages:
1. On the debug board, the first prototype appears, as SoC - FPGA. There are 4 UART, Ethernet, Com.
2. If everything is more or less successful, then collect a fee for the test (most often from parts that are already in production).
A red board appears. It has three connectors for LCD, there are debug outputs, JTAG (or similar), as well as the usual A5.
3. Apple is testing the red board without the case. They are not satisfied with the performance - they start the production of 5.
4. The first prototype of J1DVT-1 appears, then J1DEV. DEV is almost the final version, but with the firmware signature verification disabled.
If such a device is left in the bar - it is likely that knowledgeable people will make a bootrom dump and a bootrom vulnerability will appear for the SoC that is installed there.
Diagnostics of hardware and software occur in different conditions. To this day, engineers and employees of Foxconn use SwitchBoard for testing, and on the Apple campus, the diagnostic version of iOS.
System Testing and Optimization
iPhone OS tested on prototype iPhone 2G
iPhone OS 2 tested on iPhone 2G
iPhone OS 3 tested on iPhone 3G / 3G [S]
iOS 4 tested on iPhone 4
iOS 5 tested on iPhone 4S
iOS 6 tested on iPhone 5
iOS 7 tested on iPhone 5
iOS 8 tested on iPhone 5S
By the word "tested" I mean optimization (so that this model does not lag).
Beat for spelling, punctuation and syntax in drugs.
In the next article (if interested, of course), I’ll tell you about low-level debugging, about 4S and iphone 6 development, software for Mac OS, Apple employee account and internal iOS software.