public void runSelendroidServer() {
		String commandsForInstalled[] = {"java",
				"-jar", 
				selendroidPath + File.separator + selendroidBinary,
				"-verbose", 
				"-port", 
				String.valueOf(aut.getPort()),  
				"-installedApp",
				aut.getPackageName() + "/" + aut.getMainActivity() + ":" + aut.getAppVersion()};
		
		String commands[] = {"java",
				"-jar", 
				selendroidPath + File.separator + selendroidBinary,  
				"-port", 
				String.valueOf(aut.getPort()),  
				"-app", 
				aut.getPath() + File.separator + aut.getApkName()};
		
		String command = "";
		
		if (this.installedApp) {
			command = StringUtils.join(commandsForInstalled, " ");
		} else {
			command = StringUtils.join(commands, " ");	
		}
		
		System.out.println(command);
		
		try {
			child = Util.execCommand(command);
			Runtime.getRuntime().addShutdownHook(new SWShutdown(child));
		} catch (IOException e1) {
			e1.printStackTrace();
		}
		
		serverIn = child.getInputStream();
		serverErr = child.getErrorStream();
		
		BufferedReader reader = null;
		reader = new BufferedReader(new InputStreamReader(serverErr));
		String line = null;
		try {
			while ((line = reader.readLine()) != null && isRunning) {
//				System.out.println(line);
				String autStart = this.stareStartingLog(line);
				if (autStart != null) {
					try {
						this.aut.setStartTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").parse(autStart));
						System.out.println(aut.getPackageName() + " starting at " + autStart);
					} catch (ParseException e) {
						e.printStackTrace();
					}
				}
				if (this.watchServerOn(line)) {
					synchronized(lock) {
						this.isServerOn  = true;
						lock.notify();
					}
				}
				if (this.watchServerShutdown(line)) {
					synchronized(lock) {
						this.isServerOn = false;
						lock.notify();
						break;
					}
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		synchronized(lock) {
			lock.notify();
		}
	}