All of the sudden I cannot run the iOS Simulator properly. The built-in apps no longer work (Contacts, Safari, etc.). I can however build and install my own app.
I attempted to access the contacts app so that I could manually add a contact but then I get the error "The simulated application quit."
If I launch the simulator within XCode by running my app, selecting Hardware > Home, I can then open the built-in apps, including contacts, but then I cannot add a contact as it crashes. I reset the simulator, as well as moving the SQL DB for contacts out of the way.
I am running Xcode 4.3.2, and the simulator is located in...
XCode4 > Platforms > iPhoneSimulator.platform > Developer > Applications
Any recommendations? What could suddenly cause this? The error does not appear to be related to my code since it exists entirely with the simulator at this point.
Note: I upgraded to Lion from Snow Leopard so that I could run Xcode 4.3.2. This was a few weeks ago.
Scenario #1
Reboot
Open the iOS Simulator App located at XCode4 > Platforms > iPhoneSimulator.platform > Developer > Applications
Select any app. For example, the Contacts App or Settings or Safari or Photos.
Simulator crashes with the error "The simulated application quit."
Scenario #2
Reboot
Open Xcode 4.3.2.
Build and run the application I am developing which accesses the contacts app.
Application runs
Select Hardware > Home
Built-in apps open and run fine, EXCEPT the contacts app.
Launch contacts app
Select the '+' button to add a contact.
Try to enter the First Name.
Simulator crashes with the error "The simulated application quit."
UPDATE: I found a work-around. I should have clarified that I was running in iPad mode with the simulator. I switched to iPhone mode and was able to add a contact with no problems. I then switched back to iPad so that I could continue development. My app is a universal app and has no problems accessing contacts within SDK code. I conclude at the moment that there is either a bug with the simulator with contacts or something got bugged some how. Anyway, I am up and running again. The next step is to update to the latest Xcode 4.3.3. However, I do not want to do so during heavy development. I will update when I am able to.
Have you tried uninstalling/reinstalling Xcode and the Developer tools?
Related
I'm creating a flutter plugin and I just tried the example project that gets created by flutter it self. This example project is an app that shows the operation system and its version. If I start it from Xcode on my iPhone SE, it works fine.
But if I close the app and open it without Xcode, that means that I tipp on the app icon to launche it, like every normal app, it doesn't start correctly.
It is showing for not even a second a white screen, followed by a black screen and is closing the app right after this.
Why is it behaving like that?
Is it, because it is a debug version and needs Xcode?
How can I put my example app on my iPhone without needing a connection to Xcode to start it?
Thanks in advance!
Edit: Thanks to the answer of Răzvan Puiu below, i know now that this is because xCode puts the app as a debug version on my iPhone. This debug version can only run with xCode. After I tried it with a 'normal' app and not the example app of a plugin project, i even got this text shown if i tried to start the debug version without xCode:
So the solution is to run the app with:
flutter run --release
I believe it behaves like that because you don't have an Apple developer account. "Without enrolling in the Apple Developer Program, your app will only last for 7 days on your device. After that, you’ll have to re-deploy it to your device via Xcode. If you’re enrolled in the Apple Developer Program, you won’t have this inconvenience."
Yes
You can run flutter run --release and then select your physical device. However the app will remain on your phone for only 7 days unless you have the Apple dev account.
I have been trying unsuccessfully to profile my device (via Instruments) using the latest version of Xcode 7.0.1 (7A1001 released 9/28), as well as the previous version of Xcode 7 (7A218), as well as Xcode 7.1 Beta 2 (7B75).
My device is an iPhone 6+ with iOS 9.0.1 installed - the latest GM release of iOS9. I am able to run / debug applications on this device without issues.
In the screenshots below you can see that my device is disabled (greyed out) in all screenshots in all versions. I am able to profile other devices running iOS 8.4.1 without any issues.
Does the current version of Xcode not support profiling against iOS 9.0.1 or is there some kind of configuration setting or known work around for this?
Xcode 7.0.1:
Xcode 7.0:
Xcode 7.1 beta 2:
TL;DR - Perform a complete reboot of your device; restart Xcode & instruments; select "Open Xcode" if prompted to enable the device for development.
Update 3/31/2016: I haven't encountered any issues with the latest version(s) of Xcode (7.2.x, 7.3), so it seems that the stability here has been improved.
I believe I may have finally gotten this to work properly. Detailed steps:
Unplug the device from your Mac & power down the device completely (hold the power button for several seconds; slide to power off).
Close Xcode and Instruments.
Restart the device & once it has booted completely re-connect it to your Mac.
Re-launch Xcode. Here, my device showed as disabled and Xcode indicated that the device was not available for use.
Open your project; clean (Shift+Command+K), Build (Command+B), Profile (Command+I).
After Instruments launched I noticed that the device was enabled. Upon selecting it, a message was displayed with the title "Enable this device for development?" and message "This will open Xcode and enable this device for development." (Note that this only happened to me the first time I went through this process even though I had already been using the device for development - whereas some users have also reported that they are not presented with this dialogue.)
Click "Open Xcode". Here Xcode did not prompt me for anything nor was anything displayed - no additional messages indicating anything had been done or that the device was or was not available for development. Opening the Devices window, the device appeared to be available. (I have not been presented with this option for subsequent occurrences.)
Now I was able to select the device in Instruments and profile it.
As a side note, I was also again able to delete installed apps from the Devices window (I realized that this was not possible to do previously).
I'm unsure how my device ended up in this state however I will be on the lookout to see if this continues to occur.
Please note that this was done using Xcode 7.0.1.
Update: My device seems to lapse back into not being able to be used for profiling some time after performing these steps - I've had to reboot my device again in order for it to be available for profiling. Not sure what is triggering this behavior but I will file a Radar for this.
Close instruments -> reset your device by long pressing home and power button -> restart instruments. Works for Xcode 7.3.
According to Apple staff on the developer forums the behaviour of this issue is greatly improved in the Xcode 7.3 betas, so one easy solution is to try upgrading Xcode. I've upgraded and it seems to be behaving so far.
This issue still occurred with XCode 10.3 and iOS 12.4.2
I restarted the device only, and it worked.
I have the iOS 9.3 beta installed on a testing device as I'm running a few 9.3-compiled apps, but I also have an old app that is compiled in Xcode 7.2. I can run the app on any iOS 9.2 device with ease, but if I try to run it on the one iOS 9.3 beta device, I get the "could not find Developer Disk Image" error.
Xcode 7.3 includes some updates to Swift, so I'd have to change a great deal of my files, and I just want to test to see if it's working fine. Is there any way to do this without having to change a lot of Swift code? It's on the App Store compiled for 9.2 and I can run it on my 9.3 device, so I don't understand why it's so difficult.
If you want to avoid the beta version of Xcode from potentially altering your original project, just make a copy of the project and then just open it up in the beta version. If you have an app running in Swift 2.1.1 (Xcode 7.2), the differences to Swift 2.2 (Xcode 7.3) are pretty modest. And if you do this with a copy, you can be confident that your original project won't be altered.
If you don't want to do that for some reason you can install apps from a production version of Xcode on a device running a beta version of iOS:
First, you want to make sure you have the profiles installed on your beta iOS device. The easiest way to do this is to run some "Hello World" app on your beta device from the beta Xcode. If prompted to add a team/profile onto your device, you should go ahead and do so, like usual.
Quit the beta Xcode and start the production Xcode and open the project for the app you want to install. Select "Generic iOS Device" where you choose the active scheme in jump bar and then build the app. You should then see the .app file (not in red) in the Products folder in the "Project Navigator" tree in the left panel.
Install the app on the device by opening the devices window (shift+command+2) and selecting the device in question. In the right panel (or top right panel if you're showing the console, too), you'll find a "Installed Apps" section. Just drag the .app file from the Products folder into this installed apps section.
Clearly, if you have other apps you want to install, you can just repeat steps 2 and 3 as appropriate.
There are a bunch of different ways to install an app on a device, but I find this is the easiest for one-off installs with a device sitting in front of me. You won't be able to debug if you do it this way, but you can at least fire it up, run it through its paces, watch the device console for any debugging messages you may be NSLog'ing, etc.
I have been packaging an app that has been build using Cordova (Dev team is somewhere else) and I have just changed the bundle identifier to match our Enterprise Developer license (identifier like xxx.xxx.AppName from yyy.yyy.AppName). The starting point of the app is an html page and it is perfectly working on iPad simulator in Xcode but If I choose iOS device in Xcode (my iPad) only white color screen is shown up for as long as the app is opened and also it doesn't showing any error message (In Safari Developer mode there is no respectable application under my iPad option). What would be the cause. please help me guys...
App Details,
Hybrid app
Target platform is >= iOS 6
Device - iPad (only for iPad)
Thanks
The problem was on the Javascript files we were using and one of the file wasn't rendered correctly since it was referenced wrongly. So eventually we found it and correct it. Guys, for Cordova kind of app, if it behaves similarly, just check are there any java script errors then ensure it before proceeding further.
Ive added a new device (iPhone 5s) to test my app using xCode 5.0.2. The app installs onto the phone without running in Xcode.
When you select the play button on Xcode, the app builds successfully and installs the app. If you open the app on the iphone it works well - when you close the app on the iPhone, Xcode crashes !!!!
Its kind of working as neat way of getting the app onto a device without load time - but I need to see my logs in Xcode as the app is running on my device.
you need to make sure that you keep the device connected to the computer and thus Xcode while running the app, any NSLog you have or error you get will show up