"native or permanent resident of London," specifically the City of London, more precisely one born or living "within the sound of Bow-Bell" (see Bow bells); c. 1600, usually said to be from Middle English cokenei, cokeney "spoiled child, milksop" (late 14c.), originally cokene-ey "cock's egg" (mid-14c.). The most likely disentangling of the etymology is to start from Old English cocena "cock's egg" -- genitive plural of coc "cock" + æg "egg" -- medieval term for "runt of a clutch" (as though "egg laid by a cock"), extended derisively c. 1520s to "town dweller," gradually narrowing thereafter to residents of a particular neighborhood in the East End of London. Liberman, however, disagrees:
Cockney, 'cock's egg,' a rare and seemingly obsolete word in Middle English, was, in all likelihood, not the etymon of ME cokeney 'milksop, simpleton; effeminate man; Londoner,' which is rather a reshaping of [Old French] acoquiné 'spoiled' (participle). However, this derivation poses some phonetic problems that have not been resolved.
The characteristic accent so called from 1890, but the speech peculiarities were noted from 17c. As an adjective in this sense, from 1630s. Related: Cockneydom; Cockneyish.