To force temporary user agent for web testing by example, you can do it from the developer tools.
Developer Tools → Settings → Overrides
To force permanently the user agent, you have to use an extension as :
As soon you change the user agent of your browser, you can't download extension from Google Webstore. To download the crx, use this tips (on Chrome only, change the user agent from the developer tools):
//replace the ~~~~ characters with the part of the URL I pointed out above. https://clients2.google.com/service/update2/crx?response=redirect&x=id%3D~~~~%26uc
To install an extension from a crx file, open Extension page and drag and drop the crx inside.