iPhone Debugging Error launching remote program: failed to get the task for process 907 - iphone

Created an app for adhoc distribution and installed on iphone but it is not working on the installed iphone,Tried connecting the iphone to mac and debug the app but it throws up error stating
" Error launching remote program: failed to get the task for process
907."
is there a way to debug the adhoc distribution provision file from xcode

No, you can't debug an AdHoc build in XCode--setting get-task-allow to FALSE in your Entitlements.plist basically says "don't allow the debugger to connect to this", and is required for AdHoc and AppStore builds.
See
What does get-task-allow do in Xcode?
or the documentation...

I started having this error in my projects in XCode 4.2, and had a tough time figuring it out with the new project layout.
Make sure you go into the Project Settings and change the Code Signing Identity to a development profile for the Debug setting in the target settings. It's a bit easy to miss because the Project settings come up first, and there are identical looking Code Signing Identity settings there. But Target settings trump Project settings.
If that still doesn't work in XCode 4.2, go to "Edit Schemes" - in the project drop down, which is just to the right of the stop button, in the left segment of that custom pop-up. Select "Run" and make sure Build Configuration is set to "Debug".
In prior versions of XCode, it used to tell you whether you were in debug or release right up front; I haven't found where it's that obvious with the new "Schemes".

Restarting the xcode worked fine for me

Related

Can't launch my app in Instruments: At least one target failed to launch

I have all my code signing entitlements set correctly. Running the app on my phone is fine, but launching it in instruments gives me an error message:
Error Starting Recording
At least one target failed to launch; aborting run
And then:
Target failed to run. Permisson to debug [app name] was denied. The app must be signed with a development identity (i.e. iOS Developer)
Any ideas how I could stop this from happening? Doesn't happen on my iPad.
Edit the scheme for your target and under "Profile [App Name]" set the Build Configuration to Debug (it's usually Release by default).
It is saying that you need to sign the app with a developer certificate (not a distribution certificate).
In Xcode 5 just change the "Provisioning Profile" field for your "Release" build in the Build Settings to your developer certificate instead of your distribution certificate. For the duration of the testing anyway. Xcode doesn't allow you to build with a distribution certificate.
Make sure that the project build settings do not override the target build settings or make the change in your project build settings.
Don't forget to set the profile back after you're done with the testing.
I do not recommend harrywynn's method, since it is better to profile the release build because then you are taking into account the compiler optimizations, and having the exact experience your users will.
To add to the previous answers.
Instruments is complaining about the signing identity.
I believe it is preferable to profile in release mode, for the same reasons given by Zolten. (take into account the compiler optimizations, and have the exact experience your users will, etc...)
To change your code signing identity for Xcode 6:
Click on your Project, Select the Target you are Profiling.
Build Settings -> Code Signing -> Code Signing Identity -> Release
Select your iOS developer profile.
Provisioning Profile: Let Xcode pick the correct Provisioning Profile for you, e.g: switch to Automatic
When you are done with the Profile, switch back to your normal settings.
Here's a picture for those who are very visual ;)
I was getting the same issue :
[INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug was denied. The app must be signed with a development identity (e.g. iOS Developer).
Solution:
1. I archived the the app with Debug Developer Profile in xcode for device.
2. The go to Window -> Organiser -> to see all the list of archieves
3. Now select the archive to wanted to export and open it in finder
4. Right click and show package contents
5. Go to the Products/Applications folder
You will see the .app file.
Use this instead of the ipa.
Make sure that the device has been already added to the developer portal and all the certs are installed on it for the above steps to work.
Once this is in place. Also, make sure you get the ios-webkit-debug-proxy from the link below:
https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/ios-webkit-debug-proxy.md
Also, enable developer tools on on the device setting.
Also, make sure safari webinspector (safari -> Develop) -> Inspector is on
Hope it helps:-)
NOTE: When you want appium to install the app on the device for you, don't provide Bundle ID.
I achieved to solve this issue on my machine by doing this :
Generate a new Developer Provisioning Profile with your device in the list or at least make sure that your machine is in the list of the profile's device.
In Project settings -> Code Signing -> Provisioning Profile -> Debug : Set the newly created profile.
In Targets settings -> Code Signing -> Provisioning Profile -> Debug AND Release : Set the newly created profile.
Hope that helps.
I realised what "At least one target failed to launch" means. It appears that both the development and release schemes (if you have a debug scheme and a release scheme) must have a development identity.
I had the debug scheme selected when running the profiler and the message at the top of XCode said "Running debug". However, it seems that this is not sufficient.
I changed my release scheme code-signing identity to be the same as the debug scheme (and also the provisioning profile), and the problem went away.
it worke.. when i changed my profile schema to debug mode and also made sure, build configs has developer certificate in it. Thanks
None of the other solutions here fixed my problem, but I did determine that it was only a problem for me on the simulator. The device works fine. Perhaps there's an issue with the simulator.
I encountered this problem with Xcode 9.1 for both simulators and devices, and my running scheme was already set as profiling with "Debug". Finally found this Apple forum discussion very helpful and got the problem resolved. In short, the solution that worked for me is ... Restart the Mac.

Xcode is not launching my app for debugging

My iOS project installs fine on the iPhone but the application won't launch automatically for debugging.
I'm using Xcode 4.2 (Build 4C199), the latest version for Snow Leopard (10.6.8).
I've already tried deleting the app from the iPhone, restarting the device, cleaning the project and reinstalled xCode.
Any ideas on how to solve this problem?
In Xcode click on where the project name/Device or simulator version is (On the right of the Stop Button), and select Edit Scheme, on the Run Tab select Build Configuration -> DEBUG, and select a DEBUGGER -> GDB.
In my case, I created a new target and a new scheme by duplicating the existing ones, in order to test my app on devices with on older iOS version.
However, the copied scheme had as executable selected "None":
As soon as I selected the right executable there from the drop-down menu, the app launched.
I was having this problem as well. I removed the option Launch due to a background fetch event in Edit Scheme -> Run Debug -> Options and Xcode started launched the app again.
Hope that helps.
Can you confirm you are signing the app with a development certificate? This issue happens when you sign the app with a distribution certificate.
I've been able to solve this problem by Changing Debugger to LLDB, instead of GDB, on the Run Tab, using Build Configuration -> DEBUG, by selecting Edit Scheme (On the right of the Stop Button).

Why won't instruments execute my Monotouch application?

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.

How to Debug an iPhone App after an ad Hoc Build?

I did a ad Hoc Distribution of my App now i want to to Debug it again (i have changed something with CoreData) but i cant.
If i press Debug unsing the Settings for Distribution the Default picture starts on the device but i get an error "Error form Debuger: The programm being debugged is not being run.".
If i use the Debug Settings i get an other Error: "The Executeable was signed with invalid entitlements."
What do i have to do to be able to Debug again?
You need to change the "Code Signing Identity" setting for your app target in XCode back to "iPhone Development", with the relevant certificate for your app. Only apps signed with development provisioning can be debugged.
Note that the target's setting (below the "Targets" node in the tree of "Groups & Files") overrides the global project's setting, so if you've already changed the latter, make sure the target isn't still set to "iPhone Distribution".
You can find these settings by right-clicking/ctrl-clicking the respective tree node and selecting "Get Info".
Finally, make sure you actually build the app with the new settings (Build & Debug/Build & Run is fine) to re-sign the binary.
In addition to making sure your current Debug build is using the correct Developer certificate, you might want to un-select the entitlements.plist in your non-Ad-Hoc Target's file inclusion pane if you have one.
If that still doesn't work, deleting the Ad Hoc certificate and app from your iPhone, rebooting it, restarting Xcode, and installing a clean build sometimes causes a borked debugger connection to start working again.

Debugging App on Iphone and now i get this error: unknown packet reply: "timeout" to environmental package

I have only started getting this error.
The application works perfectly when working on the iPhone simulator, and there are now errors like the one above.
The application is being put on a 3.0 iPhone if that is any help.
Have you rebooted? You could try restarting XCode and maybe even power off and back on your iPhone device. If that doesn't work, try rebooting the desktop you're debugging from.
I frequently (well, pretty frequently at least) have weird connectivity issues between XCode and my iPhone and rebooting the phone (power off, back on) will generally solve these.
Check that all paths in your project don't contain '#' simbol.
for example, my project at this path: "/User/alex/Projects/prj_MMH/branches/#19/" causes same error.
I had the same problem. Cleaning the build directory helped.
The answer for me was that it was running with the wrong build configuration. Go to the 'Scheme' at the top of the window, click on the 'App' at the left and Edit Schemas from the menu and select the 'Run Name.App'. Under the Info tab, there is the Build Configuration dropdown. It should be set to 'Debug' - I had it set to 'Ad Hoc Distribution' I think.
The other part which might be needed too, was that under the main project target 'App' in tab Build Settings section Code Signing Identity, the Debug setting should be set to "Don't Code Sign" and the 'Any iOS SDK' set to "iPhone Developer"
Is this in the XCode Debugger console?
You could be running the Release version.
Only the Debug build can pipe stdout/stderr back to XCode.