如何在开发过程中从设备上移除 macOS 应用程序

huangapple go评论62阅读模式
英文:

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 -&gt; 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/&lt;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 &lt;app bundle id&gt; 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.

huangapple
  • 本文由 发表于 2023年4月7日 03:42:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/75953216.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定