Skip to content

Commit

Permalink
Adding wireless debugging information to the docs (#8456)
Browse files Browse the repository at this point in the history
We've added support for wireless debugging of iOS devices. This PR adds
documentation for setting it up.

To do:
- [x] Add in information about IPv4 and IPv6  to `flutter attach` page
- [ ] Specify the Flutter release where this feature is available
- [x] See if there's any information needed for Android wireless
debugging

_Issues fixed by this PR (if any):_
#8425

## Presubmit checklist
- [x] This PR doesn’t contain automatically generated corrections
(Grammarly or similar).
- [x] This PR follows the [Google Developer Documentation Style
Guidelines](https://developers.google.com/style) — for example, it
doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person).
- [x] This PR uses [semantic line
breaks](https://github.com/dart-lang/site-shared/blob/master/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks)
of 80 characters or fewer.

---------

Co-authored-by: Victoria Ashworth <[email protected]>
Co-authored-by: Brett Morgan <[email protected]>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
  • Loading branch information
4 people authored and atsansone committed Apr 21, 2023
1 parent 5c9a7b3 commit b93fdd1
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 1 deletion.
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

0 comments on commit b93fdd1

Please sign in to comment.