Regarding Huawei , Trump basically told the Commerce Department to take action, Huawei was already (or was in the process of being) blacklisted by the commerce department, the commerce department does have the legal right to do that given the nature of Huawei's products and sensitivity of communications equipment.
The commerce department doesn't currently (although I believe lawmakers are looking into it) have the authority to simply blanket ban an app like tiktok on a whim / order. They simply can't do that for any old reason the POTUS says.
As I noted in another comment, in the US it does matter HOW you do things, the courts are independent (compared to say China) regardless how "right" someone might be they need to follow the law.
But as far as tiktok until someone gives the commerce department or someone else new powers, so far that seems out of reach.
Granted, I believe there are efforts to give them that option.