ionic-frameworkionic-cli

Can you specify the platform when running ionic serve?


I just updated @ionic/cli to v6.3.0 and noticed that running ionic serve displays the app with the iOS version of default component styles. In prior versions, the Android styles were applied. Is there a way to specify which platform preview is served?

Maybe something like ionic serve --platform android? I don't see anything like that in the documentation.

Related, but not what I'm looking for:


Solution

  • Well there's no way you can achieve this with ionic.

    You can achieve this with Google Chrome. In google chrome inspector tools (F12), You can click Toggle device toolbar (Ctrl+Shift+M) and then select any device from the menu. You will need to refresh after selecting the device to see the behavior.