no device in android studio with flutter - android

I installed the Flutter correctly and added it in the environment variables and also added Dart
I added an emulator and ran it before creating a project as a kind of experiment
When I create a project, it does not give me the device
As shown in the pictureenter image description here

To prepare to run and test your Flutter app on an Android device, you’ll need an Android device running Android 4.1 (API level 16) or higher.
Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
In the terminal, run the flutter devices command to verify that Flutter recognizes your connected Android device.
Start your app by running flutter run.
By default, Flutter uses the version of the Android SDK where your ADB tool is based. If you want Flutter to use a different installation of the Android SDK, you must set the ANDROID_HOME environment variable to that installation directory.

Related

How to install AVD on VS code?

The error is saying that:
"No suitable Android AVD system images are available.You may need to install these using sdkmanager, for example:
sdkmanager "system-images; android-27; google_apis_playstore;x86"
Can someone help me out with it?
Thanks a lot!
How to SetUp Emulator For VSCode?
From version 2.13.0 of Dart Code, emulators can be launched directly from within code but This feature relies on support from the Flutter tools which means it will only show emulators when using a very recent Flutter SDK. Flutter’s master channel already has this change, but it may take a little longer to filter through to the dev and beta channels.
We have tested this feature and worked very well on flutter version 0.5.6-pre.61
You do not need Android Studio to create or run a Virtual Device. Just use sdkmanager and avdmanager from the android sdk tools.
Use the sdkmanager to download a system image of Android for the x86 system. e.g. sdkmanager “system-images;android-21;default;x86_64
Then create a new virtual device using avd manager. e.g. avdmanager create avd –name AndroidDevice01 –package “system-images;android-21;default;x86_64”
Then run the new virtual device using the emulator. If you don’t have it just install it using the sdkmanager. e.g. emulator -avd AndroidDevice01
If you restart VSCode and load your Flutter project. The new device should show up at the bottom right of the footer.
For those people using a Mac, you can go to your terminal and type
$ open -a Simulator.app
and this command will open the simulator. After that, just go to the Debug option and tap on “Start Debugging”
If you want to test with an Android Emulator:
What I did was to go first to Android Studio and open a virtual Device with AVD Manager. After that, you’ll see other devices in your Visual Studio Code.
In the bottom right you’ll see now that you have 2 devices connected. Now, you can test with any of these devices.
So You can use the ‘Android iOS Emulator‘ plugin and Add the Android Studio Emulator script to your settings in Visual Studio Code:
Mac:
emulator.emulatorPath": "~/Library/Android/sdk/tools/emulator
Windows:
emulator.emulatorPath": "<your android home>\\Sdk\\emulator\\emulator.exe
Linux:
emulator.emulatorPath": "~/Documents/SDK/tools
Your visual studio code settings are found here: File -> Preferences -> Setting -> User Setting -> Extensions -> Emulator Configuration. Open command palette Cmd-Shift-P -> Type Emulator.
ctrl+shift+p
then type:
Flutter:launch emulator
run this command in your VS code terminal flutter emulators then see the result if you have installed any emulator it will show you, then to run one of them use flutter emulators –launch your_emulator_id in my case flutter emulators –launch Nexus 6 API 28 but if you haven’t installed any emulator you can install one with flutter emulators –create [–name xyz] then run your project flutter run inside the root directory of the project.
You can review the full answer from the following link

No Devices in VS Code - Flutter

I'm new to flutter app devleopment. I've installed Flutter SDK and I'm using VS Code. I want to test my demo app in my android device, I've enabled Developer mode and USB debugging option in my android device. In the status bar, VS Code shows, No Device though I connected via USB cable. How to resolve this problem? Do we need Android SDK for this?
Screenshot
connect your phone then you need to run adb devices on command line while your phone is unlocked it will show allow debug alert on phone accept and it will show
you can download command line tools and use sdk manager if you don't have android sdk
Run VS Code as administrator.
Check the result from terminal output: flutter doctor

Is it possible to create and maintain Android Virtual Devices WITHOUT installing Android Studio?

The development I'm taking on is written in TypeScript/JavaScript, and all the instructions left behind use TNS (Telerik NativeScript) command lines to build, debug and publish the apps, for both Android and iOS.
Setting up my Windows PC with Visual Studio Code, Node.js, NativeScript, and the Android SDK, I have got to the point where I can build the application using > tns build android but I cannot run it as I have no devices.
Going back to the NativeScript instructions, it does clearly say that an Android Virtual Device is needed, but the link takes me to how to setup an AVD using Android Studio.
Well, I do not want to install another IDE just to be able to manage AVD's. I'm familiar with VS Code, all the original development was done in VS Code on iOS, and all the documentation, including screenshots, are from VS Code.
Supposedly, there is an AVDManager.exe in C:\Android\android-sdk\tools\bin\, but there certainly isn't in my installation of the SDK.
> emulator -list-avds shows nothing.
> tns device android --available-devices also lists no available emulators.
Embarcaderos' RAD Studio includes an Android emulator, but I'm using Delphi 10.2 Tokyo for desktop development, so don't have access to that emulator on this machine.
Is there any other way to create an AVD, so that when I type > tns run android from the working folder of the mobile app, it starts the emulator and runs the app within it?
You can download just the SDK command line tools via the android studio download page -> "Get just the command line tools".
The emulator program and the avdmanager should be everything you need to get an emulator up and running.

How to develop android apps with xamarin without hyper v and emulator

I am using windows 10 home and visual studio 2017. I want to develop android apps with xamarin. Hyper-V feature is not available on windows 10 home and I can not afford pro version, So emulator is not installing without hyper-v.
What should I do to develop android app?
Have anybody idea to deploy android app without using emulator and hyper-v?
Thank you in advance!
It's possible to develop Xamarin app without using the emulators. But in that case you'll need to have an Android device to deploy your app on.
Setup Android SDK Manager on your system. Although Xamarin includes a
SDK Manager, you can download it from the following link. Android SDK Manager download
Setup the ADB (Android Debug Bridge) on your system (install Google USB Drivers)
Connect your Android device to the system after you enable USB Debugging(Developer options) on it. Once the device is connected it will give you a prompt to enable debugging. Tap yes and you'll see the option to build to your device as shown in image.
You can try to use any avaliable on windows android emulator. I like to use Bluestack (https://www.bluestacks.com), the steps for use it below:
Install Bluestacks emulator
Launch emulator and wait for load finished
It's your wellcome screen, your application and apps from store will be here
Go to settings > Preferences and check "Enable android debug bridge (ADB)" + "Enable Android input debugging"
One time Setup finished
"Open android adb command promt" and type
adb connect 127.0.0.1:5555
If you have done everything good you will be connected to emulator and ready to debug your application
Good luck!
UPDATE:
As of visual studio 2019, non-hyper v emulation has been stopped.
Old Answer
I am very positive that at the time of VS installation the Visual studio emulators for Android are readily available for download and use, there you can find a good amount of android emulators also it provides you with Android SDK which again can be used to create Android emulators without using Hyper-V
The below link contains all you need to know about Visual studio emulators including on how to install :
https://msdn.microsoft.com/en-us/library/mt228279.aspx
Hope this Answers your question.
Goodluck!

Android Jenkins Builds

I am developing Android apps on Windows platform. I can create and build android apps using command-line tools successfully on the local machine without a problem.
I decided to use Jenkins to build apps remotely. I could succefully created a windows slave and created a test app using command line tools. But I can't get it to be emulated remotely with this :
C:\Dev\workspace\com.this.test\cordova\cordova.bat
This line works locally, but if I use it on Jenkins, it produces this error.
c:\Dev\jenkins\workspace\buildtest>C:\Dev\workspace\com.this.test\cordova\cordova.bat emulate
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
You don't have any Android Virtual Devices. Please create at least one AVD.
android
Build step 'Execute Windows batch command' marked build as failure
EDIT:
If I run the following command locally,
%comspec% /c android.bat list avd
it lists the AVDs like below.
Available Android Virtual Devices:
Name: ap16
Path: C:\Users\tt\.android\avd\ap16.avd
Target: Android 4.1.2 (API level 16)
ABI: armeabi-v7a
Skin: WVGA800
But if I send it via Jenkins it says nothing but :
Available Android Virtual Devices:
Did you create an emulator on the remote machine? i.e. Via the android create avd command line, or using the SDK Manager tool.
More simply, you can also install the Android Emulator Plugin to automatically handle creation of emulators.
Edit, after more info was provided:
Emulators created are per-user — they're not shared between all users of a machine.
Presumably you're running Jenkins as a different user, e.g. the system user by running Jenkins as a Windows service. Therefore it sees a different set of emulators as you do when logged in to your account.
I would still recommend using the emulator plugin, so that Jenkins can create its own emulators when it needs to (though note the "Known Issues" about running as a Windows system account). Alternatively, you can probably create the emulators manually as the Jenkins account, or change the Jenkins service to "run as" your regular user.
Try to install Android Emulator plugin, but I also faced issue with the latest version of this plugin and there is no option to downgrade it.
I tried to create virtual device in Jenkins and also tried to use existing virtual device - errors in both cases...

Categories

Resources