Tim Cook testified about Apple’s developer policies, the company’s business in China and its privacy policies.