|
| 1 | +To reset a macOS Catalyst application you need to know the name of the user folder, the application bundle, the AppGroup, and the suit for UserDefaults (if you use it). In the tutorial I will use the following examples: |
| 2 | + |
| 3 | +User folder `ivanvorobei`, app bundle `by.ivanvorobei.apps.debts`, AppGroup identifier `group.by.ivanvorobei.apps.debts`. |
| 4 | + |
| 5 | +Be careful to use the values from your application. |
| 6 | + |
| 7 | +## Clean up UserDefaults |
| 8 | + |
| 9 | +If you want to delete the default `UserDefaults` open a terminal and enter the command: |
| 10 | + |
| 11 | +```swift |
| 12 | +// Delete `UserDefaults` completely |
| 13 | +defaults delete by.ivanvorobei.apps.debts |
| 14 | + |
| 15 | +// Delete from `UserDefaults` by key |
| 16 | +defaults delete by.ivanvorobei.apps.debts key |
| 17 | +``` |
| 18 | + |
| 19 | +For custom domain use the following command: |
| 20 | + |
| 21 | +```swift |
| 22 | +// Created like this |
| 23 | +// UserDefaults(suiteName: "Custom") |
| 24 | +defaults delete suit.name |
| 25 | +``` |
| 26 | + |
| 27 | +## AppGroup |
| 28 | + |
| 29 | +If you use an `AppGroup` you need to delete the following folders: |
| 30 | + |
| 31 | +```swift |
| 32 | +/Users/ivanvorobei/Library/Group Containers/group.by.ivanvorobei.apps.debts |
| 33 | +/Users/ivanvorobei/Library/Application Scripts/group.by.ivanvorobei.apps.debts |
| 34 | +``` |
| 35 | + |
| 36 | +If you store in the default path, it will be the following directory: |
| 37 | + |
| 38 | +```swift |
| 39 | +/Users/ivanvorobei/Library/Containers/by.ivanvorobei.apps.debts |
| 40 | +``` |
| 41 | + |
| 42 | +## Realm mobile database |
| 43 | + |
| 44 | +The `Realm` database files are stored as regular files. They are either in the AppGroup or in the default directory. By performing the steps above, the database will be deleted. |
| 45 | + |
| 46 | +## Other directories |
| 47 | + |
| 48 | +I found more folders, but I don't know what they are for. I will leave the paths here: |
| 49 | + |
| 50 | +```swift |
| 51 | +/Users/ivanvorobei/Library/Application Scripts/group.by.ivanvorobei.apps.debts |
| 52 | +/Users/ivanvorobei/Library/Developer/Xcode/Products/by.ivanvorobei.apps.debts (macOS) |
| 53 | +``` |
| 54 | + |
| 55 | +If you know what they are for or know more folders, let me know - I'll update the tutorial. |
0 commit comments