addDebugCommandLine( argumentsList );
	public boolean init(Device device, EmulatorSetting setting,			Environment env, Project project,			BooleanEvaluator evaluator, String wtkHome) 	{		// okay, now create the arguments:		ArrayList argumentsList = new ArrayList();				Variable[] parameters = getParameters(setting, project, evaluator, env);		String xDevice = getParameterValue("-Xdevice", parameters );		boolean xDeviceParameterGiven = true;		if (xDevice == null) {			xDeviceParameterGiven = false;			xDevice = device.getCapability("polish.Emulator.Skin");		}		if (xDevice != null) {			// test if this emulator exists:			File skinFile = getEmulatorSkin(wtkHome, xDevice);			if (!skinFile.exists()) {				if (xDeviceParameterGiven) {					System.out.println("Warning: unable  to start the emulator: the emulator-skin [" + xDevice + "] for the device [" + device.getIdentifier() + "] is not installed.");					return false;				} else {					String originalSkin = xDevice;					System.out.println("Info: Emulator [" + skinFile.getAbsolutePath() + "] not found.");					// check if there are other skins given:					int skinNumber = 2;					while (true) {						xDevice = device.getCapability("polish.Emulator.Skin." + skinNumber);						if (xDevice == null) {							break;						}						skinNumber++;						skinFile = getEmulatorSkin(wtkHome, xDevice);						if (skinFile.exists()) {							break;						}						System.out.println("Info: Emulator [" + skinFile.getAbsolutePath() + "] not found.");					}					if (!skinFile.exists()) {						System.out.println("Warning: unable  to start the emulator: the emulator-skin [" + originalSkin + "] for the device [" + device.getIdentifier() + "] is not installed.");						return false;					}				}			}			// okay, skin-file exists:		} else {			System.out.println("Warning: found no emulator-skin or -Xdevice-parameter for device [" + device.getIdentifier() + "], now using the default emulator.");		}				// get emulator executable:		File execFile = getEmulatorExcecutable(wtkHome, xDevice, device );		String executable = execFile.getAbsolutePath();		if (!execFile.exists()) {			System.out.println("Warning: unable to find the emulator [" + executable + "].");			return false;		}						argumentsList.add( executable );				if (this.appendXdeviceArgument && (xDevice != null)) {			argumentsList.add( "-Xdevice:" + xDevice );		}				// add -Xdescriptor-parameter:		argumentsList.add( "-Xdescriptor:" + env.getVariable("polish.jadPath") );				// add the -Xverbose-parameter:		String trace = setting.getTrace();		if (trace != null) {			argumentsList.add("-Xverbose:" + trace );		}				// add the -Xprefs-parameter:		if (supportsPreferencesFile()) {			File preferencesFile = setting.getPreferences();			boolean usingPreferencesFile = false;			if (preferencesFile != null) {				if (preferencesFile.exists()) {					argumentsList.add("-Xprefs:" + preferencesFile.getAbsolutePath() );					usingPreferencesFile = true;				} else {					System.err.println("Warning: unable to use preferences-file: the file [" + preferencesFile.getAbsolutePath() + "] does not exist.");				}			}			if (getParameter("-Xprefs", parameters) != null) {				usingPreferencesFile = true;			}			if (!usingPreferencesFile && setting.writePreferencesFile()) {				File propertiesFile = getEmulatorPropertiesFile( env );				PropertyFileMap emulatorPropertiesMap = new PropertyFileMap();				if (propertiesFile != null && propertiesFile.exists()) {					try {						emulatorPropertiesMap.readFile( propertiesFile );						//FileUtil.readPropertiesFile(propertiesFile, ':', '#', emulatorPropertiesMap, false );						} catch (IOException e) {						e.printStackTrace();						throw new BuildException("Unable to read the default emulator properties from [" + propertiesFile.getAbsolutePath() + "]: " + e.toString() + " - please make sure to use the WTK/2.2 or higher.", e  );					}				}												addProperties(setting, emulatorPropertiesMap);				preferencesFile = new File( device.getBaseDir() + File.separatorChar + "emulator.properties" );					try {					emulatorPropertiesMap.writeFile( preferencesFile );					//FileUtil.writePropertiesFile(preferences, emulatorPropertiesMap);					argumentsList.add("-Xprefs:" + preferencesFile.getAbsolutePath() );				} catch (IOException e) {					e.printStackTrace();					System.out.println("Unable to set preferences-file for emulator: " + e.toString() );				}			} else if (setting.writePreferencesFile()) {				System.out.println("Warning: unable to enable any profiler/monitor, since a preferences-file is used.");			}		} // the device supports the -Xprefs parameter.				if (supportsSecurityDomain()) {			// add the -Xdomain-parameter:			String securityDomain = setting.getSecurityDomain();			if (securityDomain != null) {				argumentsList.add("-Xdomain:" + securityDomain );			}		}				if (supportsHeapsize()) {			// add the -Xheapsize-parameter:			String heapSizeStr = device.getCapability("polish.HeapSize");			if ((heapSizeStr != null) && !("dynamic".equals(heapSizeStr))) {				long bytes = ConvertUtil.convertToBytes( heapSizeStr );				argumentsList.add("-Xheapsize:" + bytes );			}		}				//now add other user-defined parameters:		for (int i = 0; i < parameters.length; i++) {			Variable parameter = parameters[i];			String name = parameter.getName();			if ( (xDeviceParameterGiven) &&  ("-xDevice".equals(parameter.getName()) ) ) {				continue;			}			String value = parameter.getValue();			if (value.length() > 0) {				if ( ( name.charAt(0) == '-')  						&& ((name.charAt(1) == 'X') || (name.charAt(1) == 'D')) ) {					argumentsList.add( name + ":" + value );				} else {					argumentsList.add( name + " " + value );				}			} else {				argumentsList.add( name );			}		}				this.arguments = (String[]) argumentsList.toArray( new String[ argumentsList.size() ] );		return true;	}