删除Info.plist后,Mac应用程序仍在运行 [英] Mac app is still running after deleting Info.plist

查看:449
本文介绍了删除Info.plist后,Mac应用程序仍在运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从头开始构建Mac App。我手动创建了主应用程序,目录,MacOS,资源所需的文件夹,并删除了二进制文件。我唯一不知道如何从头开始创建的是 Info.plist。因此,我只是从计算机上已安装的应用程序中复制了一个,删除了所有不熟悉的键,但可执行文件和包类型除外(如APP)。测试。在复制和编辑Info.plist文件之前,我双击了Finder中的应用程序图标。无法正常工作,这是预期的。复制并编辑Info.plist文件后,该文件正在工作,这也是预期的。接下来是我不明白的地方。我删除了Info.plist文件,然后双击Finder中的应用程序图标,它仍然可以正常工作!



我的问题是:


  1. 第一次运行时是否将Info.plist信息迁移到应用程序捆绑包中的某个秘密位置?

  2. 是否正在复制和编辑来自其他应用程序的现有Info.plist文件是从头开始构建应用程序的好习惯?


解决方案

我知道该帖子很旧,但想回答一下,以便使用户从中受益。您问了两个问题:-



1)查看第一个run有一个构建,它的派生数据可能会帮助您在没有Info.plist的情况下运行(对于特殊情况,尽管我认为它没有运行)。
但是没有info.plist,您将无法运行应用程序。



2)否。答案是从其他应用程序复制和编辑现有的info.plist是不是一个好习惯。



每个应用程序和插件都使用Info.plist文件将配置数据存储在系统可以轻松访问的位置。 OS X和iOS使用Info.plist文件来确定要显示捆绑软件的图标,应用程序支持的文档类型以及对捆绑软件本身有影响的许多其他行为。
有关此的更多信息,请参见以下链接:-



https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Introduction/Introduction.html



我认为提出这个要求的用户已经有了这些东西,希望对其他用户有所帮助。



谢谢。


I want to build a Mac App from scratch. I manually created the required folders of main app, Contents, MacOS, Resources, and dropped the binaries. The only one I don't know how to create from scratch is "Info.plist". So, I just copied one from the installed Applications on my machine, removed all the unfamiliar keys, except the Executable and Package type (as APP).

Then I did a test. Before I copied and editted the Info.plist file, I double-clicked the app icon in Finder. Not working, which is expected. After I copied and editted the Info.plist file, it is working, which is also expected. Next is what I don't understand. I removed the Info.plist file, and double-clicked the app icon in Finder, it is STILL working!

My question is:

  1. Did the first time running migrate the Info.plist information to some secret place in the app bundle?
  2. Is copying and editing an existing Info.plist file from other applications a good practice for building an app from scratch?

解决方案

I know the post is old but think to answer,so that users will get benefitted as they come across this.You asked two questions:-

1)See the first run has a build and its derived data might help you to run without Info.plist(for particular case although i didn't think so it run). But you can't run app without info.plist.

2)No.the answer is copying and editing an existing info.plist from other application is not a good practice.

Every app and plug-in uses an Info.plist file to store configuration data in a place where the system can easily access it. OS X and iOS use Info.plist files to determine what icon to display for a bundle, what document types an app supports, and many other behaviors that have an impact outside the bundle itself. For better knowledge about this you can see this link:-

https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Introduction/Introduction.html

I think the user who asked this already got these things,Hope this will help other Users.

Thanks.

这篇关于删除Info.plist后,Mac应用程序仍在运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆