Toggle Device Toolbar

Is there any way to change the toggle device toolbar to a mobile view while doing web testing? I have tried to send keys, record the actions, but all this hasn’t been successful so far. Any tips or tricks? Thank you.