How do I connect Flutter with Genymotion?

大城市里の小女人 提交于 2019-12-07 21:11:01

问题


I have a problem with running my Flutter app on Android emulator using Genymotion.

After launch emulator, I have tried to "flutter run", but it didn't work. Console shows "No connected devices."

So how can I connect flutter with Genymotion? Could you tell me something? https://gyazo.com/7d75068683c043922c5fff75377e9817 https://gyazo.com/c9ccae04ffdfba3fa66fa6ff7e038e8f

The reason why I want to use Genymotion is Android Studio is too heavy.

But I wonder Flutter doesn't work on Genymotion without Android Studio.


回答1:


  1. Install the Genymotion plug-in for Android Studio (Within AS: Tools > SDK Manager > Plugins > Genymotion). Restart AS

  2. Configure the SDK within Genymotion (Genymotion > Preferences > ADB > Use custom Android SDK tools) then use the path /Users/{Your user}/Library/Android/sdk (default location after installing AS)

  3. Create a new device within Genymotion

  4. Configure correct Genymotion path within AS:

    a. View > Toolbars (to display the Genymotion icon if not default appearing)

    b. Press the Genymotion icon in the toolbar (appears next to magnifying glass at the right hand side)

    c. Point the path to the Genymotion folder location (eg: /Applications/Genymotion)

    d. Close the box

Now you are set up, so in future press the icon, select your emulator and run to launch within Android Studio. This will be detected by flutter when trying run apps using flutter run command.




回答2:


First Start the Genymotion emulator which you already downloaded an image and installed.

When emulator status is ON the open a command and run the following command:

flutter devices

If you see the installed image on output then like below then everything is fine:

PS F:\osx> flutter devices

1 connected device:

Samsung Galaxy S9 • 192.168.150.101:5555 • android-x86 • Android 8.0.0 (API 26)

Simply select the device on VScode or Android Studio and hit the run.




回答3:


1) Install genymotion correctly. you can see here: [https://www.genymotion.com/plugins/][1]

2) install the Genymotion plugin for Android Studio

2-1) In Android Studio, go to File/Settings (for Windows and Linux) or to Android Studio/Preferences (for Mac OS X)
2-2) Select Plugins and click Browse Repositories.

2-3) Right-click on Genymotion and click Download and install.

This is what you need to do if the genymotion icon don't apper.

2-4) To see Genymotion plugin icon, display the toolbar by clicking View > Toolbar.

After the last step, I can see the icon now and run my app with genymotion.

I hope this will help you, since after struggling to find it works for me



来源:https://stackoverflow.com/questions/54825729/how-do-i-connect-flutter-with-genymotion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!