Donald Trump on Friday urged a roomful of voters to boycott the tech giant Apple so long as its chief executive, Tim Cook, refuses to comply with a court order to assist the FBI with hacking into the cell phone of San Bernardino shooter Syed Farook.

"First of all Apple better give the security for that phone," the Republican presidential hopeful said during a campaign rally in Pawleys Island, S.C. "What I think you ought to do is boycott Apple until such time they give that security number. How do you like that?"

"I just thought of it," Trump noted, drawing applause.

"Boycott Apple," he repeated.

Cook made news Wednesday after he denied a court order requesting that Apple develop a software capable of bypassing the security features built into its iPhone. Due to existing security features, investigators are currently unable to access data on Farook's mobile phone.

In a written statement posted to Apple's website, Cook said the FBI's request "threatens the security of [Apple] customers" and expressed concern that such software could fall into the hands of individuals who wish to do harm.

"The government suggests this tool could only be used once, on one phone. But that's simply not true," he wrote. "Once created, the technique could be used over and over again, on any number of devices. In the physical world, it would be the equivalent of a master key, capable of opening hundreds of millions of locks — from restaurants and banks to stores and homes."

Trump pushed back against Cook's argument by claiming that Farook's phone was already "owned by the federal government."

"Here's the thing, the phone's not even owned by this young thug that killed people," he said, adding that Cook "is looking to do a big number ... to show how liberal he is."

"We gotta get to the bottom of it, but we're not going to get to the bottom of it unless we use common sense," Trump said. "So I like the idea of boycotting Apple until such time as they give that information — I think that's a great idea."