how to press home key:
public void pressHomeButton() {
try {
String[] args = {"osascript", "-e", "tell application \"System Events\" \n tell application \""+simulatorAppName()+"\" to activate \n tell application \"System Events\" to keystroke \"h\" using {command down, shift down} \n end tell"};
Process process = Runtime.getRuntime().exec(args);
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(process.getErrorStream()));
String lsString;
while ((lsString = bufferedReader.readLine()) != null) {
System.out.println(lsString);
}
try{Thread.sleep(200);}catch (Exception e1){}
} catch (Exception e) {}
}
tap on settings icon:
((AppiumDriver) driver).tap(1, driver.findElements(By.name("Settings")).get(0), 200);
As far as By.name not supported any more use another way.