User agent not changing with firefox selenium getting setcapabilities issue

This code was working fine, but when switched to firefox from chrome now this is giving me error.

Please help me to find whats the solution

FirefoxOptions options = new FirefoxOptions();
        options.addArguments("--incognito");
        options.addArguments("start-maximized");
//        options.addArguments("--user-agent=Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac\n" + "OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53");
        options.addArguments("--user-agent=Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36");
        capabilities.setCapability(FirefoxOptions(capabilities), options);
        System.setProperty("webdriver.gecko.driver","/Users/abcd/Downloads/geckodriver");
        WebDriver driver = null;

Please help ....