Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode compiles my App, but can't run it in the simulator

when i compile my app, Xcode just says "Attaching to Projectname..." and gets stuck there. The debugger just prints this out:

error: failed to attach to process ID 0

I tried to clean & build again and it still doesn't work out. I googled but couldn't find anything helpful. How can I fix this problem? Thank You!

like image 518
larsschwegmann Avatar asked Mar 14 '12 12:03

larsschwegmann


People also ask

How do I run an app in Xcode simulator?

The basic way to open a list of simulators is to use Xcode -> Window -> Devices and Simulators. Here you can create and manage all available simulators. But you cannot run them directly. You need to build your application on the simulator, and then you can run it.

How do I enable simulator in Xcode?

Open Xcode and click Menu > Xcode > Preferences > Select Components, and then choose the simulator version you want to download. When a simulator is opened from AppStudio, AppStudio Player automatically installs (if necessary) and opens in it.

Can I run an iOS app on a simulator?

After you create a project, you can build and run your app on a simulated or real device without needing to lay out the user interface or write code. You may connect a real device to your Mac using a cable, or for iOS or tvOS apps, connect it over Wi-Fi after you pair it with Xcode.

Can you run an IPA file on a simulator?

Just like an APK (Android Application Package) file can be installed on Android devices, an IPA file can be used for testing iOS applications.

How do I debug an app in Xcode?

Click the Run button to build and run the app on the selected simulated or real device. View the status of the build in the activity area of the toolbar. If the build is successful, Xcode runs the app and opens a debugging session in the debug area.

Why can't I download a project from Xcode?

you may download a project that the deployment setting (the ios version) is higher than the one your xcode support. if this is your situation, you has two options to sovle the problem.

How to run iPhone apps on iPhone simulator?

Method 1 : Inside the folder Application Support -> iPhone Simulator -> In the each simulator version of iOS -> Applications -> Delete all the files present here. Now run it on any simulator and it will work. Method 2 : Show activity on this post.

How to debug code in iOS simulator?

On Xcode 9+ do the following: Go to the Xcode menu: Product-Scheme - Edit Scheme and under Run tab be sure that the Debug Executable checkbox is checked! That's it! Show activity on this post. Just reset content and settings of iOS simulator and then clean code by pressing command+shift+k keys to clean code.This worked for me


1 Answers

The solution for me was to delete everything Xcode has generated earlier:

  • the App on the Simulator...if this is not possible because you cant reach the Homescreen, you can delete the App directly under ~/Library/Application Support/iPhoneSimulator/6.0/Applications
  • delete the Derived Data in the Organizer under Projects or directly in ~/Library/Developer/Xcode/DerivedData
  • clean the Build Folder by choosing "Product" in the MenuBar and click while you press the Alt-key on "Clean Build Folder"
  • Restart Xcode
like image 94
Lindemann Avatar answered Oct 08 '22 00:10

Lindemann