ios - 在应用程序包中添加符号链接(symbolic link)

标签 ios xcode build alias linkage

Apple 在 UILocalNotification 类引用中指定音频文件必须来自应用程序包。然而,一些聪明的极客通过使用找到了绕过这个限制的方法:

// this works by going up the bundle dir, then pointing to the Documents dir
localNotif.soundName = @"../Documents/blabla.caf";

此变通办法在 iOS 5 上运行良好,但在 iOS 6 中出现问题。为了尝试提出新的变通办法,我做了一个别名(符号链接(symbolic link)),名为blabla.caf 指向../Documents/blabla.caf,并将其放入应用程序包中。这是我被卡住了。

现在,我遇到了一个PBXCp 错误,Xcode 无法完成应用程序到设备的部署,因为显然

error: /Users/stuff/moreStuff/appName/../Documents/blabla.caf: No such file or directory


我的问题:

  1. 我可以通过某种方式向 Documents 目录添加一个虚拟文件 (0 KB) 来关闭 Xcode 吗?
  2. 我能否以某种方式强制 Xcode 覆盖此错误并继续 life 部署应用程序?

最佳答案

尽管从 bundle 到文档目录的符号链接(symbolic link)在 iOS 7.1 中有效,但如果您要将应用程序放入 AppStore,此变通方法将变得无用。自 2014 年 3 月以来,带有此类符号链接(symbolic link)的应用不会通过审核。

在我将 bundle 中带有此类链接的应用程序上传到 iTunes connect 后,我​​立即收到 Invalid binary 状态。来自 iTunes Store 的以下邮件:

Dear developer,

We have discovered one or more issues with your recent delivery for "X". To process your delivery, the following issues must be corrected:

Invalid Symlink - Your package contains a symbolic link 'External/Documents' which resolves to a location 'External/../../Documents' that does not exist or is outside of the package.

...

Regards,

The App Store team

关于ios - 在应用程序包中添加符号链接(symbolic link),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13399864/

相关文章:

ios - 使用 UserDefaults 保存和检索 bool 值

ios - 应用重启后监控 NSURLSession

ios - iOS 7的Xcode 6.3应用提交失败

ios - 无效的包结构 - 该应用程序可能只包含一个可执行文件。

ant - 在ant build.xml中设置绝对路径

iphone - 您的 iPhone 应用程序可以收到新通知的通知吗?

ios - Error.code 在 swift 3 中不再有效语法?

ios - 如何在屏幕上显示模拟器键盘时使用 Mac 键盘

c++ - 使用 CMake 构建项目,包括使用不同构建系统的其他库

maven - 将 Spark 源代码导入 intellij,构建错误 : not found: type SparkFlumeProtocol and EventBatch