LLDB RPC server freezes app - xcode

For the past months I have not been able to debug macOS or iOS apps through Xcode. What happens is the following:
Build and run app from Xcode.
Xcode says app is running, but no app has appeared and no debug output from app either.
Kill the process lldb-rpc-server.
App appears and runs as normal, but Xcode is no longer debugging.
Start a new debugging session by attaching it to the app's process.
App freezes again, until lldb-rpc-server is killed.
This OpenRadar has the same description.
I have tried re-installing Xcode (including command-line tools), but it didn't help. Any ideas?
Xcode: Version 9.3.1 (9E501)
MacOS: 10.13.4 (17E199)

The cause of this was that I had installed a GDB/LLDB-extension called Voltron. I was unaware that the installation also created/modified the .lldbinit in the home folder. Removing this file fixed the issue. See also this issue for Voltron.
Got some very good help from Apple.

I had received this warning msg when device was locked and I was running app on device, so when device is unlocked this warning goes

Related

Xamarin.Forms app, works in simulator, started hanging on iOS Devices: dynamic-codesigning entitlement Error

My app has started failing on devices seemingly out of the blue. When debugging it just hangs and sits there. Doesn't crash. I've found the following errors in the device log:
Error (0) / kernel(Sandbox): TUE.myiOSApp(629) System Policy: MAP_JIT requires the dynamic-codesigning entitlement
Error (222) / DTServiceHub(FrontBoardServices): [FBSSystemService][0x658f] Sending request to open "com.MyAppName”
Error (589) / SpringBoard(FrontBoard): [com.MyAppName] Provision violated for watchdog scene-create: <FBSProcessResourceProvision: 0x1c54fa400; allowance: <; FBSProcessResourceAllowance; type: realTime; timeValue: 18.57s>; violated: YES>
Error (589) / SpringBoard(KeyboardArbiter): [<_UIKeyboardArbiterHandle: 0x1c4115720; PID 631: com.MyAppName <(null)>; hosting PIDs {(
Error (589) / SpringBoard(KeyboardArbiter): -[_UIKeyboardArbiter runOperations:onHandler:]_block_invoke Failed to access <_UIKeyboardArbiterHandle: 0x1c4115720; PID 631: com.MyAppName <(null)>; hosting PIDs {(
I noticed another line that mentioned the process wasn't killed by the OS because it was being debugged.
This started happening right after I added a new device to the developer profile at the Apple Developer portal. I redownloaded the profile and installed it in xCode and in Visual Studio for Mac. The first time I ran the app on the new device, it ran successfully and I could debug. After that it started freezing. It also freezes on the old device I had been debugging successfully on just moments prior.
I've tried cleaning the solution, deleting all bin/obj folders. Restarting the device. Rebooting my Mac, etc.. nothing works.
I've dug around a little bit regarding the MAP_JIT error, however, the only answers I've found is to ensure Xcode is up to date. I'm on Xcode 11.3.1 and the command line tools are installed.
I updated to the latest version of Visual Studio for Mac which did not solve the issue
Any ideas?
Thanks!
Sean

Message from debugger: unable to attach error for osx app

I have been building mac app on my mac mini and it always worked well but today i faced this error, searched a lot but no luck.
Message from debugger: unable to attach
What i tried:
Clear derived data
Quit Xcode
Restart machine
installation directory set to blank and also to /Applications
Tried Skip Install No / Yes
Using developer Signing certs
M using only Developer certificates and not provisioning profile to sign my cocoa app
Xcode 8.2
OSX 10.12.1
Please help :)
This is what fixed it for me, perhaps it will help others but I do realize the question was for 8.2. I had it set to Xcode 9 "New Build System" disabling this and switching to "Standard Build System" in the Project Settings under the File Menu. I had tried all the other things like killing DerivedData, clean build, restarting Xcode. I also verified that my dependent libraries were set correctly. The only thing that worked was disabling new "New Build System"
I just had this problem today. I have little demo code in a mac project(created with Xcode 9.4). This error just started to occur after I upgraded system to macOS Mojave 10.14. However, in Xcode 10 this project runs no problem(without changing anything). If you can use Xcode 10 it will probably be fixed.
Unfortunately, the above solutions didn't work for me (although I am sure they work for some people).
Here is what worked for me, in case this helps anyone else:
Close Xcode
Open Xcode and Create a new Xcode project
In the iOS template, select Single View App then click Next
yes, I know you are trying to get a macOS app attaching to the debugger :).
Give the iOS app any product name and organization identifier you would like and click Next
Create the new project anywhere you would like (I saved it to my desktop)
Build and run (cmd + r) the iOS app on a simulator like the iPhone 8 (starting a simulator and running the iOS app will take a little time, so have patients)
After the iOS app runs in the simulator, click to stop it from running (the stop button is next to the run button)
Open your macOS app that you are having trouble connecting a debugger to, and build and run it (cmd + r)
This, for some reason, allowed me to connect to the debugger with my macOS app...
Xcode version: 10.1, macOS Mojave version: 10.14.2

Xcode 7.3 wont attach to simulator to debug

So I upgraded to Xcode 7.3.1 and now my Xcode will build, and deploy my apps (yes every app, even a brand new blank one) to the simulator but the app never launches on the simulator and the debugger never attaches, Xcode just hangs and has to be force quit. I've completely wiped out Xcode and all simulators and re-installed to no avail. I've scoured Stack Overflow and Google trying every piece of advice and still no luck. Anyone anywhere have any idea how to solve this issue? If I downgrade to 7.2.1 I'm able to debug in the simulator just fine.
Let me know if you need more information.
My Apps run just fine on the simulator, and if I try to attach the debugger to a running app it wont and Xcode hangs in the attempt, when attempting to attach this way at least Xcode doesn't have to be force quit.
FYI, I can debug on a device this is only a simulator issue.
I had this same issue, and tried fixing my projects and reinstalled Xcode twice before I was able to get Simulator to crash and give me an error report that called out Cylance. Luckily I have access to administer our Cylance portal, so I was able to work through the issue to narrow down the problem.
Symptoms:
When running an app from Xcode, the Simulator launches but the application does not launch within the Simulator
Trying to stop the application from within Xcode does not work, and generates no messages
Trying to re-run the application from within Xcode generates the following message: ‘An instance of “APPLICATION NAME” is already running. Choose “Stop” to terminate and launch a new instance.’ But pressing Stop does nothing.
Xcode will not quit, and eventually the user must Force Quit to exit Xcode
Within the OS X console, the following messages are displayed:
6/3/16 7:35:38.000 PM kernel[0]: AMFI: com.apple.dt.ins(pid 2239) - [deny-mmap] main process is a platform binary, but mapped executable file is not: /Library/Application Support/Cylance/Desktop/CyMemDef.dylib
6/3/16 7:35:38.000 PM kernel[0]: AMFI: com.apple.dt.ins(pid 2239) - [deny-mmap] mapped file has team identifier XXXX: /Library/Application Support/Cylance/Desktop/CyMemDef.dylib
Resolution:
The problem is caused by Memory Protection being turned on within the policy assigned to the Mac within the Cylance portal.
To resolve the issue, place the Mac into a zone/policy that does not have Memory Protection turned on. Auto Quarantine and Protection Settings can be left on.
During my testing, I was not able to come up with a list of exclusions that allowed me to leave Memory Protection on, so I ended up disabling it completely.

Xcode Run Apple Watch target results in Finished running app on Watch

I am trying to debug my watch app. I build and try to run as usual. It says Build succeeded, installing to watch etc. but then, instead of launching my app, it says Finished running app on watch. I've restarted Xcode, reinstalled my app on watch etc. but no avail.
What am I doing wrong?
I've also restarted my Mac, my iPhone and my Watch. It then worked.
I restarted everything and it still didn't work. However, after the restart when I first run the app I received an error: Device doesn’t support wireless sync. With this, after disabling the wifi on the watch, things went back to normal.
From my experience, restarting all devices (iPhone, watch, and mac) sometimes allows the app to build on the watch, but it is very frustrating and a long process for a "maybe."
Especially when I get the Device doesn't support wireless sync. the most consistent solve has been disabling wifi on both the watch and the iPhone. Also, have the iPhone connected directly to the computer with a genuine cord.
Good luck.
Also, if you were using the simulator, stop it and quit the simulator before trying to compile to the real device.
You just have to attach the Xcode debugger to the process which is running on the watch!
Xcode -> Debug -> Attach to Process > "name of your app watch extension"
After that Xcode displays "Running ... Extension on Apple Watch" and you can start debugging

Xcode 4 Error: Error Starting Executable

I ran into problem with testing my app on iOS and Xcode when I am uploading it to my actual devices (iphone and iPad), and I'm wondering if someone knows the issue and can help me out:
Normally when I build my app on my devices, the app is installed and launched on my devices. But as I am preparing for submitting my first app I was testing around and changing the Bundle Identifier, App ID, and Development Provisions (so the issue may have something to do with it), and now, when I try to build my app on my devices, although it's installed on my devices fine, Xcode will not launch the app anymore. Instead, I got this error message:
Error Starting Executable.
Error launching remote program: No such file
or directory.
Does anyone know what the issue is? And What is this derived data folder about?
Much thanks!
I have also faced that problem. I have closed, restarted Xcode; deleted the application from device and reinstalled it again, then the problem has gone.
Running App from a Clean Slate
For me the problem did not resolve until I did the following in this order:
Delete the app from the device (Do this before trying to debug again)
Quit XCode (Don't just close the project)
Delete the app build folder (example path: /Users/myusername/Library/Developer/Xcode/DerivedData/MyProject-fhkaamuyvqhubaezinqbmxbnaufd/)
Restart XCode
Finally -- Try debugging again on the iOS device
The app build folder of step 3 refers to your app's build folder that is a child of "DerivedData". To find this you can reveal your app in finder, then backtrack until you get to "DerivedData" folder and delete the folder above that like "MyApp-crazylongweirdletters". Without this step (3), I could not debug, so this is a critical step and you must quit XCode before you do this step.
For some it appears simply restarting XCode does the trick, but not for me.
I only post this answer because the earlier answers did NOT work for me. Hopefully others banging their heads will find this and get a sigh of relief. :)
Notes:
The issue started happening for me when I modified the bundle id of the app.
My code signing is and was correct. My provisioning profile was the "Team Provisioning Profile" which should work for any app id (default for "iPhone Developer" automatic profile selector).
I was doing a DEBUG build (not release / distribution).
You cant debug (start from Xcode) an application signed with a distribution profile if I remember well... And then you get such messages, gdb failling to attach to process.
I finally found my error!
I was playing around with my info.plist file, and I changed the Executable Name and Bundle and Bundle Display name! As soon as I changed those back to the Defaults (EXECUTABLE_NAME, PRODUCT_NAME, PRODUCT_NAME respectively) it worked perfectly.
Delete the app from the device (tap-and-hold then delete) and try again.
For me, none of those worked. Same error, but different solution.
My problem was cause by me accidently changing the "Deployment Target" (ios version) to a version higher than what was on the phone I tried to run the code on.
The fix was simple - drop the deployment target to below or equal to the ios software version on my phone :)
I got the same error by not having my code signing correct.
Go to your project > Targets > Build Settings > Check code signing for debug state.
I stumbled upon this as a solution to another issue whch was a warning when trying to build an app on a new 4.3.5 device.
If i set the profile to distribution I do not get a warning message when building the app, but the debugger will attach to the device.
If i set the code signing to the distribution profile, i get no warnings in the build process, but the debugger will not attach. So the answer above about being signing based seems to be correct. This might also only be an issue on newer 4.3.5 devices with xcode
Product -> Clean in the menubar
This error some times happen due to incomplete "Restore" or "Sync" process of your device which keeps the .app files locked up.
What I did I had to jailbreak my device to go find the app under /User/Applications/XXXXX-XXXX-XXX/ and phisically delete the .app
For one of the apps it worked and for other one I realized it just does not run GDB automatically so the error message is totally misleading, so I set the GDB to manual and it worked and did not give me that error, but of course I have to run the app manually for the debug session to start.
It also may have required some other stuff that I did before like checking the provision profile, but this was the last step that made it work.
Before this I tried all the solutions did not work for me, and obviously simply deleting the app by holding down your finger on the screen did not work, as it removed the icon but all the files were still there. ( Since it was a development app not a downloaded App Store app )
had same problem,
quit the XCode...delete app from device...run the program again..
i solved that way..one of my friends had to restart the device.
I have the same problem. I solved it by changing the project's directory name and then launching the app again.
I had this problem on a recently restored device where my in-development apps had not been reinstalled—they were showing up on Springboard as "Waiting" to be downloaded from the App Store. Deleting the app from Springboard fixed the problem.
I've faced this issue since yesterday on two different devices, both iOS 4.x. Deleting the DerivedData folder, deleting the app, restarting the Xcode, and cleaning the code did NOT work. Repeating all the steps, in addition to rebooting the device fixed it for me.
Here I am posting an update to the issue. Might be helpful for someone with the same problem. I have Xcode 4.4 and launched it on a device with iOS 5.0 . If Xcode doesnt have the 5.0 simulators

Resources