I am using Xcode Version 6.1 (6A1052d)
I am trying to launch an app on the simulator.
The first time it always works fine. If I want to launch a second time, I have an error (see log below). Then in iOS simulator I "Reset Content and Settings" and I can launch again successfully.
Given the error log, I think it must have something to do with a wrong path. The problem is I am bad with Mac filesystem and path linking, so your help would be much appreciated.
EDIT: Here is the info.plist.xml (generated by LibGDX if it matters)
<?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>
And my 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>
I have tried to identify more precisely the error thanks to the advice of Jeremy, in the system.log inside the folder of my virtual device. The system.log has a lot of entries around the time of the crash, so I might have missed something... Anyway I have found these potentials errors:
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>
The original crash log from Eclipse console (device name folders are different as I have tested on multiple virtual devices, but the error is always the same)
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}
This fixed it for me:
Thanks to https://encyclopediaofdaniel.com/blog/xcode-6-reset-simulators-from-the-command-line/ for the explanation!
My env:
xcode 8.3.1 iOS 10.3 (14E269) SIMULATOR_NAME="iPad Air 2"
Option-1: 1.Goto "General Setting" by clicking on the project name on left side bar. 2.Change the Bundle Identifier name to "com.release.ABC" (ABC may be any other name. It's better to replace ABC with your APP Name) 3. Now run it and Enjoy.
Option-2: 1.Open Simulator. 2.Remove all apps installed by user. 3.Run your App and Enjoy. N.B: It has a demerit that every time you clean the simulator and then after, you will able to load your app.
I faced this error while leaving Build field blank using only Version on General tab. The error has gone after setting a build value and reinstalling the app.
I had this issue too for a long time. I tried most of these solutions. I'm sure they worked for some people, but not for me...
Then I noticed in "Embed Frameworks" there is a flag for "Copy only when installing"... I ticked it. This problem went away.
Make sure both the field filled with some value.
I experienced this issue in a multi-target project. After duplicating a target I forgot to change the "Product Bundle Identifier". Once I changed this parameter into a unique value (see tab "Build Settings"), the error disappeared.
EDIT
After changing the "Product Bundle Identifier" you must erase all content and settings from the simulator and clean your build folder in Xcode (Cmd+Shift+K).
I'm using Xcode 10.1.