Xcode 4 freezes when connected to (application name) when debugger is installed in LLDB

When I run the application in the simulator, Xcode hangs on Attaching to (application name), but this only happens when the debugger is installed in LLDB. An application works fine when the debugger is set to GDB (Product-> Edit Scheme → Run → Debugger) How can I fix this for debugging with LLDB without an Xcode widget when attached to (application name)?

+6
source share
7 answers

I found this to happen from time to time, but usually restarting either the simulator or device, restarting Xcode and clearing your derived data directory does the trick.

0
source

I had the same problem and decided to follow these instructions Why does LLDB Debugger not constantly connect? I just added an entry in / etc / hosts translating localhost as 127.0.0.1 and it worked fine.

+2
source

I found that Xcode should access localhost when the debugger is installed in LLDB. Thus, you will always receive the error message "failed to connect to process ID xxxx" if your hosts file is configured incorrectly. Here is the trick:

  • Try $sudo file /etc/hosts . If the output is /etc/hosts: ASCII English text, with CRLF line terminators , you need to change its file format to UNIX format. There are many ways to achieve this. My preferences:

    • Open the hosts file with $sudo vim /etc/hosts .
    • Enter vim command line mode and change the file format by typing :set ff=unix and return.
    • Make sure your hosts file contains the following line: 127.0.0.1 localhost
    • Save and close by typing :wq and return.

    Now try $sudo file /etc/hosts again, you will get /etc/hosts: ASCII English text .

  • Change the resolution of the hosts file. $sudo chmod 644 /etc/hosts
  • After you have completed all of the above, try $ping localhost and you will get the answer as 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.037 ms instead of ping: cannot resolve localhost: Unknown host .
  • Restart Xcode and the simulator.
+1
source

Xcode 4.5.x scuppered lldb (used gdb instead) and git (used instead SourceTree instead), and they were magically enabled when upgrading to Xcode 4.6.2

0
source

This is a very simple step ... For me, it was a big problem, as I was stuck in "attaching to myApp" every time, and Xcode also became immune.

In the "Product" section of the menu bar, go to the diagrams and click "edit diagrams". A window will open, and under the info tab, change the "debugger" from LLDB to GDB for each project. It works every time for me! Hope this answer puts an end to every problem with this question.

0
source

open your terminal and enter the following command.

  sudo nano /private/etc/hosts 

press enter. then it will ask for your password for Mac. After entering the password.

GNU nano 2.0.6 File: / private / etc / hosts

## # Host database # # localhost is used to configure the loopback # interface when the system boots. Do not modify this entry. ##

127.0.0.1 localhost

255.255.255.255 broadcasthost

:: 1 localhost

fe80 :: 1% lo0 localhost

When you have made the changes, press Control-X to exit the editor, Y to save,

0
source

Updating the latest available OS fixes the problem. In my case, I used Yosemite 10.10.5 and I upgraded it to El Capitan 10.11.1. Then I launched Xcode 7.0.1, additional components were installed for xcode, and the problem was resolved.

I believe that additional components for xcode were missing. Or, you may need to force an OS update for Xcode and Simulator to work properly.

0
source

Source: https://habr.com/ru/post/917433/


All Articles