SEATTLE — For Apple and Amazon, the holidays are the time to shine, the period when shoppers have the greatest appetite to buy their devices and, in Amazon’s case, anything else that can be stuffed into a box and delivered to homes.

During the final few months of last year, neither disappointed.

Both companies singled out the booming sales of their devices in the quarterly financial results that they reported on Thursday. Apple boasted of its highest revenue ever for a new lineup of iPhones, which included the high-priced iPhone X. Amazon raved about the demand for gadgets like the Echo, which runs its intelligent voice assistant, Alexa.

“Our 2017 projections for Alexa were very optimistic, and we far exceeded them,” Jeff Bezos, the chief executive of Amazon, said. "We don’t see positive surprises of this magnitude very often — expect us to double down.”

Amazon, a company once known for routinely posting losses, more than doubled its profit thanks to strong growth in its cloud computing division and a newer business for the company — advertising. It also benefited from a large gain resulting from changes to the United States tax code.