In an arrogant, boastful, or overly confident manner that is annoying.
From 'cocky' + '-ly' (adverb suffix), formed in the 1800s to create the adverbial form of the adjective.
The adverb 'cockily' is interesting because it's usually used to describe visible behavior—you can 'cockily strut' or 'cockily announce,' showing how this word captures the physical swagger of arrogance, not just the attitude.
Complete word intelligence in one call. Free tier — 50 lookups/day.