Apple names longtime hardware chief John Ternus CEO, with Tim Cook stepping aside to become executive chairman this fall.