Skip to content

Adding wireless debugging information to the docs #8456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions src/development/add-to-app/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,52 @@ Select the device on which the Flutter module runs so `flutter attach` filters f


[debugging functionalities]: {{site.url}}/testing/debugging

### Wireless debugging

You can debug your app wirelessly on an iOS or Android device
using `flutter attach`.


#### iOS

On iOS, you must follow the steps below:

<ol markdown="1">
<li markdown="1">

Ensure that your device is wirelessly connected to Xcode
as described in the [iOS setup guide][].

</li>
<li markdown="1">

Open **Xcode > Product > Scheme > Edit Scheme**

</li>
<li markdown="1">

Select the **Arguments** tab

</li>
<li markdown="1">

Add either `--vm-service-host=0.0.0.0` for IPv4,
or `--vm-service-host=::0` for IPv6 as a launch argument

You can determine if you're on an IPv6 network by opening your Mac's
**Settings > Wi-Fi > Details (of the network you're connected to) > TCP/IP**
and check to see if there is an **IPv6 address** section.

<img src="/assets/images/docs/development/add-to-app/debugging/wireless-port.png" alt="Check the box that says 'connect via network' from the devices and simulators page">

</li>
</ol>

#### Android

Ensure that your device is wirelessly connected to Android Studio
as described in the [Android setup guide][].

[iOS setup guide]: {{site.url}}/get-started/install/macos#deploy-to-ios-devices
[Android setup guide]: {{site.url}}/get-started/install/macos#set-up-your-android-device
3 changes: 3 additions & 0 deletions src/get-started/install/_android-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ you need an Android device running Android 4.1 (API level 16) or higher.
1. Enable **Developer options** and **USB debugging** on your device.
Detailed instructions are available in the
[Android documentation]({{site.android-dev}}/studio/debug/dev-options).
1. [Optional] To leverage wireless debugging, enable **Wireless debugging**
on your device. Detailed instructions are available in the
[Android documentation]({{site.android-dev}}/studio/run/device#wireless).
1. Windows-only: Install the [Google USB
Driver]({{site.android-dev}}/studio/run/win-usb).
1. Using a USB cable, plug your phone into your computer. If prompted on your
Expand Down
33 changes: 32 additions & 1 deletion src/get-started/install/_ios-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,35 @@ and an Apple Developer account. If your app is using Flutter plugins,
you will also need the third-party CocoaPods dependency manager.

<ol markdown="1">

<li markdown="1">
<a name="connect"></a>
To set up physical device deployment in Xcode,
connect your device to the USB port on your
computer.
</li>
<li markdown="1">
<a name="wireless"></a>
[Optional] To leverage wireless debugging, ensure that
your device is on the same network as your computer
and that the device has a set passcode.

While the device is attached, open **Xcode > Window > Devices and Simulators**.
Select your phone, and check **Connect via Network.**
For more details, check out
[Apple's documentation on pairing a wireless device with Xcode][].

Once the network icon appears next to the device name,
you can unplug your device from USB.

Sometimes it takes longer to find network devices.
If you don't see your device listed when using `flutter run`,
try extending the timeout: `flutter run --device-timeout 10`.

For additional help troubleshooting,
check out [Apple's Developer Forums][]. For setting up
wireless debugging with `flutter attach`,
checkout [Debugging your add-to-app module][].
</li>
<li markdown="1">

<a name="trust"></a>
Expand Down Expand Up @@ -186,3 +214,6 @@ or clicking the Run button in Xcode.
[Xcode account add]: {{site.url}}/assets/images/docs/setup/xcode-account.png
[Apple Silicon Mac]: https://support.apple.com/en-us/HT211814
[Developer Mode]: https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device
[Apple's Developer Forums]: {{site.apple-dev}}/forums/
[Debugging your add-to-app module]: {{site.url}}/development/add-to-app/debugging/#wireless-debugging
[Apple's documentation on pairing a wireless device with Xcode]: https://help.apple.com/xcode/mac/9.0/index.html?localePath=en.lproj#/devbc48d1bad