Mr Cummings said he would "never do such a thing".
He defended the awarding of the contract to Public First after a campaign group complained of "apparent bias" and took legal action.
The Good Law Project began a High Court fight with the Cabinet Office on Monday after complaining about the way the contract was awarded to a company with links to Mr Cummings, following the start of the coronavirus crisis nearly a year ago.
Ministers are fighting the claim and Mr Cummings outlined the reasoning behind the contract award in a written witness statement, seen by Mrs Justice O'Farrell.
A barrister representing the Good Law Project on Monday told Mrs Justice O'Farrell that Public First was awarded the contract because Mr Cummings, then chief adviser to Mr Johnson, "wanted" Public First to have the contract.
Jason Coppel QC told the judge at a virtual High Court hearing that "no other provider was considered".
He said more than £500,000 had been spent and told the judge that it was "not strictly necessary" to award the contract to Public First without competition.
Mr Cummings said Britain had been facing an emergency because of the coronavirus crisis, and "the award of the contract without delay" was "entirely justified".
"Obviously I did not request Public First be brought in because they were my friends," said Mr Cummings.
"I would never do such a thing."
Mr Cummings said he was Mr Johnson's main political adviser from July 2019 until November last year.
"Because of Covid in 2020, this role involved issues of management and procurement far more than it did political advice," he said.
"A big part of my job was solving Whitehall problems – in particular trying to eliminate obstacles and to get the right people into the right roles and the right meetings."
Mr Cummings said he was friends with people involved with Public First, including director James Frayne.
But he said he had not met Mr Frayne since 2016.
"James Frayne and I worked on the Euro campaign 20 years ago, other political issues, and set up the campaign to fight the proposed formation of a regional assembly in north-east England in 2004," he said.
"I have talked to them extensively about focus groups and public opinion over many years.
"I knew from my experience that Public First were very good at running focus groups and that its key staff had thought extensively about how people who usually ignore most news and political communication think and might be influenced.
"I knew that I could rely on them to make an extra effort, beyond what they were paid to do.
"I knew they would give us honest information unlike many companies in this sector.
"Very few companies in this field are competent – almost none are very competent, honest and reliable."
He said he had "no involvement" in contractual arrangements with Public First "or their remuneration".
Mr Cummings told the judge that the work done by Public First was "worth more than every penny spent".