Finished running <App> on iPhone 6.1 Simulator - iphone

I'm developing a new application for Iphone, using Xcode (Version 4.6 (4H127)) and the iPhone 6.1 simulator (VersiĆ³n 6.0 (369.2)).
At the beginning everything was great: every time I pressed the "run" button, the application was loaded into the simulator and I was able to test it. But sometimes it is not working: when I press the run button, I only get the message "Finished running on iPhone 6.1 Simulator". The code successfully compiles (only minor warnings).
The main problem is that when I get this message, the only way I can use the simulator again (in this project, the rest of the xcode projects seems to work properly) is by starting a new project and adding every file to it.
I've tried to delete de derived data, restart de simulator, restart de computer, etc. Even I made a snapshot when the simulator was working, but when I go back to the snapshot state, the simulator still don't work.
What can I do? Any idea?

1.Manually launch the iOS Simulator.
2.From the "iOS Simulator" menu, click "Reset content and settings",
3.Close and rebuild your app.

This problem may arise when you have problems with your project's plist's target membership. Select your info plist file from project navigator folder structure's Supporting Files, go to interface builder pane(Utilities Section under View in Top Bar), then look for Target Membership in File Inspector pane, if it is checked, uncheck it. Clean & Build, Hope it helps.

Library > Application Support > iPhone Simulator > 6.1 (or whichever you're using) > Applications > Your Application and delete it.
Rebuild your app and relaunch.

I had the same problem, with the same "failed to attach to process ID 0" (I actually didn't notice that error until I saw that you said you had that error). In one of my projects the 6.0 simulator didn't work, but works in my other projects. Also my 5.1 simulator worked.
What worked for me was based off this other answer for a similar question: https://stackoverflow.com/a/12423912/159758
Go to the Product menu and find the Edit Scheme menu there.
While in Edit Scheme window, select the "Run" option on the left hand side of the screen and then on the right hand side, change the debugger from LLDB to GDB.
Run the project, this worked in the simulator.
Then Go back to the Edit Scheme and set back to LLDB.
I noticed you've tried setting the debugger to GDB and not a debugger, but thought I'd mention what helped me, since you're question helped me get to the bottom of my problem (i.e. seeing the "failed to attach to process ID 0" message).

This problem may arise due to presence of more than one info.plist file.
I also faced a similar problem, and eventually found that while adding some resource file from another project I also added its info.plist file.
Once check your Build phases> Copy Bundle Resources, whether another info.plist file exist there or not. If exists then delete it, clean the project and rebuild it.
Hope it helps.....

I ran into the same issue and somehow was able to fix it and almost immediately it went back to being broken. I can tell what broke it though.
I added a couple of folders (folder references) with files in them to the copy bundle resources section. That broke it. If I recall right, I had removed both of those and was messing around with DeploymentTarget. I might have reset the simulator earlier. Regardless, it started working. So,
there is hope for a fix
this thing is caused by folder resources that need to be copied into the bundle
Updated:
I was able to get it working again. Here is what I did..
- Cleared out the derived data folder
- Shut down the simulator app
- Also cleared the deployment in the simulator folders (Users/XXXXXX/Library/Application Support/iPhone simulator/6.1/Applications)
Since last time adding the folders to the bundle caused it to lock up, I tried it step by step adding one folder to the bundle and trying. Turns out one of my folders was named Resources and it dawned on me that particular name could potentially be colliding with something else the app looks for. So I renamed that folder to Res and tried it. It works now.
So there you have it.. Follow the steps above to get out of the problem.
Avoid copying folders called Resources to your bundle.

Related

Unable to run app in Simulator : An error was encountered while running (Domain = LaunchServicesError, Code = 0)

I am unable to run my app in simulator after having trouble with the provisioning profile. I'm doing swift coding in Xcode 6 - beta 4. This was fine before the trouble in the certificate's profile.
I have tried cleaning the build.
Checked the command line to xCode6-beta4 for running.
Checked the build deployment, set to 7.0 so swift won't complain for compatibility
Fixed the error in provisioning.
I fixed it by resetting the simulator:
iOS Simulator > Reset Contents and Settings...
This happens if your extension's bundle ID isn't prefixed with your app's bundle ID. For example if you app is com.mycompany.appname, your extension should be something like com.mycompany.appname.today.
Something else to note, if you're using Swift and are setting a principal class with NSExtensionPrincipalClass, you'll want to make sure your extension target sets "Defines Module" to "Yes" and make the value of NSExtensionPrincipalClass equal to "YourModuleName.YourClassName".
It seems that there are multiple reasons for "domain = LaunchServicesError code = 0" error. I also encountered it, while I try to reinstall app on iOS8 simulator. I cannot reinstall but have to delete the old app first.
The problem was solved by:
In Xcode, fill empty Version or Build field with appropriate value in your Target->General->Identity
In Simulator, reset Content and settings...
After that, everything works fine.
This also happens when you remove the default StoryBoard from template created project of a Today widget. To fix this, I added the NSExtensionPrincipalClass under NSExtension and pointed it to the class containing the Today Widget View Controller, which is by template default TodayViewController.
This looks like this in the Info.plist of the extension:
NSExtension
NSExtensionPointIdentifier String com.apple.widget-extension
NSExtensionPrincipalClass String TodayViewController
Product -> Clean
iOS Simulator > Reset Contents and Settings
Restart XCode
None of the above worked for me, however deleting the Derived Data fixed the issue.
To delete the Derived Data, go to Window > Projects, select the current project, and press the appropriate delete button.
"Reset Content and Settings" from iOS Simutalor menu options and launching simulator after Quitting solved my issue.
The solution for me was not to embed a framework that hadn't been built as an embeddable framework.
Found the cause of the problem for me.
I am using ShareKit via pods. This issue is related to the GooglePlus SDK which ShareKit uses and this has to be updated due to a policy change by Apple.
http://googledevelopers.blogspot.com.br/2014/09/an-important-announcement-for-ios.html
So i replaced my pod "ShareKit" with:
pod "ShareKit/Twitter"
pod "ShareKit/Facebook"
pod "ShareKit/Pocket"
pod "ShareKit/Evernote"
Leaving out the GooglePlus sub project and the application has deployed and runs fine under 8.0 simulators now.
Hope this helps somebody else.
I have resolve this issue. thanks for the advices. :)
This issue always happens when you build your keyboard extension app with same identifier as your main bundle. like this.
If you have this "com.codemagnus.ExAppMain" in your main bundle, your extension should also have this identifier "com.codemagnus.ExAppMain" .. This will result in launch service error if you are going to run in simulator. But you can create a build. However, the issue I have found was annoying. This app can't be install in your device. :/
If you want to run in simulator. You should have this "com.codemagnus.ExAppMain.ExApp" in your extension keyboard where ExApp was you extension name. And your main bundle should be "com.codemagnus.ExAppMain".. This will run perfectly with the simulator. However will result in "Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier."
Embedded Binary Bundle Identifier: com.codemagnus.ExAppMain.ExApp
Parent App Bundle Identifier: com.codemagnus.ExAppMain
I'm still thinking and looking for a solution to solve this issue for ipa build.
This drove me crazy. I checked everything suggested here, reinstalled Xcode, restarted my computer and nothing worked. After checking some previous commits, I found out the issue.
For context, I am working on a custom keyboard extension in Objective C. Adding a new custom keyboard extension target gives you a KeyboardViewController stub class with the "next keyboard" button. I changed the NSExtensionPrincipalClass value in the Info.plist of the extension to be a class name different from KeyboardViewController and started work on it. Eventually I decided to get rid of the the stub KeyboardViewController since it was dead code.
Deleting the KeyboardViewController files and removing them from Xcode caused this problem to happen. Putting them back made the app work again.
In my case, this has resolved the issue.
Bundle Identifier should not be empty. You can find the field with the below reference:
I got this error because I mistakenly changed the value of NSExtensionPointIdentifier. I thought it was supposed to be an ID for my extension, but it has to be one of these values indicating the kind of extension it is.
I started getting this error when I changed my Deployment Target from 6.0 to 7.0. I found that resetting the simulator did solve the issue, and I needed to do this for ALL the simulators that were relevant to the app. But if I went back to 6.0 and recompiled for any particular simulator, then it worked immediately, but going again to 7.0 broke the simulator and I had to clear the settings again.
Obviously the Deployment Target affects the coding in the simulator, and the coding is downward compatible, but not upward. Plus, the log message isn't extremely helpful, saying the app couldn't be hardlinked to a cache file using a manifest (giving the pathnames to the app, cache, and manifest, of course).
Make sure you check build settings; scroll down to the very bottom and make sure your User-Defined Bundle prefix is correct. Usually com.whatever.
Just setting it at the top doesn't always change this bottom setting. This finally worked for me after resetting simulator, frying the derived folder, etc.
I'm under IOS 9.3, xCode 7.3
Xcode 7.3
This could simply happened because your target name is too long. Try change your target name to something shorter ( remember to change your bundleIdentifier to match ).
If you are using apple watch besides the bundle identifier you also have to make sure that in info.plist the key WKAppBundleIdentifier contains the right watch app bundle identifier.
I was getting the similar error while launching the app, thru xCode, "The parent bundle has the same identifier as sub-bundle..."
I shortened the Bundle Identifier in the "Project -> General" for xCode8. Initially, my bundle id was com.companyname..
The application name was more than 20 characters. Once I shortened it 12 characters, it worked for me.
To understand what is causing this error you need to go look at the simulator log files first. These are typically located in ~/Library/Logs/CoreSimulator/CoreSimulator.log or a similar location. So I'd strongly recommend you first look at the log to idenify the root cause and then research that further. (You can take a look at this thread to see where logs are located.)
For example if you get an error such as ErrorDescription=Failed to chmod /Users/username/Library/Developer/CoreSimulator/Devices/then it's probably easiest to reset your simulator. For errors such as ErrorDescription=WatchKit 2 app's bundle ID com.mydomain.AppName.watchapp is not prefixed by the parent app's bundle then there is probably an error with how you have set up the main bundle ID of your project.

iOS Project runs on simulator, physical device, but can't build or archive anymore for "iOS Device"

To distribute test builds via TestFlight, I select "iOS Device" in the scheme, then click in the menu Product, Archive. This all of a sudden stopped working with the error message:
When I try Product, Build, I get the same message. I restarted my computer, auto-recreated the schemes, checked SDK settings and they look fine to me. I loaded up a different project, and it archived fine. Here are the product and target build settings (they are the same):
My only guess is that a file may have gotten corrupted, because I didn't manually change any of these settings. Just editing code.
EDIT: After I wrote this question, I left my computer for 10 minutes. Upon my return, I tried to build and archive just for the heck of it and it worked. I don't know what to say...
EDIT 2: This is happening again and would like to get to the bottom of this.
After this happening a few times, I figured out the issue. When my iPhone is hooked up to my Mac and tethering is on, this problem occurs. When I turn tethering off, or disconnect the phone, I can archive again. Not sure why this, but I hope it helps someone at some point.

Iphone app not showing properly on the device

i have an app which works perfectly on the simulator but on the device in is not as expected.
Animations are misplaced and other bugs. But on the simulator it works fine.
My question is how to fix this bug.
Here is list of things I already tried:
Restart Mac.
Restart Xcode.
Clean Project.
Rename Project.
Delete app from iPhone.
Restart iPhone.
Shut down iPhone.
Clean and build in Xcode.
I really don't know where is the problem.
Thank you for your help.
Would be really appreciated.
Notice: App is correctly signed.
Make sure your files typed correctly and are case sensitive. The Simulator is not case sensitive but the iPhone is.
Did you ever move code/xib files into different groups or directories? Sometimes there is a old copy of the file in the original directory after the move. I've had scenarios in which those old files caused the old code to executed when switching between build settings.
If there are duplicate files, make sure you delete those copies at the old location, or those that you don't intend to be used. For instance, if your original directory as ~/Work/App/Resources and the new directory is ~/Work/App/Resources/xibs then delete the duplicated files from ~/Work/App/Resources
Make sense?
Now, after deletions, if files start to show up as red in XCode, that means XCode cannot find them anymore (maybe you deleted one too many, or who knows the state of your workspace). If this happens, use the "File Inspector" to confirm that the location and path XCode is using for the file is correct.

Xcode 4 not launching application?

Today, after installing Xcode 4 with the 4.3 SDK, I attempted to launch my application. However, the application will build and the iOS Simulator will pop up, but I get a message in the window in Xcode that says "Attaching to YourApp" which stays there indefinitely. How can this problem be fixed?
I had the same problem, that is, when I launched my application in the simulator, Xcode was hung waiting for the simulator to start. The simulator showed a black screen - nothing at all.
Note this is a project that ran fine on Xcode 3 and is the exact set of files used to build the application that is currently for sale at the App Store.
Okay, so here's the underlying problem, and my solution:
My application name was "ultimateTimer.app", as seen in Xcode under the Products folder. However, this was NOT the name in the project file.
Here's how to found out:
Click on your project in Xcode (it's usually at the top, e.g. mine is called ultimateTimer.xcodeproj). Under "Build Settings" tab, look for the "Packaging" area and specifically for the "Product Name" variable. Under Product Name, I had three entries:
Debug
Distribution
Release
Under Debug, it had the value "TalkUltimateTimer" which was an old name of mine. When I changed this to "ultimateTimer" to match the "ultimateTimer.app" as above, I found the Xcode attached to the simulator correctly.
This happened for me for iPhone applications. I opened the simulator myself and switched the device to iPhone Retina Display and from then on it worked. I tried switching back, but it didn't work again, so I have had to keep it on the Retina Display simulator, and if I need to test non-Retina Display I'll use the iPad simulator.
I skimmed the post and these seem to be the two solutions thus far:
I think I figured out the problem:
I went to 'Edit Schemes', and for some reason, the scheme I was using was pointing at BumpDev.app as the executable instead of bumpdev.app. Changing this made things work. Perhaps there is an issue when converting from xc3 proj files?
Anyways, the app now boots in the simulator. Yay!
And the other solution in that post is:
Did your project by any chance have a folder reference with images in it?
For me the problem only happens when I have a folder reference in the project. When I remove the folder reference and instead add the folder as a group, clean the project, and hit launch things work fine. In the "Copy to Bundle" phase each image is then listed individually, whereas when I had a folder reference, the whole folder was listed.
This took me a really long time to figure out. It was quite frustrating, but I'm glad I have a workaround until the bug is fixed.
I had the same problem after swapping the mouse for a new one. restarting my iMac resolved the issue.
I just upgraded to Xcode 4.3.2 and had the same issue with new projects. After poking around and comparing projects, I found out that new projects were set to the LLDB dbugger and the projects that worked were using GDB.
After changing the debugger for the new project to GDB, it worked. I am yet to research what the differences are, but at least I can now run my new projects.
Ensure you are starting a proper scheme.
I. e. when using CocoaPods, running Pods scheme would not start emulator.
It's a known issue. Have a look at this thread in the official forum.
Hey, update Xcode to 4.0.2. Problem solved :)
I had the same problem, I tried every solution here, but no works. Finally, after I rebooted my computer, the problem was gone.
Restarting the simulator worked for me

Xcode 3.1.3 breaks console output

Today has been a headache - first my upgrade to xcode 3.1.3 trashed all my certs/provisions. After two attempts, I got them fixed.
Now, I'm dealing with the issue in the subject, no console output.
Absolutlely nothing is getting printed to the console - No startup info, not when I "print" a variable from xcode when stopped on a breakpoint,
not NSLog() either.
Nothing.
I've restarted my Mac, restarted Xcode, etc. I've made it so clears the console and opens it on project build. I had GDB log to a file,
and that works, so the plumbing is cool. Its just the console itself is dead.
Image: (and this is after attempting to print the contents of a variable while the app is running)
http://mr-sk.com/iphone/screen-capture-2.png
It doesn't seem to matter if I'm on the device or the simulator ...
That looks like the split bar is pinned all the way to the right side. Look for the dimple and drag it back toward the right.
I'd also try asking in the iPhone developers portal forum, since you can ask about beta versions of stuff there...
This is an older post, but I just recently ran into this with 3.2.3, so if someone happens upon this the answer by cdespinosa was spot on, however many of us "noobs" may not know exactly where to find those files, so just in case...
Go to Finder, find the folder where you have your .xcodeproject file and right click on it and click on show contents of this package. When the new window appears, move the .perspective, .mode, .pbxuser files to trash. (Make sure XCode is closed when you do this...I happened to do this while the project was open like an idiot and didn't think it worked the first time)
Now reopen xcode and your project. Your console should now be fixed.