@@ -80,6 +80,13 @@ public class SimctlClient {
8080 dataTask ( . terminateApp( env, appBundleIdentifier) , completion)
8181 }
8282
83+ /// Reset the contents and settings of the simulator
84+ /// - Parameters:
85+ /// - completion: Result callback of the call. Use this to wait for an expectation to fulfill in a test case.
86+ public func erase( _ completion: @escaping DataTaskCallback ) {
87+ dataTask ( . erase( env) , completion)
88+ }
89+
8390 /// Set the device UI appearance to given appearance
8491 /// - Parameters:
8592 /// - appearance: The appearance - currently light or dark.
@@ -250,6 +257,7 @@ extension SimctlClient {
250257 case setPrivacy( SimctlClientEnvironment , PrivacyAction , PrivacyService )
251258 case renameDevice( SimctlClientEnvironment , String )
252259 case terminateApp( SimctlClientEnvironment , String )
260+ case erase( SimctlClientEnvironment )
253261 case setDeviceAppearance( SimctlClientEnvironment , DeviceAppearance )
254262 case triggerICloudSync( SimctlClientEnvironment )
255263 case uninstallApp( SimctlClientEnvironment , String )
@@ -267,6 +275,7 @@ extension SimctlClient {
267275 case . setPrivacy,
268276 . renameDevice,
269277 . terminateApp,
278+ . erase,
270279 . setDeviceAppearance,
271280 . triggerICloudSync,
272281 . uninstallApp,
@@ -289,6 +298,9 @@ extension SimctlClient {
289298 case . terminateApp:
290299 return . terminateApp
291300
301+ case . erase:
302+ return . erase
303+
292304 case . setDeviceAppearance:
293305 return . deviceAppearance
294306
@@ -322,6 +334,7 @@ extension SimctlClient {
322334
323335 switch self {
324336 case let . sendPushNotification( env, _) ,
337+ let . erase( env) ,
325338 let . triggerICloudSync( env) ,
326339 let . setStatusBarOverrides( env, _) ,
327340 let . clearStatusBarOverrides( env) ,
@@ -367,6 +380,7 @@ extension SimctlClient {
367380 case . setPrivacy,
368381 . renameDevice,
369382 . terminateApp,
383+ . erase,
370384 . setDeviceAppearance,
371385 . triggerICloudSync,
372386 . uninstallApp,
0 commit comments