New York (CNN Business) In the latest struggle for an American company to navigate the tricky waters of doing business in China, Apple CEO Tim Cook defended his company's decision to pull a map app that Hong Kong protesters had used to track police.

In a memo to employees on Thursday, Cook said Apple removed HKmap.live from its App Store Thursday, because it had been used in ways that "endanger law enforcement and residents in Hong Kong." The memo was anonymously posted on Pastebin , a website that allows people to post items without revealing their identities. The text was confirmed by a source with knowledge of the memo.

Hong Kong has been rocked by several months of protests from anti-government demonstrators . Cook told employees in the memo that the decision to scrap the app wasn't easy, but Apple received "credible information" from Hong Kong officials and users of the app that HKmap.live was being "used maliciously."

Some protestors were violently targeting people and property where police weren't present, Cook said, noting the App Store bans apps that can be used for personal harm. He also noted the app violated Hong Kong law.

Apple "thoroughly reviewed" the situation before making the decision, Cook said.

Read More