failed to send the qLaunchSuccess packet, can't debug in the device - iphone

When I run the application, it is installed in the device, but will crash immediately. I want to debug in the device, below is the information:
error: failed to launch
'/Users/wujinjin/Library/Developer/Xcode/DerivedData/化龙巷-gyktkapynghuobbqslisrornfrut/Build/Products/Debug-iphoneos/化龙巷.app/化龙巷'
-- failed to send the qLaunchSuccess packet
information from device:
Exception Type: 00000020 Exception Codes: 0x8badf00d Highlighted
Thread: 0
Application Specific Information: 化龙巷 failed to launch in time
Elapsed total CPU time (seconds): 20.030 (user 17.830, system 2.200),
100% CPU Elapsed application CPU time (seconds): 0.000, 0% CPU
Backtrace not available
Unknown thread crashed with unknown flavor: 5, state_count: 1
Binary Images: 0x2fe00000 - 0x2fe25fff dyld armv7
/usr/lib/dyld

I was having the same error "-- failed to send the qLaunchSuccess packet"
I was able to fix by setting the Code Signing Entitlements to "iPhone Developer"
(I was using distribution by mistake)

Restart the device. Worked for me.

By accident I found a real simple and always working solution for this issue that happens constantly.
First thing to know is that it happens when I run the code on the real device while in debugging mode, then make some changes to the code in XCode while still running the app with some breakpoints, stop the running application and immediatly(!) start debugging the edited code on the iOS device. Don't do that! Instead give XCode some time (a few seconds) to quit the app properly.
If it is has been occurred already stop the debbuger from running. Wait for the app to quit properly on the device, this may take some seconds. On the device double-press the home button and quit the app in the task bar by tapping the red (-). Then run the debugger, stop it immediatly without finishing the compilation and wait for XCode to stop all tasks (you may omit this step). Then everything should be fine and you can start debbuging on the device without the need for a restart. It seems that it is essential for XCode to cleanup everything after it has been stopped while debugging with breakpoints so always give it a few seconds to finish properly. Maybe it sounds like some sort of magic trick but until now it always works for me without the need for a restart.

Go to your Target's info, and at the bottom, remove the checkmark for "Entitlement". Worked for me.

I see this error all the time IF I was stopped due to a breakpoint and I just hit the run button (not the debugger's resume button). If I remember to hit stop before rerunning, I don't get the error. I can't turn off entitlement as the app I'm developing is one that will be using iCloud. Also, I can prevent the problem by resuming the app so that whatever Run does to stop an executing program handles it cleanly.

I solved it by
remove derived data,
quit Xcode,
kill app on device,
start Xcode again.
However this problem continues to happen for me, 0-4 times per week. A permanent solution to this problem would be nice.

my application was not getting launched on iPad but working normally on iPhone. I enabled entitlements and specified code signing entitlements as "iPhone Developer", then cleaned, restarted iPad and installed thru Xcode/cable directly on iPad and now its working as expected.

Related

Xcode successfully builds but fails to run macOS app

I've written a mac application that uses CloudKit, and ever since I've upgraded to Sierra and XCode 8, the app will successfully build, but Xcode will not launch the application when I click "run".
If I go into the Derived Data folder and manually double-click my application to launch it, it crashes immediately and displays the following in the error report:
Time Awake Since Boot: 12000 seconds
Time Since Wake: 6500 seconds
System Integrity Protection: enabled
Crashed Thread: 0
Exception Type: EXC_CRASH (Code Signature Invalid)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace CODESIGNING, Code 0x1
What's interesting is, if I archive the app and export a Developer ID-signed application, the exported build is signed successfully and works perfectly.
Additionally, If I go into the capabilities tab and toggle off the iCloud capability, the app successfully runs in XCode.
Whenever I run spctl on the app in the DerivedData folder, whether or not I have iCloud enabled or disabled, I always get this:
spctl --assess --verbose=4 MyApp.app
MyApp.app: rejected
In the General tab on XCode I've set it to "Automatically manage signing", and as far as I can tell, all of my certificates are valid.
Not really sure what to do here. I've even tried disabling Gatekeeper completely and still no luck.
Aaaargh. Found the answer to my problem, I hope the answer may help you as well.
My code signing was set up correctly in the development target, but it was ad hoc signed in the Test Target. As soon as I set up a profile for the Test target the problem went away.

iPhone - when testing on device

Couldn't register com.companyname.myapplicationname with the bootstrap server. Error: unknown error code. This generally means that another instance of this process was already running or is hung in the debugger.Program received signal: “SIGABRT”
I tried removing the app from the simulator, doing a clean build but I still get this error when I try to run the app.
What should I do to be able to run the app on my simulator again?
Try restarting your device, resetting your device if possible, restart Xcode, restart your Mac, clear the Xcode cache and project cache, make a project clean etc.
Some of this should help.

failed to send the qLaunchSuccess packet

I am using XCode 4.3.2 and trying to open an already existing project based on the Facebook SDK sample Project for XCODE and run it on a target IPhone with IOS 4.2.
Although it runs on the simulator it crashes on the IPhone printing this error on the console:
failed to send the qLaunchSuccess packet
I really do not know what could be the problem
This happened to me when I accidentally tried to do a device debug using a distribution profile. As soon as I noticed and switched it to a dev profile, the issue went away.
You might have some broken privileges or a hung debugger process (one that didn't quite exit fast enough). Restart Xcode or restart your phone, either way, it's not as bad as it's more annoying cousin, Processes That Can't Be Registered To The BootStrap Server
If all else fails, restore it from a backup.
In Xcode 4.3.3, this is caused by re-running the app (command+R) or stopping it (command+.) while halted on a breakpoint. To fix the error once you've gotten it, it usually works to stop the app, (command+.), unplug the device, plug it back in, and run the app again.
To avoid the issue in the future, remember to continue (command+control+y or hit the play button near the debugger output) before stopping. If you have many breakpoints or are in a loop, you can deactivate one breakpoint by going to that line and hitting command + \ or you can deactivate all breakpoints by hitting command + y.
If you eventually get the error ending in "This generally means that another instance of this process was already running or is hung in the debugger," you need to reboot the device.
I submitted a bug report to Apple. I suggest you all do the same so that this gets the attention it deserves.
Edit: the "qLaunchSuccess packet" bug doesn't happen in Xcode 4.4 or 4.5 as it did in 4.3. However, 4.4 and 4.5 experience "Timed out waiting for app to launch" instead--possibly the same issue with a new message. See this question for some possible solutions. Nothing works for met yet. The behavior seems different than 4.3.3 because the error doesn't come up every time I stop while halted on a breakpoint. I will experiment and see if my workaround for 4.3 also fixes the 4.4/4.5 issue.
I get this every time my app crashes, and I restart it by doing a Run. If I hit the Stop button before doing a run then I don't get this.
After some time, if I keep hitting Run instead of Stop first, the iPhone will only show the above error message and the only solution is to restart the iPhone. Quitting and restarting Xcode does not help.
This may be an Xcode bug.
A slightly quicker way to resolve this issue without restarting the device is to change the language.
Settings - > General - > International (4th from bottom) - > Language (top)
Alternatively If you have a bugged News stand app (in a folder) just tap it to restart springboard.
I had this error when I was trying to install over a bad version of the app that had been crashing on launch. Restarting Xcode and the device did not make the error go away, but deleting the app fixed the problem.

Application crashes while restarting again after a manual kill

I am working on my first application for iPhone and I'm facing this weird problem for quite some time now.
Whenever i kill my application manually and then again try to restart, it crashes immediately with error:
Thread 1: Program received signal: "SIGKILL"
But when I again recompile and launch my application, it works just fine. Can't i just make my application to start from the same settings with which it launches when i compile and run.
I'm new to iPhone development and i think i'm missing something grave here. Will appreciate your help on this.
Thanks in advance!
So you are running the app from Xcode. If you run it from Xcode and quit it manually(not from Xcode) and try to run it from Xcode, you will receive this exception. No need to bother about this exception.
It seems to be a bug in Xcode. When you quit the application manually, no signal/intimation is sent to Xcode that the app quit running. So, Xcode thinks that app is still running. When you try to relaunch it from Xcode, it throws the exception.
I don't know the technical reason for this. May be when you relaunch the app after killing it manually, Xcode thinks that app is still running and tries to stop it before relaunching it, and throws the exception there.

Xcode error: Failed to launch simulated application

Problem
Unlike people have asked at here and
here, I got this error after a brand new installation of Leopard (hackintosh), this problem really driving me crazy and nowhere else to find an clue, I googled and visited every article related with this, still can't get it solved.
After the first time install iPhone SDK 2.2.1, start a new project(any type, Navigate based, OpenGL ES application), then build and go, I got the following problem:
sometime it's:
Failed to launch simulated application: Unknown error.
and sometimes it's:
Failed to launch simulated application: iPhone Simulator failed to find the process ID of com.yourcompany.[application name]
It seems that apps in the simulator crashed immediately, so Xcode can find the process ID.
Solution
This link says that this even can't be solved. Some others make a detailed step by step:
Uncheck Info.plist
Quit XCode
Delete directory /Lib/Caches/com.apple.DeveloperTools.###
Open Xcode project
Clean All Targets
Rebuild
and I reset the iPhone Simulator. This also didn't solve the problem…
I've even tried uninstall the SDK and reinstall it, still got the same error…
Is this a problem related with hardwares? or the operating system version? I'm using a hackintosh (iDenebv1.4 10.5.6), all other software works good including iTunes && vmware fusion.
Great thanks for any further tips or clues!
FIXED For the issue:
iPhone Simulator failed to find the process ID of com.yourcompany.[your application name]
I was having an issue building and simulating a project I built under OS Version 2.2.1, which I could no longer get to build and run in the simulator for XCode 3.1.4, even though I forced XCode to build for "Simulator - 2.2.1 Debug"
I was able to get past this problem by:
- Close the iPhone Simulator
- Putting XCode into View->Detail
- Opening the "Info.plist" file in the "Resources" folder
- Near the top of the file you should see "Info.plist" with and up/down arrow selector
- Click on the up/down arrow selector
- Select "Clear File History"
Built For:
Simulator - 2.2.1
XCode Version:
3.1.4 (Which includes OS3.1 Beta 3)
I had the same issue last night, and suddenly my system got reboot. At that moment, i was trying to install an application into simulator. When system returned, and i tried again to install the app, it said, "Failed to launch simulated application"
Than i did googled it, and tried many solutions, like cleaining all targets and try building again, but didn't worked out.
So i have found the following link, where it is described, how to reset the iPhone Simulator contents:
http://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iphone_development/125-Using_iPhone_Simulator/iphone_simulator_application.html
I tired doing it, and you guys would'nt believe me, it worked :) ,
Solution was : "To set the user content and settings of the simulator to their factory state and remove the applications you have installed, choose iPhone Simulator > Reset Content and Settings"
Best of Luck to all.............. :)
This ends up being a product name issue:
The fix is to revert back to
${EXECUTABLE_NAME}
${PRODUCT_NAME}
for the executable file and com..${PRODUCT_NAME} in the info.plist.
Clean XCode, Quit, rese and quit simulator and you're good to go.
found some wierd log in /var/log/system.log.
May 8 16:17:50 th084134 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard[1170]: MobileInstallationLookup: Generating the install map
May 8 16:17:50 th084134 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard[1170]: load_application_info: Could not load signer identity from /Users/test/Library/Application Support/iPhone Simulator/User/Applications/5D55807A-7489-4DC5-B4D7-2ECD5E230F29/new1.app/new1
May 8 16:17:50 th084134 [0x0-0x2e02e].com.apple.iphonesimulator[1168]: error compiling query "SELECT value FROM _SqliteDatabaseProperties WHERE key = ?;": no such table: _SqliteDatabaseProperties
May 8 16:17:51 th084134 SpringBoard[1170]: Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure
May 8 16:17:51 th084134 SpringBoard[1170]: Couldn't activate <SBApplication: 0x123e6d0> com.yourcompany.new1 activate: animated deactivate:
May 8 16:17:51 th084134 SpringBoard[1170]: Application <SBApplication: 0x123e6d0> com.yourcompany.new1 activate: animated deactivate: exited abnormally with signal 256: Unknown signal: 256
May 8 16:17:51 th084134 SpringBoard[1170]: Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure
May 8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Bug: launchd_core_logic.c:2812 (23714):103: sandbox_init(j->seatbelt_profile, j->seatbelt_flags, &seatbelt_err_buf) != -1
May 8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Sandbox failed to init: Cannot apply builtin profile `/Users/test/Library/Application Support/iPhone Simulator/User/Applications/5D55807A-7489-4DC5-B4D7-2ECD5E230F29.sb': Policy not found
May 8 16:17:51 th084134 com.apple.launchd[164] (UIKitApplication:com.yourcompany.new1[0xa455][1171]): Exited with exit code: 1
May 8 16:17:51 th084134 [0x0-0x2e02e].com.apple.iphonesimulator[1168]: 2009-05-08 16:17:51.026 SpringBoard[1170:10b] Unable to obtain task name port for com.yourcompany.new1. Either it failed to exec or it terminated immediately: (os/kern) failure
Here is a discussion about how to run app in simulator via command line, hope it helps to understand how does xcode and simulator works.
But I didn't work it out.
Well, I "solved" it by install another distribution of hackintosh(IPC 10.5.6), works perfect!
In my case, I was adding a target to an existing app that had always worked. In my case, I had forgotten to select all the source code, xibs, frameworks, etc. and click their target checkbox. My clue was that the build happened instantaneously, which didn't make any sense. It never built anything. It just failed to install in the simulator. Once I included all the source files, etc., for the new target, then it built and installed fine.
I had the same problem, I fixed it by launching the simulator through another app and deleting the app I was trying to run on it. Then try to build and run and worked perfect.
Cheers
Matt
I had the same problem. I had accidentally added my info.plist file to my target and it was getting copied to the app bundle every time I built the application. So there were 2 .plist files in the bundle - mine and the Info.plist, created by XCode - which confused the simulator.
Simply delete the app from the simulator (and/or device if you're attempting to run on your device) via the UI of the simulator, then shut the simulator down and attempt to re-run the app. Doing the deletion of the actual files backing the simulator will also remove the app and do the same thing (but the deletion via the simulator's UI, if it works for you, is a little bit faster and easier).
Is your CPU Intel, and, of a model distributed in Apple hardware?
I doubt the Simulator will work reliably (if at all) on non-Intel CPUs and/or in VMWare. The simulator is very CPU specific in order to reflect the arm hardware of the iPhone.
The SDK ONLY supports Intel hardware from Apple.
There is a significant effort involved in creating the simulator and it's not easy or cheap (read, thousands of man hours) to support every CPU.
I fixed this problem by removing the "Icon already includes gloss and bevel effect" property from the Info.plist file in my project.
My problem centered around a Product Name the simulator simply wouldn't accept. Picking alternative names got me past the problem. Changing the name back to the original suspect choked the simulator every time.
Try moving the project to your local hard driver and opening it from there! That solved the issue for me (the project used to be stored on a samba share).
My fix:
restarted the Mac and it was fixed. (before that tried clearing caches, deleting caches from iPhone Simulator, cleaning, rebuilding, quitting OS, quitting Simulator, nothing worked.) Restarting the OS worked.
This was bugging me too but finally got it working.
Unfortunately, I can't reproduce what I did it but here's my list of actions for your information.
The project causing the problem was one I'd downloaded from Apple and tweaked.
Interestingly, I could still launch my own projects fine.
So, here's a list of actions that I did (note that none of the actions below worked just by itself):
- closing the simulator and doing "clear file history"
- restarting simulator
- rebooting
- restarting xcode
- resetting the iPhone with Reset Content and Settings
However, by the time I'd tried all of the above with a fresh version of the code I'd downloaded - it was working again. Just out of interest, I dragged the project that was causing this problem back to the desktop and it was OK now.
Wow, what a pain. I had to uninstall XCode 4 via the command line and then install XCode 3 again. Make sure that you restart after you reinstall. Working...
why anybody didn't tell about restarting simulator.
In my case,
Resetting the iPhone with Reset Content and Settings
and
**ReStart Simulator**
works well~
I had the exact same problem - I reset the iphone simulator and then quit the simulator then started it again.