iOS Simulator failed to install the application
Asked Answered
G

17

137

I have created a Cordova 2.1.0 app, It ran fine for the first 2-3 times. But now when I am trying to run it through terminal it is giving me the following error.I didn't change anything.

Ankurs-Mac-mini:~ ankur$ /Users/ankur/Desktop/CordovaSMS/cordova/emulate 
Ankurs-Mac-mini:~ ankur$ 2012-10-17 16:11:08.695 ios-sim[7032:507] stderrPath: 
/Users/ankur/Desktop/CordovaSMS/cordova/console.log
2012-10-17 16:11:08.698 ios-sim[7032:507] stdoutPath: 
/Users/ankur/Desktop/CordovaSMS/cordova/console.log
[DEBUG] Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain 
Code=1 "iOS Simulator failed to install the application." UserInfo=0x7fc643902320 
{NSLocalizedDescription=iOS Simulator failed to install the application.,
DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}

any help would be appreciated. Thanks

Giralda answered 17/10, 2012 at 10:54 Comment(0)
G
279

Solved the problem

Deleting contents of ~/Library/Application Support/iPhone Simulator and re-run the project solved this problem. or you can simply reset content and setting of the simulator.

enter image description here

Giralda answered 22/10, 2012 at 7:37 Comment(10)
Thanks - that did the trick. Note that in my case the alternative, iOS Simulator > Reset Content and Settings..., was NOT enough; had to remove folder ~/Library/Application Support/iPhone Simulator/6.0 (I selectively removed for 6.0 - other iOS versions were unaffected in my case).Cabman
This doesn't work in iOS 7. You will always get this error if you switch from ios 7 simulator to ios 5 sim. Deleting the directory doesn't solve the problem - you need to reset content and settings.Tavares
That's the same than remove the app from simulator, but in that case you remove all apps in all simulator.Skiles
@Ankur just added your 100th vote.. Congrats on the Great answer badgeGuadalupe
Awesome job, was giving me a major headache until I came across this solution, many thanks !Zug
I tried deleting the app from simulator and also using Reset Contents but neither did anything. I had to physically delete the contents of this ~/Library/Application Support/iPhone Simulator and also the derived data to get it to work again. I also have to close and restart Xcode as well. Very annoying because I have to do this each time I want to run the app in the simulator.Aphasia
I can't find /library/Mammet
"Resent Content Settings" does the trick but for large applications where lots of data is created/downloaded inside app, its always a headache, you have to recreate/re-download the data again and again to continue testing the app. Hope there is another solution exists which does not say "Reset Content Settings".Minimus
@devgr : i dont think you will use simulator for large number of applications. Better use deviceBelier
This is only temporary solution. Problem will go back until you apply this solution: https://mcmap.net/q/166354/-ios-simulator-failed-to-install-the-applicationBijection
B
101

Try manually launch the iOS Simulator and from the "iOS Simulator" menu, click "Reset content and settings", then close and rebuild your app.

enter image description here

Belier answered 28/6, 2013 at 12:17 Comment(3)
Best answer. it fixed my all related problems.Belier
Unfortunately this deletes all apps installed on the Simulator. :-(Meaghanmeagher
Yeah, FishStix. It just reset your simulator and deletes all the apps. If you prefer to retain the apps , try manually deleting the individual app data from iphone simulator which can be found in Finder. Hope i am helpful to you. ThanksBelier
M
33

My solution is:

reset

From menu, iOS Simulator, Reset Content and Settings. Close XCode 5.0: close project and close it from Dock and re-open the project and launch again, like in Windows :)

Mendiola answered 3/10, 2013 at 9:48 Comment(3)
Worked for me in XCode 5, when switching from iOS 7 simulator to 6.x and it suddenly stopped working.Laresa
switching to simulator 6.1 and from 6.1 need this very often. Need to make a shortcut key. I have a few screens and need to test with 6.0, 6.1, 7.0. When I am going to 6.1 and from there better to resetMendiola
This works great. I had to do a project - clean also.Pavior
E
20

I tried everything mentioned above and nothing worked. My problem was iOS 7 specific. I was finally able to resolve the issue by assigning a non-empty value to Bundle versions string, short (CFBundleShortVersionString) in the -Info.plist file. Looks like iOS 7 doesn't like an empty value for the build number. I had a script that auto increments the bundle number by 1 every time I build the project so this field was empty. I just assigned a dummy value there to get it working.

Extend answered 14/10, 2013 at 16:33 Comment(3)
This wasn't quite my problem, but your answer prompted me to change my existing value, which worked like a charm. Upvoted.Swartz
This was exactly the problem for me. I had just realized that we were not using the Build field correctly, and in our work flow, we don't have any use for it. So I cleared the Build field, but then started getting this error, and resetting the simulator doesn't fix it. Putting a value (I just chose "A") in the Build field fixed it.Leannaleanne
Crazily it will happily allow you to build for distribution without this value. Thanks for the solution!Misgiving
S
12

You can also remove the app from the simulator.

This worked for me in iOS6.1

Skiles answered 19/9, 2013 at 9:31 Comment(2)
This has the added benefit of not clearing other apps content and settings too.Althaalthea
I have faced issue even in iOS6.1Braca
A
12

Solved here: https://mcmap.net/q/168367/-xcode-error-message-quot-could-not-inspect-application-package-quot

I copied a folder into XCode 4.6.2 with the name "Resources". When XCode asked, I created the folder references for any added folders.

Every time I did this, I would have to goto the Derived applications directory, and delete the build directory for my project to get it working again.

Solution: Do not copy a folder by reference into XCode with the name "Resources". Rename it to something else other than Resources.

Very annoying error.

Argillite answered 21/3, 2014 at 3:10 Comment(3)
This bug is still present in Xcode 5 and this fixed it for me. Upvoted. Have you filed any radars that I can duplicate?Perform
Confirmed as still present for Xcode v5.1.1. This probably would have taken me hours to find the root cause of if not for this answer.Yokefellow
Too bad I didn't find this answer before... I lost half a day figuring out that my referenced folder is the cause. Though I didn't know it's because of its name. BTW. It worked fine in iOS 6.1 simulator but not 7.1.Pliner
H
5

just reset your simulator and re-run your project

Haught answered 13/9, 2013 at 5:17 Comment(0)
P
5

Unfortunately none of these solutions solved my problem. I did everything, even restarting my mac but it was still failing. What actually did solve my problem was to go to the Organizer and delete the Derived Data and Snapshots.enter image description here

Paley answered 18/3, 2014 at 17:34 Comment(0)
R
3

Had the same problem after installing XCode 5. Had no iOS 6.1 Sim or SDK. Obtained these. Tried to run the App up under the iOS6.1 Sim and go the failed to install message. Having read through all of the above posts, I decided to simply remove the App from the Simulator and re-istall, re-run from the project window and that solved it for me.

Rightism answered 14/10, 2013 at 13:56 Comment(0)
S
2

I tried ALL these things and more including reinstalling Xcode 5 and nuking every xcode and simulator preference/application support file with no luck.

Then for the hell of it, I CHANGED my short bundle version string (it already had a value, it was not empty), and it fired right up.

3 hours gone but yeah

Swartz answered 23/10, 2013 at 20:50 Comment(0)
N
1

All the answers I looked for do not work for me!. Finally The only way to make it work is as follows

  • 1.Check the version of titanium being used for the project in tiapp.xml
  • 2.right click the prject in the project explorer window.
  • 3.Select Properties
  • 4.Choose project build path. Select Titanium Mobile SDk all versions of 3.* Tick all of them.
  • 5.Now click apply and re run the project.
Neuman answered 21/4, 2013 at 16:44 Comment(0)
W
1

None of the above worked for me, I finally compared my info.plist to another project and found that I had somehow deleted the "Executable File = ${EXECUTABLE_NAME}" key/value pair, replacing it fixed the problem for me.

Wrennie answered 31/1, 2014 at 0:8 Comment(0)
C
1

This error occurs on iOS 7.0 if you leave the "Build" empty. Enter a build number!

Condemnation answered 1/8, 2014 at 2:18 Comment(0)
C
0

What worked for me was to simply delete an old version of the app, which was made in a prior version of Xcode (likely 4, now running 5) from the simulator (tap-hold, jiggle, x).

Church answered 6/2, 2014 at 23:54 Comment(0)
S
0

I encountered this problem while trying to create a build for Facebook application approval. I found that for some reason, when I used the following command line:

xcodebuild -arch i386 -sdk iphonesimulator7.1 -scheme Mana -configuration Release

the files didn't end up in [project root]/build/... (as the instructions on Facebook suggest), but in ~/Library/Developer/Xcode/DerivedData/[app name + unique identifier]/Build/Products.

I'm not sure exactly what's going on here (anyone who knows more please enlighten me!) but I was able to run the files in the DerivedData directory on the simulator. Hopefully they'll also work for Facebook!

Soybean answered 23/7, 2014 at 2:32 Comment(0)
S
0

I tried everything mentioned above and nothing worked.

Finally the only way to make it work was unsetting DYLD_INSERT_LIBRARIES=/usr/lib/libimckit.dylib

How I did this:

  1. Open terminal and typing "sudo vi /etc/launchd.conf"
  2. Changing

"setenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"

to

"unsetenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"

  1. Save changes
  2. Reboot your system

In this post [1] explain what DYLD_INSERT_LIBRARIES is for

[1] https://mcmap.net/q/168368/-xcode6-0-1-not-able-to-start-ios8-simulator-duplicate

Strohbehn answered 13/10, 2014 at 15:6 Comment(0)
Z
0

On Mavericks 10.9.5 using Xcode Version 6.0.1 (6A317) with an iOS SDK supporting 8.0 originally had Simulators all version 8 all getting this error. All the advice above was not working for me. So went to Xcode->Preferences->Downloads and saw as installable (but not yot installed) in the Components section were iOS Simulators 7.1 and/or 7.0. Went ahead and installed the 7.1 Simulators and got extra designations on the Product->Destination list Simulators of version 8.0 and 7.1, and using the 8.0 still had the same error, but the 7.1 Simulators all worked.

Zipnick answered 17/10, 2014 at 1:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.