Dart: debugging dart app doesn't work from within WebStorm, running works fine - dart

I am using webstorm. And I have setup a small sample app. Running the app displays the following in the output window
C:/dart-sdk/bin/dart.exe --ignore-unrecognized-flags C:/Users/testuser/WebstormProjects/TestDart/TestMe.dart
You are using Windows
Process finished with exit code 0
but when debugging it just sits there with the following output
C:/dart-sdk/bin/dart.exe --ignore-unrecognized-flags --debug:57939 C:/Users/testuser/WebstormProjects/TestDart/TestMe.dart
I have a breakpoint set in the main() funciton on this line, but it never hits it
stdout.write("You are using ");
I have no firewall and also I don't think i need dartium installed as this is just a standard console application that prints things out.
Anyone have any success?
thanks

Debugging Dart console application doesn't currently work:( Please watch WEB-9937 to be notified on any progress

Related

Hide Console Window in Dart on windows

I want to build an application with Dart in Windows.
How to hide the console window when application will be start? Like a background service.
Thanks.
It is kinda a hack where the console window will flash really quickly since the program will spawn the console window but the first line will then hide it again:
import 'package:win32/win32.dart';
void main() {
ShowWindow(GetConsoleWindow(), SW_HIDE);
// Your program...
}
But the rest of your program will then run in the background.
(Inspired by: https://stackoverflow.com/a/9618984/1953515)
Another ("hacky") solution could be to do what is suggested in the following where we do a change on the generated exe file from dart compile exe with editbin.exe: https://stackoverflow.com/a/2435907/1953515

Difference in manual execution of running app in background and runAppInBackground() using appium

While executing runAppInBackground() for Android application through Appium the app gets restarted but when executed the same manually couldn't be able to reproduce the same. I Would like to deep dive into implementation of a runAppInBackground() method to reproduce the same issue in a manual way.
You need to look behind the code of runAppInBackground
From java client side (your test code) perspective, it is a single call to Appium server:
POST "/session/:sessionId/appium/app/background"
If you continue looking into where its implemented on server side, you finish with appium-android-driver function.
In short what it does:
Get current activity and package
Press physical Home button
Wait for time you provided as argument (seconds)
Bring up back in focus based on different conditions; from the code you can understand what activity is being started
Basically its a sequence of adb shell commands, that you can run from terminal.
My guess is that step 4 you did manually may differ from what Appium is doing: different activities/arguments for activity been called

Program white-screening all of a sudden

I've been working for a few days on an electron application. When I was done working for the day yesterday, the program was working and running just fine. I came in this morning to start working on it again, and now all of a sudden partway through the program it just whitescreens now. I have not changed anything from the time of working on it last (last known working) to current time.
I do not see any errors being logged to the powershell console after running npm start (Program does not work packaged either), and when I use inspect element it just says:
DevTools was disconnected from the page.
Once page is reloaded, DevTools will automatically reconnect.
But it just sits on this white page forever.
This page has quite a lot of code (531 lines), but I am completely unable to pinpoint the problem because there are no errors logged. That said, I began taking pieces out of my code trying to get it to work, and I was able to narrow it down to the code below.
What can I do to fix my application?
This is the code I narrowed it down to, when I comment out this code, the page runs fine.
var audio = require('win-audio').speaker;
weirdly enough, this is one of the first pieces of code that I had written in this page of the application, and it has worked until just today.
I just found out that if I plug in some speakers, the program no longer whitescreens. But this isn't really a good fix, because this program will be ran on hundreds of computers a day that may or may not have speakers.
UPDATE::
Ok, I think I have fixed it. To try it out:
Download my fork at: https://github.com/11AND2/win-audio
In your terminal change dir (cd) into the directory e.g. "cd C:\...\win-audio"
run command "npm run install" - this rebuilds the module
To test it run "node sample.js" and activate/disable your audio devices
If at any point you want to check if the device is alive just run
var audio = require('win-audio').speaker;
var _vol_alive = audio.get();
if (_vol_alive === -999) {
console.log("this device is dead :-(");
}
in your application. Please note that I have not changed the API at all so there should be no need to change your application code.
Please give me a heads up if the fix works for you so I can create a pull request for the fix. I am not the creator of this plugin, all my changes are public domain.
DEPRECATED::
Ok, I have found a fix for you. Would it be ok if:
var audio = require('win-audio').speaker;
returns -1 if no device is found?
So you could do:
if (audio !== -1) {
audio.set(30);
}
Please give me a short heads up and I will post the implementation route.

view iphone console logs without a mac

Is there a way to view the iphone console logs without having a mac ?
It used to be possible using the iPhone Configuration Utility but it does not seem to be available any longer.
I saw a tool called iTools but it seems to require a 32bit version of itunes which is also not available any more.
Given an iPhone device + windows + linux, Is there any workaround / tool to view the iphone console logs?
Realizing it is over half a year ago you asked this, but since it does not have an accepted answer yet:
I ran into this very same issue over and over, and got fed up with it, so I decided to have a go at writing a script that displays console messages in HTML, so you can just view everything in the webpage itself, without having to resort to a console-replacement or a tedious remote debugger (for which you, indeed, require a Mac), without having to modify each console call in existing code.
The key lies in 'replacing' the four main functions in window.console: log, warn, error and trace. This is done by redifining each method, adding own code to that, and calling the original method in the end. Jakub Fiala wrote the basic script for that, on which I built the rest: https://gist.github.com/jakubfiala/8fe3461ab6508f46003d
I dubbed it 'MobileConsole'. It is quite unobtrusive and will 'catch' all console.log (or .warn, .error or .trace) events, and even bind to window.onerror.
I have created a separate page for this script with an elaborate explanation on how it works, including a demo, over here.
Download this from the app store onto the iphone, you can then view logs directly on the phone:
https://itunes.apple.com/us/app/console/id317676250?mt=8
Please note, this is an old app, it will crash when launched, then on reopening it will show you the device logs.
If that fails, here is a link to the iPhone configuration utility for windows:
http://download.cnet.com/iPhone-Configuration-Utility-for-Windows/3000-20432_4-10969175.html

Redirect BlackBerry device simulator output to console

I'm currently developing a BlackBerry application using JDE 4.6.1 on Windows XP. Since I'm running the application directly from the console using fledge.exe I would like to know if there is a parameter for redirecting my application output, namely a simple system.out.println call, to the windows prompt console. Right now I'm able to view that output only on the Eclipse console window in Debug mode.
The simulator only outputs through its JDWP interface. If you don't want to use Eclipse, but are ok with a lighter-weight non-command-line tool, you can run the standalone debug server - you'll find a jdwp.bat file under your eclipse\plugins\net.rim.ejde.componentpackX.X.X.X\bin directory.
There may also be command line tools that let you print JDWP info, not sure as I haven't ever used one.
I don't know of a way to redirect the output, but you might consider using the BB event logger. You can use a simple script to extract the logger output

Resources