Run Appium scripts(Test Case) in Eclipse is ok, but run it by command line in windows is not working, why?

Run below the same scripts in Eclipse and Command line in windows

public void setUpOS() throws Exception {
File app = new File(new File(new File(System.getProperty(“user.dir”)), “apps”), appName);
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, device_name);
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, automation_name);
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, OS);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, platform_version);
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
capabilities.setCapability(“unicodeKeyboard”, true);
capabilities.setCapability(“resetKeyboard”, true);

    if(OS == "Android"){
        capabilities.setCapability(MobileCapabilityType.APP_PACKAGE, app_package);
        capabilities.setCapability(MobileCapabilityType.APP_ACTIVITY, app_activity);
        capabilities.setCapability(MobileCapabilityType.APP_WAIT_ACTIVITY, appWaitActivity);
	driver = new SelendroidDriver<WebElement>(new URL(app_url), capabilities);
	}else{
		 //driver = new IOSDriver<MobileElement>(new URL(app_url), capabilities);
	}
}

Run by command line at “driver = new SelendroidDriver(new URL(app_url), capabilities);”, always shows “Configuration Failures: 1, Skips: 3”, I have no ideal of this, could you please give me some suggestions, thanks a lots.

Why are you initiating selendroid drive object?

//=================For Appium Driver=================
@SuppressWarnings("rawtypes")
public static AppiumDriver driver;

//=================For Android Driver=================
@SuppressWarnings({ "unused", "unchecked" })
private SelendroidDriver<WebElement> Driver4Android() {
	return (SelendroidDriver<WebElement>)driver;
} 

//=================For iOS Driver=================
@SuppressWarnings({ “unused”, “unchecked” })
private IOSDriver Driver4IOS() {
return (IOSDriver)driver;
}

Below, I want to apply the same interface both the Android and iOS

That just looks like bad code. If you need a common driver reference type for both Android and iOS, just use AppiumDriver.

You only need to use AndroidDriver or IOSDriver when you initialize your driver. Your driver reference should either be WebDriver, AppiumDriver, AndroidDriver, or IOSDriver; you should try to get your reference to be as specific as possible. Anything else is just a sign that your test framework can be written better.

Please post your logs from your test and from Appium server. There are two sources for these logs. The logs from your test are printed out by the Java process that’s running your tests. The Appium server’s logs are logs that come from the Appium process itself.