Dart DevTools showing "Connect to a running app" - debugging

I can't start the Dart Dev Tools in VS Code, when I launch in debugging mode it opens a chrome window says Connect to a running app
Enter a port or URL to a running Dart or Flutter application.
When I hover over the Dart DevTools button, it shows a port but I still can't connect to it.
Any ideas?

Start your flutter app with --observatory-port option. For example,
flutter run --observatory-port=9200
Once the app starts, you’ll see a message in your terminal that looks like:
An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:9200/Swm0bjIe0ks=/
Paste the URL you got from running your app (http://127.0.0.1:9200/Swm0bjIe0ks=/) into the connect dialog to connect your app to DevTools.
Hope this helps.

On Visual Studio Code: click the letter (v) while the app is running. that's it!

In Run flutter in Terminal with port you want. It can 9200 or 9300 or 9301 etc
flutter run --observatory-port=9200
On the logcat you will see message look like
"An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:9200/Swm0bjIe0ks=/"
After that copy and past url (http://127.0.0.1:9200/Swm0bjIe0ks=/) to dialog connect your app to DevTools

Hi run your app on emulator or real device.
On bottom of android studio you will find a run tab
on run tab there will be a message like below:
Debug service listening on ws://127.0.0.1:54675/CPu_ErpGRaw=/ws
copy (ws://127.0.0.1:54675/CPu_ErpGRaw=/ws) and paste it on Dart DevTools input field.
It will be connected to your running device or emulator

In my case the above answers did not work due I had another problem: PATH: the enviroment variables. This was because I couldn't execute flutter command in the terminal at my folder app project , so enviroment variables at system level it's necessary and I was doing this at user level for Windows. So I run flutter doctor o whatever to see if alredy the path was working and then I used the answer of #Hayeong Choi.

Related

React Native app stuck on blank white screen with remote debugging using Nuclide

Steps to Reproduce / Screenshots
Apply all operations from the instruction:
Create a blank React Native project with $ react-native init [project name].
From the command Palette (Cmd-Shift-P), choose "Nuclide React Native: Start Packager" to start the React Native Server.
After starting the server, you can prime the React Native Debugger for when the application begins running. From the command Palette (Cmd-Shift-P), launch "Nuclide React Native: Start Debugging".
Ensure that you are in the root directory of the React Native project, then run the application from the command-line: $ react-native run-ios (or choose another existing simulator, for example, react-native run-ios --simulator="iPhone4s").
(Important: #4 should follow AFTER #3, and chrome debugger should be closed).
From the iOS simulator, press Cmd-D (Ctrl-D on Linux). This will bring up the debug options for your application. For example, select Debug JS Remotely.
Environment
Atom version 1.15.0
Nuclide plugin version 0.214.0
React Native version: 0.42.3
Platform(s) (iOS, Android, or both?): iOS
Device info Simulator/Device? - Simulator iOS 10.2 / iOS 8.1
OS version? - MacOS 10.12.3
Debug/Release? - Debug
In the same doc said: "...After you enable debugging (#5) from the simulated application, Nuclide will attach to that debugging process automatically since we primed the Debugger above (#3)." So before I clicked Debug JS Remotely I saw the working react app as expected:
And after I clicked Debug JS Remotely I see that the Nuclide debugger changed its status from Starting debugger... to The debuggee is currently running. as expected as well:
BUT after I click Debug JS Remotely I see white screen only
And there are no errors. As soon as I turn off remote debugging, everything loads fine again.
This happens with Nuclide debugger only, with chrome debugger, everything works well.
check maybe there is no breakage in your code. it sometimes happens when you skip some minor errors.

Appcelerator doesn't work with genymotion

I cannot get appcelrator to work with Genymotion.
Everytime i "run" - that is, hit the green run button in the top-left - i get [ERROR] : Failed to install apk on "192.168.25.101:5555"
[ERROR] : Error: device not found
This isn't useful nor is it helpful.
I can manually drag the created .apk file into genymotion and it will run it (although, irritatinly, it immediately crashes as I'm upgrading an old app to whatever new style appcelerator have decided on).
All the posts on this are from 2014 and not very useful - I also cannot get appcelerator running genymotion on a blank new project.
I installed genymotion to a different directory, but appcelerator seems to find it and start it - i can see genymotion start up.
What am i missing?
Sometimes I have seen the Appcelerator emulator wait startup timeout before Appcelerator can send the APK. What I have done is start the emulator first independent of the 'run' command in Appcelerator, then select the emulator from Appcelerator and then Run. If the emulator has started, then it will send it without having to drag/drop the apk manually.

App not being started on device

I'm trying to play with NativeScript to create any simple android app. I've done step 1 from NativeScript's 'Getting Started' (setting up my osx environment) and right now, i have a barebones NativeScript app created with tns create and android platform added to it.
When running tns run android everything goes well and the final message before device debug logs (i'm not an android/ios/mobile dev so i assume that it's just some kind of debug log of what's going on connected device) is:
BUILD SUCCESSFUL
Total time: 11 seconds
Project successfully built
Using /Volumes/HDD/Users/michal/Workspace/Sandbox/tns_hello_world/platforms/android/bin/tns_hello_worl d-debug.apk
Successfully deployed on device with identifier '00099fbd72369f'
However, there is nothing going on my device after that. No app is being launched, no error message. Just completely nothing.
My setup is:
OSX 10.9.5
Java 1.8.0_45
Samsung GT-I9100
Android 4.1.2
Have you any idea what am i possibly doing wrong? Thanks in advance.
Your android device is not supported by NativeScript. Use device with Android 4.2 (API level 17) or newer. You can also try it on emulator.
Jan 2019
I verified in Android 8.1, it works fine.
First look, it looks like not working.
However, after changing the text "Play with NativeScript!" to "Hello world" in home.component.html, I could see the text. The homepage message ideally should say this.

Automator viewer can't get device screen shoot

After started android emulator and run an example app. I run the UI Automator Viewer and click button Device Screenshoot and it shows message:
I've tried to run as administrator but it not successfully!
Looks to an issue with emulator configuration and not specific to your application, try to play with configuration of your emulator

Unfortunately app has stopped Android emulator [duplicate]

This is pretty simple: I'm using NetBeans on Linux with Android emulator 1.6. I have Logcat on my android phone, but the process of getting the messages to somewhere readable isn't smooth at all.
Can someone tell me how to get Logcat running on the emulator? Is there anything I can do to see debug messages other then having to copy the apk to my phone and testing it?
Thanks in advance!
You have a few options for viewing the debug log output, assuming you have the SDK installed and your command path set up correctly:
Type adb logcat. The log output from the connected device or running emulator will appear. I usually prefer adb logcat -v time to see the time stamps.
Type ddms. This launches the stand-alone version of DDMS. It has a logcat display at the bottom.
Install the ADT extension for Eclipse, and open the logcat view. (Since you're using NetBeans I assume this isn't what you want to do, but I'm mentioning it for completeness.)
In all cases, the interaction is the same whether you're using a physical device or software emulator, because the ADB daemon conceals the details. Whatever you're doing for the device is also expected to work for the emulator.
If you have a device and emulator connected simultaneously, you can use adb -e logcat for the emulator and adb -d logcat for the device. From stand-alone DDMS or Eclipse, just pick the device or emulator from the pop-up menu.
If you have setup nbandroid you can find the adb logcat viewer in netbeans under:
Window -> Output -> ADB Log
--edit
Just followed up on the post above and started using C:\Program Files (x86)\Android\android-sdk-windows\tools\ddms which is alot better then the one in netbeans.
The SDK comes with a handy tool called ddms it should be in the tools folder of the SDK.
At the moment an Emulator is running, or a mobile phone is connected to your machine it should show up in ddms and you can see all the log output in ddms.

Resources