This phrase that at least used to be quite commonly used in American English is an example of a metaphor. The person who is the apple of your eye is someone that you find sweet and nice to look at. In that way, they are being compared to an apple.
This is not a simile even though it is comparing two things (the person and the apple). This is because there is not a direct comparison -- it does not use "like" or "as." It's not alliteration because none of the words start with the same letter or sound. It's not personification because it's not giving an inanimate thing the characteristics of animate things.
In language, being direct eliminates confusion and ensures that miscommunication is minimized. However, when subtlety or emphasis is needed or creativity is required or perhaps a reader or receiver of information needs to get a visual picture of something, figurative language comes into its own. Figurative language can provide clarity and a more defined understanding of something or it can create confusion and a need for interpretation. It is persuasive in nature and tries to convince the reader towards a preferred understanding of what is being described. Over time, figurative language has adopted its own set of rules as writers use it to enhance their own work. Translation of texts from other languages has resulted in interpretation of the types of figurative language used in, for example, the Bible, and general definitions now fit the intentions of writers regardless of when a text may have been written. This has given figures of speech their universal appeal and they exist in everyday language on a far greater scale than the average person realizes.
In defining the well-known idiom "the apple of my eye" as either metaphor, simile, personification or alliteration, it is necessary to understand each of these terms. A metaphor makes an implied comparison of two unlike things as if they can be directly compared when there is no literal connection. The comparison is definite unlike a simile which also makes a comparison but it uses a key word in making the comparison by using the word like or as. Personification attributes human characteristics to something that is not human and alliteration is a sound device which creates emphasis through using the same letter to begin at least two words in a line or sentence and, this way, it draws attention to the words being used.
Therefore, from the four choices only metaphor meets the criteria.