iOS模拟器:不能硬链接复制。 我的文件系统有错误的path?

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

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

第一次它总是正常工作。 如果我想再次启动,则出现错误(请参阅下面的日志)。 然后在iOS模拟器我“重置内容和设置”,我可以再次成功启动。

鉴于错误日志,我认为它必须有一个错误的path。 问题是我与Mac文件系统和path链接不好,所以你的帮助将不胜感激。

编辑 :这是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的build议,在我的虚拟设备文件夹内的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控制台的原始崩溃日志(设备名称文件夹与我在多个虚拟设备上testing过的不同,但错误始终是相同的)

 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} 

这确实是由应用程序的Info.plist文件中的某些键的顺序以及iOS模拟器的installd进程中的某个错误引发的。 installd有时似乎无法读取CFBundleShortVersionStringCFBundleVersion值。 我发现,如果RoboVM确保始终将这些值首先在Info.plist移动,它会写出我们防止installd的错误被触发。 我们现在已经在RoboVM中实现了这个解决方法(参见问题#771 ),它将在下一个版本(20150222版本)和下一版本中进行。

RoboVM的夜间版本可以从http://download.robovm.org下载&#x3002; 要安装每晚构build的Eclipse插件,您应该使用更新站点

 http://download.robovm.org/nightlies/eclipse/site.xml 

每晚SNAPSHOT构build的RoboVM Maven和Gradle插件被推送到Maven Central。

我只在“ 常规”选项卡上使用“ 版本”时将“ 生成”字段留空 设置构build值并重新安装应用程序后,该错误已消失。

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

这个问题应该在最近iOS模拟器8.2 Beta版中解决,它们是在Xcode 6.2 beta版本中。 我认为这是在beta2或beta3中解决,但我不能确定。

我遇到了使用Xcode 8.2.1相同的错误。 改变Info.plist中的项目顺序对我来说并没有帮助。 但它确实带领我走向解决scheme。 我已经将CFBundleShortVersionString和CFBundleVersion从3.0.0更改为3.0.1,但是我已经将FORGOTTEN更改为本地化和基本InfoPlist.strings文件中的3.0.1。 这样做,解决了这个问题。

findInfoPlist.strings文件。 并检查“CFBundleShortVersionString”=“1.1”的版本; 与您在Info.plist中的应用版本一致

InfoPlist.strings

选项-1:1.点击左侧栏的项目名称,转到“常规设置”。 2.将Bundle Identifier名称更改为“com.release.ABC”(ABC可以是任何其他名称,最好用您的APP名称replaceABC)3.现在运行它并享受。

选项-2:1.打开模拟器。 2.删除用户安装的所有应用程序。 运行你的应用程序并享受。 注意:每次你清理模拟器,然后再加载你的应用程序,都有缺点。

这对我来说是固定的:

 SIMULATOR_NAME="iPad Air 2" # Erase a device's contents and settings xcrun simctl erase "${SIMULATOR_NAME}" 

感谢https://encyclopediaofdaniel.com/blog/xcode-6-reset-simulators-from-the-command-line/的解释&#xFF01;

我的环境: xcode 8.3.1 iOS 10.3 (14E269) SIMULATOR_NAME="iPad Air 2"