NSLog not working when debugging an app extension - xcode

I just can't see any logs in the window, even though I know I'm attached to the extension, I can place and enter into breakpoints, as well I see the values of variables.
However I can't see any logs.
Any ideas?.
Normal app logs works just fine.

Seems like you are running the actual main app, not the extension (wrong scheme).
In Xcode, next to the play and stop buttons it should say the name of your app and the device you're running on. Make sure it says the name of your extension, not the name of your actual app.
Please see the attached screenshot:
As you can see, I have selected my keyboard extension - not the main application 'TransKey'. Once you do that, you should be able to see the logs in the Debug area for your extension.

Related

VS2019 Live Share - is it possible to share console as well?

I worked on a Console Application with a friend today. Is it possible to share the default console during a Live Share session? What I mean is that we had to compile and run our program manually through the default Windows Terminal to see output(which wasn't the best idea, there was a ton of empty lines displayed every time we would input anything), and debugging was impossible because we just couldn't see the console (only the host could).
According to the docs, it's possible to share the terminal in both VS Code and Visual Studio, but I don't think there's a way to share the console that comes up when you debug a console app. The solution I see is simply sharing a terminal, running your app in it manually and if you want debugging, you can try attaching the VS debugger to the console app's process after you start it manually by following this guide.

OSX running app acts differently from running on terminal

I have written an app for OSX (Sierra) in Go (lang) with the GUI powered by the Golang QT binding therecipe/qt. When I build the app and run it from the command prompt with command open $(pwd)/myapp.app I get a terminal output while its running, and everything works fine.
When I double click on the app in finder to run it, I obviously don't have access to the console to see debugging, but in parts of the app that work fine in the GUI when I run from console (clicking on things, etc), it crashes the app when run by clicking on it.
I realise people don't know what the app is, and without seeing where in the app it crashes, they can't help me. What I am after is some ideas about debugging it, for instance:
Outputting logs to a text file and tailing the text file to watch as it is written to
Connecting a debugger to the application by the process, perhaps I can discover where it crashes. This doesn't sound straight forward
Is there a way to attach to a console of an application run like this to see what it is outputting?
Any ideas appreciated.
Thanks

bluemix node-red debug not working

I'm working with a node-red application inside Bluemix. It worked well but now the debug sidebar did not show no message.
The application log traces correctly the messages incoming from the IoT device.
I tried to deploy again, to change browser, nothing changed: the debug sidebar is always empty.
What to do to have again messages showed?
Thanks
I had the same issue. Simple Timestamp injection plugged to a debug output and for some reason nothing was shown on the debug side panel.
The solution in my case was simply to set no proxy for the application address in the web browser. After that debugging came through
In my case the problem was a different version of NodeRed was installed on the server, all I had to do is clear Chrome cache.
In my case, I simply didn't have the debug tab selected. I thought I did. You have to click on the little bug icon. I was getting the messages all along, just didn't have the correct display.

My windows phone application runs when ran though visual studio (onclick of device button) but when I disconnect and run it doesn't?

I have written file picker code in my project. When i run the project in my windows phone by clicking on device button in visual studio, the app runs fine(I mean it opens pictures library and i can select a photo and preview it).
But when I disconnect my usb and then open the app in the phone and when i open pictures library on click of a button , the pictures library opens briefly and then the app crashes immediately(My app closes).
Can anyone please help me with this??
As written in the blog post , the AndContinue method run in a different process and to do so, the current running app goes into the background or even gets closed sometimes, that is what you are experiencing in your app as far i can tell but not sure why different things happening during debug & deploy.
There must be a callback inside app.xaml.cs specifically to handle the condition when calling application(which was sent into background) comes in foreground, read this blog post carefully & you'll understand as what you need to change in your code :
using-the-andcontinue-methods-in-windows-phone
http://blogs.msdn.com/b/wsdevsol/archive/2014/05/08/using-the-andcontinue-methods-in-windows-phone-silverlight-8-1-apps.aspx
I just dealt with this issue and one of the reasons why there are differences between debug and deploy is because of the suspending event.
During debug, the application does not actually get suspended until you manually do it through Lifecycle Events. This means that when you pick a file on debug and the app is put to the background to load the file picker, it is not actually suspended, while when the app is deployed, it actually gets suspended.
Look into your app_resuming method and OnSuspending methods in your app.xaml that may be causing errors not occurring during debug.

WP7 app won't launch from app list

I have a simple Windows Phone 7 application which is working perfectly when started from Visual Studio. However, if I deactivate the app (press Windows button or back button from the application's MainPage) and then click the app's icon to relaunch, the screen will flash and return to the list/home screen. I assumed this was an issue with the emulator but when I got a developer device I have the same issue.
Note that reactivating without a complete tombstone works (pressing Windows button from the app and then back).
I have no idea what causes this or how to proceed with debugging. Hopefully someone else has experienced this and knows a fix.
Turns out there is a bug, i found the solution here http://forums.create.msdn.com/forums/p/67522/416995.aspx
In short, it turns out that the Microsoft.Xna.Framework.Media.MediaLibrary class (which I am using to display pictures on applications main page) is not properly initialized when the user has not opened a media hub prior to you calling it. So picture collection properties are null or empty. The solution is to add a call to MediaPlayer.Queue.ToString(), it will force the initialization of the native media library allowing you to invoke the MediaLibrary later on.
Sounds like an unhandled error on startup is causing the app to crash.
Trap/log/handle/display any unhandled exceptions. Also check what you're doing on startup.
IF you are saving something (to Isolated Storage) after first run and then opening it on subsequent launches then that's where I'd look first.
If it works when launched from Visual Studio then this will probably be due to the way you are rebuilding/redeploying the app before launching it in that case.

Resources