9

Is it possibly to run flutter app on device without connecting to computer, something like expo for Flutter?

Temuujin Dev
  • 692
  • 2
  • 8
  • 20

4 Answers4

8

assuming that you're using an Android device, it should be possible if you pre-connect the device to the computer wirelessly after some initial setup provided here: https://developer.android.com/studio/command-line/adb#wireless

tanyehzheng
  • 2,201
  • 1
  • 20
  • 33
5

You can use adb wifi plugin. Or else you can use these commands(Which is mentioned in here). You can write a *.bat file with these commands.

adb tcpip 5555
adb connect xxx.xxx.xxx.xxx:5555 // IP address of your device xxx.xxx.xxx.xxx:5555
echo finished - unplug USB connection
pause

Note: This is only for Android devices

Ashan
  • 326
  • 3
  • 11
2

For Android:

  1. Connect your Android device and adb host computer to a common Wi-Fi network accessible to both. Beware that not all access points are suitable; you might need to use an access point whose firewall is configured properly to support adb.
  2. If you are connecting to a Wear OS device, turn off Bluetooth on the phone that's paired with the device.
  3. Connect the device to the host computer with a USB cable.
  4. Set the target device to listen for a TCP/IP connection on port 5555.

    adb tcpip 5555

  5. Disconnect the USB cable from the target device.

  6. Find the IP address of the Android device. For example, on a Nexus device, you can find the IP address at Settings > About tablet (or About phone) > Status > IP address. Or, on a Wear OS device, you can find the IP address at Settings > Wi-Fi Settings > Advanced > IP address.

  7. Connect to the device by its IP address.

    adb connect device_ip_address

  8. Confirm that your host computer is connected to the target device:

    $ adb devices List of devices attached device_ip_address:5555 device You're now good to go!

If the adb connection is ever lost:

  1. Make sure that your host is still connected to the same Wi-Fi network your Android device is.
  2. Reconnect by executing the adb connect step again.
  3. Or if that doesn't work, reset your adb host:

    adb kill-server Then start over from the beginning.

Source of information.

If you don't want to do all these steps manually then you can use this plugin in Android Studio:

https://plugins.jetbrains.com/plugin/7856-adb-wifi/

See also:

https://android.jlelse.eu/connect-android-device-with-wifi-within-android-studio-3b1bc00c1e17

Kalpesh Kundanani
  • 5,413
  • 4
  • 22
  • 32
0

For android device only, on a linux type OS.

adb tcpip 5555 && adb connect 192.168.***.***

unplug your device and you're good to run.

Wale
  • 1,644
  • 15
  • 31