In his first weeks in office, President Donald Trump has shown a readiness to take on the tech industry, clashing with Silicon Valley in ways that his tech-friendly predecessor hardly ever did.

The president’s executive order on immigration, which generated an outcry from the industry, was only the beginning.

Trump-appointed regulators have...