When a device is mass manufactured, It is flashed at the factory with identical Code.
The process of mass manufacturing involves below steps -
Add device using ‘bulk’ mode.
Platform provides Device Auth Token called Tenant Token.
The devices at factory flashed with Free-RTOS / Arduino sketch with Platform URL, Device Auth.Token apart from Wifi Access credential through respective SDK & IDEs.
The device is expected to generate a unique device Hash and use it while device authentication process and the hash must remain same across the life of the device. Any unique id can be used for the device hash, example Mac id, serial number of cpu or UUID generated by the software.