iOS模拟器:无法复制硬链接.我的文件系统中的错误路径?

Don*_*Don 13 xcode ios ios-simulator robovm

我使用的是Xcode Version 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>
Run Code Online (Sandbox Code Playgroud)

还有我的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>
Run Code Online (Sandbox Code Playgroud)

由于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>
Run Code Online (Sandbox Code Playgroud)

来自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}
Run Code Online (Sandbox Code Playgroud)

sch*_*dt9 50

我只使用" 常规"选项卡上的" 版本"将" 构建"字段留空时遇到此错 设置构建值并重新安装应用程序后,错误消失了.

  • 需要删除并重新运行 (4认同)

Jer*_*oia 9

如果您将应用程序的Info.plist从一个版本更改为下一个版本(例如加速CFBundleVersion或类似版本),我认为问题会更加严重.如果你这样做,你应该在每次启动之间(通过SpringBoard或使用simctl)从模拟器中删除应用程序,或者只是擦除sim设备.

这个问题应该在Xcode 6.2测试版中最近的iOS模拟器8.2测试版中解决.我认为它已在beta2或beta3中得到解决,但我无法回想起来.


小智 6

实际上,这是由应用程序的Info.plist文件中某些键的顺序触发的,并且似乎是iOS模拟器installd过程中的错误。installd有时似乎无法读取CFBundleShortVersionString和CFBundleVersion值。我发现,如果RoboVM确保始终先将这些值移动到Info.plist它的位置,它将被写出,这样可以防止installd触发错误。现在,我们已经在RoboVM中实现了此变通办法(请参阅问题#771),它将在下一个每晚版本(20150222版本)和下一版本中使用。

可以从http://download.robovm.org下载每晚构建的RoboVM 。要安装Eclipse插件的每晚构建,您应该使用更新站点

http://download.robovm.org/nightlies/eclipse/site.xml
Run Code Online (Sandbox Code Playgroud)

RoboVM Maven和Gradle插件的每晚SNAPSHOT版本会推送到Maven Central。


ren*_*ene 5

我使用Xcode 8.2.1遇到了同样的错误.更改Info.plist中项目的顺序对我的情况没有帮助.但它确实引导我走向解决方案.我已经将CFBundleShortVersionString和CFBundleVersion从3.0.0更改为3.0.1,但我已将FORGOTTEN更改为本地化和基本InfoPlist.strings文件中的3.0.1.这样做,解决了问题.


Nal*_*ene 5

找到InfoPlist.strings文件。并检查“ CFBundleShortVersionString”的版本是否为“ 1.1”;与您的应用在Info.plist中的版本一致

InfoPlist.strings