I am unable to run my tests on my OSX app - the project builds fine but when I run Product -> Test in Xcode 8.2. It says :
Message from debugger: unable to attach
How do I get my tests working again?
What solved the problem for me was to enable signing on the test target.
You need to go to your project's settings, go to your target and in general, under Testing, you have the Signing section. Click on the big button "Enable signing" (or something like this). You may have to deal with provisioning profiles but it wasn't the case for me.
I ended up needing to "repot" my Xcode project using these steps which sorted it out.
https://medium.com/#mobilebloke/xcode-8-going-slow-on-swift-3-have-you-tried-repotting-your-project-88d0066d2445#.idcdv2dd3
I know its not necessarily the fix but after trying:
Adding removing certs
Recreating profiles
Deleting and re-adding targets which didn't work...
this at least allowed me to continue
I had the same issue, but for the regular app. For some reason my app was sandboxed. You can check it selecting your Project/Target (your app) and then Capabilities, like in this screenshot (from Xcode 10 beta 4, but the concept should apply to older versions of Xcode):
App Sandbox was on. that also created a file "RSSReaderMac.entitlements". Which I probably messed up trying to keep the app sandboxed just to learn how it works. I disabled App Sandbox, trashed the entitlements file and then my app started running again.
Indeed the real cause was that my app actually crashes, with this error message:
Exception Type: EXC_CRASH (Code Signature Invalid)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
I suppose enabling the sandbox again the entitlements file gets recreated. Otherwise another option could be to check and clean that file first. But I didn't test it.
My error was that I attempted to add an entitlement manually in the [app name].entitlements file. Deleting the added entry fixed the problem, You may have a corrupted ...entitlements file.
I am new to iPhone application. i just started with xcode. My problem is: I have created an app using xcode & phonegap, it's running without any problem in simulator but when i try to test it on my iPad it throws an error.
Error launching remote program: failed to get the task for process 6074.
i dont know why this happens. i have searched it on StackOverflow but its kind of confusing (as i am new in iPhone app.)
please help me where i goes wrong & how can i solve this?
Application also open. After the application launched completely, after few seconds I got this error. after that My Application get crashed.
One more thing.
if i delete my old application then it reinstall it but it throws same error. but if i open that installed application then it will be my updated application.
The problem is because you are trying to debug your application using distribution provisioning profile. If you want to run your application in debug mode, you have to sign it with development provisioning profile and certificate (both in build settings and in target). If you are trying to create a distributable, sign it with distribution credentials and add Entitlements.plist (again both in build settings and target).
That’s because you put the get-task-allow = NO entitlement into ad-hoc builds, to stop your beta testers from being able to run the app in a debugger.
"Error launching remote program: failed to get the task for process"
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.
I'm trying to use Instruments to look at resource usage in my Monotouch app. However, I can't get the app to launch through Instruments.
When I hit the record button in Instruments, the app launches on my iPhone, buzzes (signifying it's a debug build), then crashes - and Instruments reports:
Target failed to run: Remote exception encountered : 'Failed to get task for pid 384'
The app runs fine when I launch it directly on the phone.
I've tried it with debug builds and ad hoc builds (using the parameters defined on the Monotouch support page). Always the same.
I'm using Monotouch 3.2.5, iOS 4.3.1 (on a 3GS), Xcode 4 and Snow Leopard.
I've see this issued mentioned in a few places around the web, but haven't seen a resolution. Anyone know how to resolve it?
It's a signing problem: to run under the control of Instruments, the app is compiled with the Release build settings, not the Debug build settings, which usually means the app is signed with your Distribution certificate instead of your Developer certificate.
The app needs to be signed with a Developer certificate for Instruments to be able to control it.
Change your signing option to Developer on the Release build and you should be fine.
I also ran into this issue with Xcode 4. What worked for me was...
From Xcode 4, run on the connected iOS device.
Launch the Instruments app manually.
Choose my template (in this case TIme Profiler).
Choose my app from the Target menu (to the right of the Record button).
Click the Record button.
The suggested Entitlements solution did not work for me (since Entitlements are evidently no longer required in Xcode 4).
The suggested signing solution did not work either. Also, it would be inconvenient to change this every time I wanted to test with Instruments.
Check your Entitlements.plist for the signed app. If get-task-allow is false, it will prevent Instruments from attaching to the process.
How about launching Instruments from inside XCode? If you're using Xcode 3, it's in the Build menu and then Run with performance tools. This will fire up Instruments and automatically start recording.
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.