英文:
How to remove macOS app from device during development
问题
我在 macOS 上使用 CoreData 进行开发,出于调试的目的,我必须从我的设备中删除应用程序。
在开发 iOS 时,这很简单,因为我可以在模拟器中直接删除应用程序。然而,在 macOS 上,部署的应用程序不会出现在我的 Mac 应用程序文件夹中。如何删除应用程序以及所有相关数据?
英文:
I'm working with CoreData on macOS, and in the interests of debugging, I have to remove the app from my device.
In developing iOS, this is trivial since using a simulator I can simply delete the app. On macOS, however, the deployed app doesn't appear in my Mac Applications folder. How can I delete the app and all associated data?
答案1
得分: 1
你可以在Xcode中通过选择菜单 Product -> Show Build Folder in Finder
来定位调试应用程序。这将在DerivedData项目文件夹中打开一个Finder窗口,并在其中选中"Build"文件夹。在"Build"文件夹中,你将找到"Products"文件夹,然后是"Debug"(或者可能是"Release")文件夹,其中包含实际的 .app 文件。
假设你正在构建一个沙盒应用程序,该应用程序的沙盒(以及其数据)位于其他位置。你可以在以下位置找到它:
~/Library/Containers/<应用程序包标识>
在此文件夹中,你会找到许多表示沙盒和可能已保存在沙盒内的数据的文件。如果你希望重新开始,可以删除 <应用程序包标识>
文件夹。
如果该应用程序被授予访问沙盒外的文件夹(如桌面、下载等)的权限,那么这些数据可能分散在这些文件夹中。显然,你不希望删除 ~/Desktop、~/Downloads 等文件夹。
英文:
You can locate the debug app in Xcode by selecting the menu Product -> Show Build Folder in Finder
. This will open a Finder window with the "Build" folder selected within the DerivedData for the project. Inside the "Build" folder will be the "Products" folder then the "Debug" (or maybe "Release") folder. That will contain the actual .app.
Assuming you are building a sandboxed app, the app's sandbox (and its data) is located elsewhere. That will be found in:
>~/Library/Containers/<app bundle id>
Inside this folder you will find lots of files representing the sandbox and any data you may have saved within the sandbox. You can delete the <app bundle id>
folder if you want to start fresh.
If the app is granted access to folders outside of the sandbox, such as Desktop, Downloads, etc., then that data may be scattered within those folders. Clearly you do not want to delete ~/Desktop, ~/Downloads, etc.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论