debugging

How can I disable Android USB debugging programmatically

独自空忆成欢 提交于 2019-12-29 08:52:23
问题 There is a bug on some Samsung Android Phones causing USB-debugging to automatically be turned on if the USB is plugged in. This is obviously a security issue. I want to write a program which will disable USB debugging so that I can start it whenever usb-plug is inserted. Any ideas on how to do this? 回答1: It seems to be impossible. I think I must use Settings.System with ADB_ENABLED, but ADB_ENABLED is a Secure-System-Setting which cannot be changed by a normal application. :-( On the other

NullReferenceException, no stack trace… where to start?

混江龙づ霸主 提交于 2019-12-29 08:29:33
问题 I have a WPF audio application. Occasionally (and even in the debugger) I'm seeing a NullReferenceException which carries no stack trace information with it. How can one start debugging such an issue? Some background: I'm P/Invoking functions in WinMM.dll which involves registering a callback when calling waveOutOpen [DllImport("winmm.dll")] public static extern MmResult waveOutOpen(out IntPtr phwo, IntPtr uDeviceID, WaveFmt pwfx, WaveCallbk dwCallback, IntPtr dwInstance, int fdwOpen); This

Failed to use systrace in Jelly Bean

試著忘記壹切 提交于 2019-12-29 08:29:08
问题 I've tried to use new systrace from jelly bean release, but with no luck. I enabled graphics and views traces in development settings like on I/O session, and tried to call systrace, and all i get is this. $ ./systrace.py error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_switch/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable: No such

Script working only on page reload

你。 提交于 2019-12-29 08:22:34
问题 I'm using jQuery to align images on an horizontal view website, but the script only works when I reload the page. http://joliannelm.steveforest.com/edition/roux-de-service.html The script is called just before This is the script : $(document).ready(function() { var width = 0; $('#page img').each(function() { width += $(this).outerWidth(true); }); $('#page').css('width', width + 50); }); Once the page is reloaded it's OK, but if you clear the cache, it's back... Someone knows why?? Thanks. 回答1

How do you debug Javascript applications?

邮差的信 提交于 2019-12-29 08:11:51
问题 I work in an application that is JavaScript intense. So to debug , I end up using many alerts. Are there other better ways to debug ? What methods do you use ? 回答1: For JavaScript, debugging is a sinch in most browsers: IE - Where you really need to debug, F12 is the console. You can call console.log , console.debug , console.error and a few others, and it will print out good data. When you call console.log on an object, good consoles will print out the property break-down of the object.

Help debugging iPhone app - EXC_BAD_ACCESS

时间秒杀一切 提交于 2019-12-29 08:08:12
问题 I've developed my application using my 3G device to test with. Upon giving this to a friend to test, he's noticed that it crashes..I've had a look at the crash log, but it's not much use except for the "EXC_BAD_ACCESS" statement after a few memory warnings. On my device, I can use the imagePicker lots, and each time a photo is taken I get a memory warning, but this doesn't cause any problems. On my friend's device (also a 3G), after a couple of images chosen from the camera, the app crashes.

Cannot drop to frame?

限于喜欢 提交于 2019-12-29 07:52:06
问题 Is there a trick to get "Drop To Frame" to work with Android? The option is inactive for me. 回答1: I hope it is possible, but I don't think so. Other nice functionalities like "All instances...", "Instance count" and watchpoints (stop debug on variable access/modification) are also unavailable. I think it is because DalvikVM does not support this functions. From eclipse documentation about Drop to frame: Note this command is only available if the current VM supports drop to frame and the

what to do if debug runs fine, but release crashes

杀马特。学长 韩版系。学妹 提交于 2019-12-29 07:47:30
问题 I have an application that runs just fine in the debug build, but when I start it in the release build, I get a unhandled Exception at 0x0043b134 in myapp.exe: 0xC0000005: Access violation while reading at position 0x004bd96c If I click on 'break' it tells me that there are no symbols loaded and the source code can't be displayed. What can I do in such a situation to track down the problem? 回答1: This kind of problem is often due to unitialized variables. I'd start there looking for your

Visual Studio does not allow breakpoints in MVC views

心不动则不痛 提交于 2019-12-29 07:35:09
问题 Sometimes Visual Studio does not allow me to set breakpoints in MVC views. This has happened to me scores of times, but it doesn't happen for every view and I don't know why. When you click on the left-hand bar to place a breakpoint, it places a white circle instead of the normal red circle. The message when you hover over it is "The breakpoint will not currently be hit. The source code is different from the original version." It goes on to describe how to allow breakpoints to be hit, but

NSThread number on iOS? [duplicate]

余生颓废 提交于 2019-12-29 07:33:08
问题 This question already has answers here : po [NSThread currentThread] (2 answers) Closed 6 years ago . When you print a NSThread's description, you get something like this: <NSThread: 0x1e511b70>{name = (null), num = 1} Is this "num" available somehow? This is for debugging only, so it does not need to clear Apple's approval process. 回答1: That number is actually an ivar in NSThread's private implementation class. The class is _NSThreadInternal , and its name is "_private". Inside that object,