iOS模拟器:无法进行硬链接复制。我的文件系统路径有误?

17

我正在使用 Xcode 版本 6.1 (6A1052d)。

我试图在模拟器上启动一个应用程序。

第一次启动总是很顺利的。如果我想再次启动,就会出现错误(请参见下面的日志)。然后在 iOS 模拟器中,“重置内容和设置”,我就可以再次成功启动。

根据错误日志,我认为这一定与路径错误有关。问题是我对 Mac 文件系统和路径链接不熟悉,所以非常需要您的帮助。

编辑: 以下是 info.plist.xml(由 LibGDX 生成,如果有影响)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>${app.name}</string>
    <key>CFBundleExecutable</key>
    <string>${app.executable}</string>
    <key>CFBundleIdentifier</key>
    <string>${app.id}</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>${app.name}</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>${app.version}</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>${app.build}</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>UIStatusBarHidden</key>
    <true/>
    <key>UIDeviceFamily</key>
    <array>
        <integer>1</integer>
        <integer>2</integer>
    </array>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
        <string>opengles-2</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <!-- <string>UIInterfaceOrientationPortrait</string> -->
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>CFBundleIcons</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>Icon</string>
                <string>Icon-72</string>
            </array>
        </dict>
    </dict>
</dict>
</plist>

我的robovm.xml文件:

app.version=1.0
app.id=<my package name>.IOSLauncher
app.mainclass=<my package name>.IOSLauncher
app.executable=IOSLauncher
app.build=1
app.name=<my app name>

我已经尝试通过Jeremy的建议,在虚拟设备文件夹中的system.log中更精确地识别错误。在崩溃发生时,system.log有很多条目,所以我可能错过了一些内容... 无论如何,我找到了以下潜在错误:

Nov 28 09:03:44 As-MacBook-Pro installd[668]: 0x10e3d0000 createDictFromFile: open failed for /Users/<myname>/Library/Developer/CoreSimulator/Devices/D1C6E4CE-ABF3-4621-B811-913F1705CBE0/data/Containers/Bundle/Application/CA2B6D8C-1A62-4DA6-8433-AA4678D009E1/ManifestCache.plist : No such file or directory

Nov 28 09:03:44 As-MacBook-Pro installd[668]: 0x10e4d6000 writeDictToFile: ==== Successfully wrote Manifest cache to /Users/<myname>/Library/Developer/CoreSimulator/Devices/D1C6E4CE-ABF3-4621-B811-913F1705CBE0/data/Library/Caches/com.apple.mobile.installd.staging/temp.gCGKCY/extracted/ManifestCache.plist

Nov 28 09:03:44 As-MacBook-Pro installd[668]: 0x10e3d0000 validate_stream: Got manifest for version "1 1.0", but expected version "1 "

Nov 28 09:03:44 As-MacBook-Pro installd[668]: 0x10e3d0000 hardlink_copy_hierarchy: Failed to open manifest /Users/<myname>/Library/Developer/CoreSimulator/Devices/D1C6E4CE-ABF3-4621-B811-913F1705CBE0/data/Library/Caches/com.apple.mobile.installd.staging/temp.gCGKCY/extracted/com.apple.deltainstallcommands.<my app.id>

来自Eclipse控制台的原始崩溃日志(设备名称文件夹因为我在多个虚拟设备上测试,所以不同,但错误始终相同)。
11/27/14 9:58:17 AM: [ERROR] Session could not be started: 
Error Domain=LaunchServicesError 
Code=0 "Unable to run app in Simulator" UserInfo=0x7fc8eb900d70 
{Error=PackagePatchFailed, ErrorDescription=Could not hardlink copy 
/Users/<myname>/Library/Developer/CoreSimulator/Devices/055A18BC-73B5-4EA6-A872-488FA69F4750/data/Containers/Bundle/Application/CCF8C472-C48F-41D7-8885-E83830256EE3/IOSLauncher.app 
to 
/Users/<myname>/Library/Developer/CoreSimulator/Devices/055A18BC-73B5-4EA6-A872-488FA69F4750/data/Library/Caches/com.apple.mobile.installd.staging/temp.TsGEn1/extracted/Payload/IOSLauncher.app 
with manifest 
/Users/<myname>/Library/Developer/CoreSimulator/Devices/055A18BC-73B5-4EA6-A872-488FA69F4750/data/Library/Caches/com.apple.mobile.installd.staging/temp.TsGEn1/extracted/com.apple.deltainstallcommands.<pathtomyappexec>, 
NSLocalizedFailureReason=An error was encountered while running 
(Domain = LaunchServicesError, Code = 0), 
NSUnderlyingError=0x7fc8ebb1a500 "The operation couldn’t be completed. 
(LaunchServicesError error 0.)", 
NSLocalizedDescription=Unable to run app in Simulator}

请提供更多信息。具体来说,请查看~/Library/Logs/CoreSimulator/055A18BC-73B5-4EA6-A872-488FA69F4750/system.log,以获取可能描述正在触发此问题的故障错误消息。请在出现错误的时间周围寻找来自installd的消息。 - Jeremy Huddleston Sequoia
你好 @JeremyHuddlestonSequoia,感谢你的回答。我看过你在另一个问题中的回答,它确实接近我的问题。但是我无法在那个问题中提供更多有关我的错误的细节,所以我在这里编辑了我的问题。我可能已经找到了错误的可能来源,希望我挑选了正确的行(日志很长,即使在崩溃时也是如此)。 - Don
您IP地址为143.198.54.68,由于运营成本限制,当前对于免费用户的使用频率限制为每个IP每72小时10次对话,如需解除限制,请点击左下角设置图标按钮(手机用户先点击左上角菜单按钮)。 - Don
是的,这就是如何将设备恢复到默认状态。您也可以像在真实设备上一样删除应用程序(长按主屏幕,然后点击x),或者使用另一篇文章中描述的simctl。 - Jeremy Huddleston Sequoia
嘿@JeremyHuddlestonSequoia,我已经附上了info.plist文件。 - Don
显示剩余4条评论
14个回答

0
在我们的情况下,问题是在产品名称中使用了瑞典语的 "Å" 字符。必须使用用户定义的设置来代替显示名称,然后从模拟器中卸载该应用程序,可能还要清除构建文件夹。

0
在我的情况下,这个错误是由于产品名称中的Unicode字符引起的。
使用Ascii替换产品名称即可消除错误(请注意,显示名称是应用程序图标下方显示的应用程序名称,因此不必担心更改产品名称)。

enter image description here


0
在我的情况下,是一个文件没有包含在模拟器应用程序中。只需删除模拟器应用程序,清理、重新编译并启动它。添加文件时,请确保启用了“必要时复制项目”复选框。

-1
Select Project from Navigation window -> TARGET -> General -> Build or Version

确保两个字段都填写了一些值。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接