"Watchdog has expired" when I debug app with iPhone in Xcode - iphone

From yesterday, My iphone couldnot debug any apps.
In xcode, when I choose my iPhone as the debug target, and xcode build the app, link, and run into my phone, several sencond later, the xcode finish running in my iPhone. And the console below show "Watchdog has expired. Remote device was disconnected? Debugging session terminated."
It is iPhone4s, iOS version is 5.0.1, and had jailbreaked, and update Cydia a few days ago.
It could not work on my other MBP yet.
How can I recover it?

This is because of the bug in Cydia update and Jailbreaking.
Hope this helps.

Refer to this post:
App crashes with "Watchdog has expired." message. No stack trace or crash dump
Here is tc.'s answer from that post
"Watchdog has expired." could mean anything. The way the message is
worded suggests that the "local" GDB (running on your Mac) GDB timed
out waiting for data from the "remote" GDB (running on the phone).
Alternatively, "Watchdog has expired" might be from the phone's
console output shortly before it reboots.
What does it display if you disconnect the device while your app is
running? What if you power it off? What if you issue a hard reset
(Sleep+Home for 10 seconds)?
If it's causing the device to reboot, there's something seriously
wrong happening. Your app shouldn't be able to take the phone down,
but sometimes something slips through (IIRC, UIImagePickerController
on some version of 2.x had a problem where either your app would get
killed or the phone would reboot, depending on which kicked in first).
"Large set of bitmaps" sounds like it might be causing CoreAnimation
(or IOSurface or whatever) to run out of video memory.
I would hesitate to do drawing in a background thread unless you're
very careful about thread-safety (to a first approximation,
CoreAnimation is and UIKit isn't except a few functions that were made
"thread-safe" in 4.0).
Hope this helps you.

Related

Finished Running on iPhone

I am trying to test my app on an iPhone 4S. When I build and run from Xcode, the project is successfully compiled but after that Xcode says:
Finished running MyApp.app on MyiPhone
The app perfectly work on the simulator and the provisioning profile works correctly (I tried to load an empty app and it works).
If I try to manually load the app I get this message:
The Info.plist for application at
/Users/*/Documents/App/AppName/DerivedData/AppName/Build/Products/Release-iphoneos/AppName.app
specifies a CFBundleExecutable of AppName, which does not exist.
Where is the problem?
The connection that XCode creates with the device is rather fragile, and can easily be corrupted if anything goes amiss in the debugging test, most commonly if the developer stops a build, while it is being moved to the device.
I have a routine of things I go through, when this occurs. If one doesn't work, I go further down the list.
Check your signing certificates
: This error can occur if you mess around with the certificates too much. Make sure your current scheme uses the Debug signing when making a debug build, and check in your application settings if the current debug signing certificate is a debug certificate. (Not AppStore, AdHoc or Enterprise).
Reestablish connection with the device
: Look under devices in your Organizer. Check if the device you are using is present and marked with a green bullet. If orange or grey, reconnect the device with the USB. For precaution, wait a couple of seconds from taking the cable out before you insert it. It should make no difference if you eject the cable from your mac, or the part connecting your iDevice.
Reactivate development on the iDevice
: Being unaware why this happends, some devices revert to a non-development stage from time to time. Clicking the "Enable development" under Organizer > Devices seems to clear this off.
Flushing XCode device connections
: Something that often is needed, you can simply shut down XCode (and to be safe, close the iPhone simulator as well) and start it up anew. Deleting the debug application present on the iDevice is also a good idea.
Restart your iDevice
: Tedious as it might seem, restarting your iDevice is sometimes needed, since the pipe held on the device might be corrupted.
Restarting your developer machine
: If everything else fails, a restart of your mac is often required. I have never experienced this error without having it fixed by now.
I hope this checklist will help you through.
Try cleaning the project.
SHIFT+CMD+K
Found the same bug in XCode 9 while running the project on iPhone 5s. Clean the project and it will work.
Clean.
Build.
Run.
It's work for me.
I had similar issue. When I run program on iPad2 it compiles and installs app on device, wait for some time, and display an alert. Then I followed steps below
1) Removed that application from device.
2) Disconnected iPad and tried again.
Then it successfully run in device. If this not resolved your issue, do
Rename your application to some thing else and try to run. It will run. Lastly you can make an "ipa" file with Ad Hod distribution and can test on device.
Looks like you are trying to run a release product on the device. You are probably signing it with production key. Run it as debug.
Maybe I'm totally off with this guess but the last time I got the same message was when I had some required hardware capabilities set in the Info.plist which the target device didn't comply with. (E.g. requiring a camera and trying to run the app on an iPad1.)
I've just finished chasing down a similar problem.
An app that worked on the device (iPad 1) and on the simulator stopped loading on the iPad but continued to function as before on the simulator. When "run" with the device as target, it compiles and then goes immediately to "Finished Running...".
I did all the usual bits - removed the app from the device, ran Product/Clean, removed derived data, shut computer and device down cold, but with no luck. Other development apps loaded and ran fine.
This app uses GameKit. When I removed the gameKit requirement from Info.plist, the app loaded and ran correctly on the device again - including the GameKit functionality (no kidding). When I added gameKit back in, it failed again. When I added the gameKit requirement to other apps, they failed to load to the device as well. It appears that something has happened to the gameKit setting on the device, although gameKit is there and functions as always. I'm suspicious that this one has to do with the state of the sandbox.
I've got to make a few changes to get the app running on the iPhone and I'll test that as well. I'll repost if I sort it out.
Si it seems that XCode build, ran and finished but the app failed to be deployed and was not even copied to the device.
In fact, there should be something in the XCode project that is broken. This is easily corrupted. The best move is to build a new project from scratch. Don't forget to add armv6 support if needed.
It works well for me!
Check the device log
It may occur, that you are using a provisioning profile, which does not allow one of the entitlements, listed for your target.
For example
entitlement 'entitlement-name' has value not permitted by provisioning profile 'Your Profile Name'
For me, the usual culprit is that I have an app store build already on my device.
Different/same version numbers might make things worse. I haven't looked into it too deeply since deleting the version that is already on my device usually fixes the issue.

Crash iPhone app

I have developed an application on iPhone.
If i run it from XCode, no problem : XCode installs the app on the device, then the app is running, OK.
But then, I unplug the device from Mac, and i run the app : crash happens, OK.
I would like to know if there is a way to attach XCode as debugger when I run an app from the device, and not from XCode. Such like Windbg and dump of application crashed.
If you re-attach your device to XCode, you can access the crash log.
Go to the Organizer, select Devices, select your device, and then under your device name, you will see "Device Logs". You will be able to select and examine any of them in the next window to the right.
You will also be able to see the Console.
These should help in determining what caused the crash.
I think this is mostly due to memory issue. Check in instruments that your application consumes more memory. If so try to reduce memory conception by releasing unnecessary view controllers and mostly UIImageViews

iphone app cant be started on device after being killed - works fine on simulator

I want to put an update to my App and I'm encountering heavy issues. When sent to background and being brought back to foreground, the App works fine. However, after killing the process from multitasking (running in the background), the App tries to resume from the point where it left AND it freezes, which means, I cant start the App anymore!!!! I have made no changes to the code, except updating my OS from 4.0 to 4.0.1.
Can anyone help me out on this?
A weird thing is: I cannot reproduce this problem on the simulator, it works just fine there.
I seem to have found the solution. Apple states in the updates: 'When debugging your multitasking enabled app, avoid manually pausing and continuing from the debugger when the application is suspended in the background. Pausing an application that is suspended in the background disrupts proper multitasking behavior until the application is relaunched.' So I tested it on a device for distribution and it seems to work fine, so all you have to do is ignore the debugger - it seems. Best of luck!
My app works fine for me in Debug mode (I'd advice against working with Distribution mode cause of all the hassle of provisioning profile, iTunes sync... and also you can't see the console message in real time).
The reason you can't do anything after killing the app and relaunching it is most likely because you run it directly from XCode (Command + Enter) and the app is still "running". Just click to the Red button to stop the debugging, then you can relaunch the app from the SpringBoard normally. Or just Command + Enter to rebuild it again.

Problem with app on device

When I run my app with simulator every thing is ok.also when i run it on device (ipod touch 3G) for the first time,i have no problem but if i close my app and run it again,it hangs(no button working & just i can uninstall it) and if i try to minimize it ios seems out of action(every thing is being black)
how can i solve this problem ?
Run your application in the simulator with the profiling tools, making sure you check for allocations / releases and if there are any network resources left open.
You haven't said anything about what your app does to give any more help than that, but the development tools will tell you what is going on.
Also when you connect to the iPod, check the crash reports to see what happened
have u release any object in appWillTerminate. may be u trying to release object that is already released before the application quit. or u can see the application quit status in nslog if status is not 0 means application is not quitting properly.

Unknown and unreproducible crash causes App Store rejection

After submitting our application several times, we continue to receive the following response:
Thank you for submitting My App to the
App Store. We've reviewed your
application and determined that we
cannot post this version of your iPad
application to the App Store because
My App is crashing on iPad running
iPhone OS 3.2 and Mac OS X 10.6.2. My
App crashes upon launch.
Unfortunately, crash logs have not
been generated.
However, resigning the same build with the AdHoc entitlements and loading the build onto the device yields no such crash. After a number of attempts, the application simply does not crash as reported by the reviewer. Furthermore, the reviewer does not provide any useful logging that may have been generated by SpringBoard such as an exit status or event if it had worked properly for any other device. There are no calls to explicitly exit or quit the application in the code line and yet the application terminates on startup.
What might cause an application to terminate in such a manner?
Under what conditions is an application tested that might not be found under a development environment?
Could it be a result of a signing issue that the submission validation system is simply unable to catch?
Thanks in advance.
After fighting with this for weeks, the application has finally been approved. The key: signing corruption. Hence why the application would start (or at least appear to start by showing the splash screen) and then suddenly vanish without a crash log. It failed Springboard's preflight sighing check.
A good tool to keep in mind to check for signing issues. It tells if the application has a valid signing:
codesign -vvvv MyApp.app
When I built the application, I would cp it to a network storage device where our product manager would pull it down and submit it to Apple. If decompressed on the NAS, the code signing was valid. But if you coped the compressed application back off the NAS and validate it, it would fail.
The lesson: make use of the new XCode utility to submit applications.
A few suggestions:
Try to use the leaks tool of the static analyzer to see if there are any memory leaks or problems your not seeing.
Does your app use a web service? This happened to me one time because the day Apple was reviewing the app the web service went down. That cause a crash. If thats the case you would want to add something to catch that.
Finally, In the logs Apple sent you did they send you the dsym file? If they did you can run atos from the command line and it will convert the address to symbols. That will show you what thread and symbol it's crashing on.
Be sure you test with a variety of settings: with Wifi disabled/enabled, with 3G disabled, Airplane mode on/off, location services disabled, etc.
As a last resort, assume there is a problem in your code that executes at startup. Remove half your startup code, set your release date in the far future (just in case it gets approved), then resubmit and see if they have the same problem. If not the problem is in the half you removed... it's a binary search.
I think you have two options: try harder to reproduce the defect using the tools other people are mentioning or to catch those crashes in the field.
PLCrashReporter will trap on an uncaught exception and store all relevant information. Next time your app is run, it can send the crash report that you can then symbolificate and view a stack trace of.
Ouch! That's a tough one. I've had this kind of thing happen before, but it seemed it was reproduce-able when I switched to a different device (iPhone 3G vs 3Gs, etc.). In your case though, it sounds like you're iPad only, so that might not help. There's a difference between 3G and Wifi, I suppose, but I would be really surprised if that was causing a crash on one and not the other.
One thing you could try if you think Apple's not doing their part is to change the binary name and re-submit it under another app name/record. See if you get the same response. If you get the same reviewer, you might, but I think there's a good chance you would get a different reviewer with a new app. Just set your app release date to some time in the distant future and it will never actually show up in the app store if they approve it. If the new app comes back rejected for the same reason, you've got work to do, but if they do in fact approve it, then I would get on the phone with them and point out the discrepancy.
My approach would be to make sure that the compilation is absolutely clean both in the static analyzer (this is NOT optional, it will save you time!) and for the build itself. Then set everything as described on CocoaDev' NSZombie page. Then make sure you have an iPod running 3.2 (actual hardware, not simulator) and test, test, test. Do it with network available and not available, with the device nearly full and freshly restored, every other variation you can think of. Run it with the debugger active and as a release build disconnected. Use Leaks, Instruments and all the other tools to peek in there and get a better feel for what is happening. If you exhaust every possibility you are going to have to beg for more detail from Apple but I bet you find a problem - one of the most important things in debugging an issue like this is to try to forget everything you think you know for sure and start at the beginning.