How to connect device over Wifi in VScode on Mac to debug Flutter app? - flutter

I would like to be able to use WIFI to debug my Flutter app on VScode. I am using a mac and would not like to use the connection via USB

You can't debug wireless in Visual Studio Code with iPhone and Mac.
You should run your project with Xcode to use the wireless option, but after that, you lose the hot reload option.
So, it's impossible to debug an app with hot reload and wireless at the same time :(
To run the Flutter project with Xcode :
Open your project in VSCode
Click right on iOS folder
Select the Open in Xcode option
Xcode will run your iOS Runner
If you have any errors in Xcode - see this link from the Flutter documentation

Related

Flutter app is not showing as an icon on the android emulator homescreen

I am trying to build an app. I am using flutter as the framework and VS Code as my IDE. I also have an android emulator installed via android studio. I am trying to implement authentication. If i run my app it opens in the emulator and works just fine. Now i want to test if a user stays logged in when the app is closed (not running in the background) and reopened. However if i close the app in the android emulator, the whole process stops and there is no icon of my app on the home screen with which i could restart it. I have to "run and debug" again in VS Code to restart the process. Is there any way to start the app again via the emulator phone?
I updated the emulator and the flutter package, i changed emulator devices. Did not solve the problem.
Because when your app is disconnected from debug - you can use hot restart its consider as app is kill and open again - here having a problem with flutter if you disconnect from debug your all assets will be remove from entire app. Another option - if you want to test your app then make release app and installed in physical device
You can try to run your app from VS Code itself.
Use this bottom Menu button to launch emulator:
Select your Emulator from listed / Create a new one:
Hope it helps!

how to run flutter app in VSCode without android studio emulator

I want to run flutter app in VS.Code without android studio emulator.
I want run my app without install android studio.
How can I do this?
If you have Gradle properly installed globally (https://gradle.org/install/) and the Android SDK setup on your machine, then you should not need the IDE.
Try first checking for available devices:
flutter devices
Then using the device that you find (if there are any spaces in the name that represents the device then use "" to format the command), execute the following command:
flutter run -d "Device Name With Spaces" --release
Or:
flutter run -d DeviceNameWithoutSpaces --release
The first option is You can run your application on chrome or edge if you don't want to download an emulator. Follow the following steps:
Click on the no-device option to select the device.
Now select chrome or edge
And the second option is you can connect your mobile with your PC and use your phone to run the flutter apps. Follow the following steps:
For Android:
Enable developer options and USB Debugging on your device. This varies slightly
by android version. But the short version is you tap on the device build number
7 times.
Then a “Developer Options” option comes up. After that, you can click “enable
USB Debugging.”
Then plug your phone into your computer with a USB cable. You’ll see some popup
on your phone asking if you want to allow USB debugging with that computer.
Click on “yes”.
Run Flutter just like you would if you had a simulator running.

How to create IOS Simulator Flutter

I am a newbie for the flutter Using AndroidStudio as IDE.
I successfully create the Flutter Application and able to run it on Android emulator.
Can I create IOS simulator to test the Application using Android studio? If Yes Please suggest how it is possible?
Yes, I'm using Android Studio with IOS Simulator. Open the simulator in your mac and you can show device in Android Studio.
You can open simulator only with this command
open -a Simulator
And you will show the iPhone device in Android Studio when the simulator opened.
You can also configure the Xcode command-line tools from Xcode by opening Preferences>Location and selecting it from dropdown.
After selecting Xcode version you can find iOS Simulator name in your Android Studio for flutter project.
Open your terminal and type only "open -a Simulator" that it.
The iOS simulator is part of XCode and only runs on Apple OSX
See also https://developer.apple.com/library/content/documentation/IDEs/Conceptual/simulator_help_topics/Chapter/Chapter.html

Debug Apache Cordova with Visual Studio Code

I have a simple question: can I debug Apache Cordova with VS Code?
I have simple installed and created an app(https://cordova.apache.org/) and then opened the app in VS Code, but I cannot debug it.
Thanks!
First, start up the app on your device / emulator / simulator of choice using. See the TACO CLI docs for help with pre-reqs... running is simple.
To debug, for Android 4.4+, you can just use Chrome Dev Tools. See Chrome documentation on Remote Debugging Devices. This works for Cordova apps too.
For iOS, you can do the same thing from Safari on your Mac. Check "Show Develop menu in menu bar" under Preferences.. >Advanced. Then use the Develop menu to find your device and the cordova app running on it. Be sure to go to Settings > Safari > Advanced and enable the "Web Inspector" option on your device as well.
Yes this is very much possible with the vscode-cordova extension. Install this extension to your VSCode and you should be able to debug the app running on iOS/Android device & simluators/emulators. More details on this is available at the VSCode-cordova github readme.
https://github.com/Microsoft/vscode-cordova

MoSync IDE: how to run apk in Bluestacks?

I'm trying out the MoSync IDE (special version of Eclipse to develop cross-browser Android and iOS apps with HTML/Javascript).
It currently uses the standard SDK Android emulator which is rediculously slow. I found Bluestacks which is a lightning-fast android emulator.
I already found out how to use Bluestacks with Phonegap from within Eclipse (by using the adb connect command), but I can't figure out if it's even possible to test apps on Bluestacks from within the MoSync IDE...
Any ideas?
This works on Mac, and I see no reason why it should not also work on Windows:
Start Bluestacks
Run MOSYNCDIR/bin/android/adb connect localhost:10001, where MOSYNCDIR is your MoSync installation directory
In the MoSync IDE, click the tiny arrow next to the Select Target Device toolbar item and in the dropdown select Scan for Android USB device
If properly connected, a dialog pops up with a list of connected devices. Select localhost:10001 and click Ok
To actually run on the emulator, select a project in the Project Explorer (usually the leftmost panel in the IDE). Then click the Send to Target Device toolbar item.