Science is worthless if it isn't motivated by basic human values and the desire to help people, Apple CEO Tim Cook told graduates of the Massachusetts Institute of Technology on Friday, urging them to use their powers for good.

"Whatever you do in your life, and whatever we do at Apple, we must infuse it with the humanity that we are born with," Cook said in his commencement speech at MIT's Cambridge, Mass., campus.

When you keep people at the centre of what you do, it can impact. - Apple CEO Tim Cook

"That responsibility is immense. But so is the opportunity," he said.

Cook said Apple wants to make products that help people. As examples, he cited iPhone technology that can help a blind athlete run a marathon and an iPad that connects an autistic child to the world around them.

"When you keep people at the centre of what you do, it can impact," he said.

Cook said he isn't worried about artificial intelligence giving computers the ability to think like humans.

"I'm more concerned about people thinking like computers, without values or compassion, without concern for consequence."

It 'takes all of us'

Cook praised the benefits of new devices and social media. But he also cautioned that the same technologies can divide people through threats to privacy or security, and said technology must be tempered with human knowledge.

"Technology is capable of doing great things, but it doesn't want to do great things — it doesn't want anything," the Apple Inc. chief executive said. "That part takes all of us."

Cook's speech did not break new ground for him as head of the world's most valuable technology company but added some context around some of his past decisions, such as taking controversial stances to protect privacy rights and investing heavily in green technologies.

Cook has criticized U.S. President Donald Trump's policies but offered only a gentle joke at the president's expense on Friday, telling students it is obvious they have taken over Trump's Twitter account.

"I can tell college students are behind it because most of the tweets happen at 3 a.m.," Cook said.

Cook also urged graduates to resist becoming cynical.

"The internet enabled so much and empowered so many, but it can also be a place where basic rules of decency are suspended and pettiness and negativity thrive," he said.

"Don't let that noise knock you off course. Don't get caught up in the trivial aspects of life. Don't listen to trolls, and don't become one. Measure impact in humanity — not in the likes but thelives you touch and the people you serve."

Cook, who is openly gay but famously circumspect, gave few details about his own life on Friday except to outline what he described as a frustrating search for meaning until joining Apple.

He said at one point he sought guidance in religion and last year met with Pope Francis, who Cook said reinforced his own sense that technology must be harnessed with strong values. He said Francis told him, "Never has humanity had such power over itself, yet nothing ensures that it will be used wisely."