Deleting files from iOS

Appium 2.0.

Adding a file on iOS simulator is done with “driver.executeScript(“mobile: deleteFile”, ImmutableMap.of(“remotePath”, remotePath))”, but how can I delete it after the test?

https://appium.github.io/appium-xcuitest-driver/4.29/execute-methods/#mobile-deletefolder

hello, can you describe your problem better… you wrote that to add a file you use the method “driver.executeScript(“mobile: deleteFile”, ImmutableMap.of(“remotePath”, remotePath))”, but this is not to add .
to delete a file try this:
HashMap<String, Object> params = new HashMap<>();
params.put(“remotePath”,“path of the file.txt”);
driver.executeScript(“mobile: deleteFile”, params);

Where driver is IOSDriver
add this code after you are done using the file and want to delete it.