Commit Graph

110 Commits

Author SHA1 Message Date
Lau Ching Jun
c759c22e71
Fixed race condition in PollingDeviceDiscovery. (#145506)
There are two issues in the previous implementation:
1. `_populateDevices` will return the devices from `deviceNotifier` if it had been initialized, assuming that once it's initialized, it has been properly populated. That assumption is not true because calling getters like `onAdded` would initialize `deviceNotifier` without populating it.
2. `deviceNotifier` instance might be replaced in some cases, causing `onAdded` subscribers to lose any future updates.

To fix (1), this commit added the `isPopulated` field in `deviceNotifier` as a more accurate flag to determine if we need to populate it.

To fix (2), this commit made `deviceNotifier` a final member in `PolingDeviceDiscovery`.
2024-03-21 22:37:08 +00:00
Jenn Magder
9b442b2749
Print warning and exit when iOS device is unpaired (#144551)
Explicitly handle the case where the iOS device is not paired.  On `flutter run` show an error and bail instead of trying and failing to launch on the device.

On this PR:
```
$ flutter run -d 00008110-0009588C2651401E
'iPhone' is not paired. Open Xcode and trust this computer when prompted.
$
```

Fixes https://github.com/flutter/flutter/issues/144447
Closes https://github.com/flutter/flutter/pull/144095
2024-03-04 23:01:11 +00:00
Victoria Ashworth
d631b26285
New tooling for iOS 17 physical devices (#131865)
This PR includes the following changes. These changes only apply to iOS 17 physical devices.

| Command | Change Description  | Changes to User Experience |
| ------------- | ------------- | ------------- |
| `flutter run --release` | Uses `devicectl` to install and launch application in release mode.  | No change.  |
| `flutter run`  | Uses Xcode via automation scripting to run application in debug and profile mode. | Xcode will be opened in the background. Errors/crashes may be caught in Xcode and therefore may not show in terminal. |
| `flutter run --use-application-binary=xxxx` | Creates temporary empty Xcode project and use Xcode to run via automation scripting in debug and profile. | Xcode will be opened in the background. Errors/crashes may be caught in Xcode and therefore may not show in terminal.  |
| `flutter install` | Uses `devicectl` to check installed apps, install app, uninstall app.  | No change.  |
| `flutter screenshot` | Will return error.  | Will return error.  |

Other changes include:
* Using `devicectl` to get information about the device
* Using `idevicesyslog` and Dart VM logging for device logs

Note:
Xcode automation scripting (used in `flutter run` for debug and profile) does not work in a headless (without a UI) interface. No known workaround.

Fixes https://github.com/flutter/flutter/issues/128827, https://github.com/flutter/flutter/issues/128531.
2023-08-09 19:25:12 +00:00
Victoria Ashworth
25e98b54d7
Fix duplicate devices from xcdevice with iOS 17 (#128802)
This PR fixes issue of duplicate entries from `xcdevice list` cause devices to not show in `flutter devices`, `flutter run`, etc.

When a duplicate entry is found, use the entry without errors as the authority. If both have errors, use the one with the higher SDK as the authority.

Fixes https://github.com/flutter/flutter/issues/128719.
2023-06-20 18:16:27 +00:00
LouiseHsu
e345a830ba
Show warning when attempting to flutter run on an ios device with developer mode turned off (#125710)
This PR adds a warning when a user attempt to `flutter run -d <device id>` on a device without developer mode enabled.
<img width="738" alt="Screenshot 2023-05-09 at 3 53 18 AM" src="https://github.com/flutter/flutter/assets/36148254/6f473a6a-5a0d-438b-9e6f-06d09eb1f3a9">

Also handles multiple partial matches.
<img width="788" alt="Screenshot 2023-05-09 at 3 52 24 AM" src="https://github.com/flutter/flutter/assets/36148254/60c82b3c-d501-4a01-95ad-d6309fe39576">

Fixes https://github.com/flutter/flutter/issues/111988
2023-05-22 22:06:15 +00:00
Victoria Ashworth
34d2c8d030
Better support for wireless devices in IDEs (#123716)
Better support for wireless devices in IDEs
2023-04-04 20:39:38 +00:00
Victoria Ashworth
fa01649a59
Update device selection to wait for wireless devices to load (#122932)
Update device selection to wait for wireless devices to load
2023-03-29 17:58:07 +00:00
Victoria Ashworth
27248d4b64
Separate attached and wireless devices (#122615)
Separate attached and wireless devices
2023-03-15 16:35:05 +00:00
Jenn Magder
c6ced845e3
Remove custom unawaited, prefer dart:async version (#103212) 2022-05-07 08:49:04 -07:00
Alexandre Ardhuin
07f1c20474
add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
Jenn Magder
888208c1f4
Disallow flutter run-ing on 32-bit development devices (#97339) 2022-04-12 14:39:07 -07:00
Jenn Magder
8474f41e90
Migrate xcdevice and ios devices to null safety (#92056) 2021-10-19 12:23:03 -07:00
Jenn Magder
a82c50f1f6
Revert "Migrate xcdevice and ios devices to null safety (#91704)" (#91912)
This reverts commit 0065873670.
2021-10-15 09:48:08 -07:00
Jenn Magder
0065873670
Migrate xcdevice and ios devices to null safety (#91704) 2021-10-14 22:28:02 -07:00
Ian Hickson
61a0add286
Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00
Zachary Anderson
b9d2177da0
Revert "Enable avoid_redundant_argument_values lint (#91409)" (#91461)
This reverts commit 5fd259be24.
2021-10-07 21:11:07 -07:00
Ian Hickson
5fd259be24
Enable avoid_redundant_argument_values lint (#91409) 2021-10-07 20:13:02 -07:00
Jenn Magder
57efbd5310
Rename IOSDeviceInterface to IOSDeviceConnectionInterface (#88144) 2021-08-16 10:27:03 -07:00
Alexandre Ardhuin
80990c21e2
code formatting (#85783) 2021-07-07 23:06:05 -07:00
Balvinder Singh Gambhir
604c59e522
adds build number of ios device in flutter devices command (#84512) 2021-06-23 11:31:03 -07:00
Jonah Williams
298f18b592
[flutter_tools] remove mocks from devices test (#82369) 2021-05-12 20:50:14 -07:00
Alexandre Ardhuin
7d46d43635
use throwsXxx instead of throwsA(isA<Xxx>()) (#82328) 2021-05-12 09:59:02 -07:00
Jenn Magder
ddc1c296a1
Pull XCDevice out of xcode.dart (#80324) 2021-04-13 18:10:21 -07:00
Jenn Magder
e8cd4827a0
Migrate fake_process_manager to null safety (#80018) 2021-04-08 15:19:07 -07:00
Jonah Williams
0a59698ebe
[flutter_tools] migrate cache to null safety (#79864) 2021-04-06 14:44:02 -07:00
Jenn Magder
152af5aba7
Fix device_port_forwarder file name typo (#79481) 2021-03-31 18:14:03 -07:00
Jonah Williams
29207e4f78
[flutter_tools] split application package factory dependencies (#79461) 2021-03-31 15:11:58 -07:00
Jenn Magder
8893e89d11
Migrate device_port_forwarder to null safety (#78949) 2021-03-24 16:56:14 -07:00
Jenn Magder
e5b5e1475c
Adopt FakeProcess, remove MockProcess (#76276) 2021-02-18 11:13:26 -08:00
Jenn Magder
5b823cded8
Remove dead mock classes (#75757) 2021-02-10 17:01:28 -08:00
Jonah Williams
74bd7b6f6d
[flutter_tools] opt all flutter tool libraries and tests out of null safety. (#74832)
* opt out the flutter tool

* oops EOF

* fix import

* Update tool_backend.dart

* Update daemon_client.dart

* fix more
2021-01-27 15:17:53 -08:00
Jonah Williams
44d0e52d20
[flutter_tools] remove fallback discovery and observatory timeout (#68756)
The flutter run failures are cause by the application occasionally taking a long time to start up. This caused the ios fallback discovery to kick in, which will always fail if the application hasn't started. Solution: remove the iOS fallback discovery and wait up to 30 seconds.

This has not proven to reduce the flakes, but it does at least remove one error case and removes code that will no longer work without the mDNS fallback.
2020-10-29 18:43:47 -07:00
Jonah Williams
1bea512a83
[flutter_tools] flutter logs no longer requires supported device (#66696)
Flutter logs should not attempt to filter the device list based on the current project, because it does not require a current project. Also fix disabled polling test

Fixes #47996
Fixes #63550
2020-10-02 21:12:50 -07:00
Jenn Magder
36fca52c0d
Replace MockArtifacts with Artifacts.test() (#67012) 2020-09-30 16:25:29 -07:00
Jenn Magder
becaf4913f
Replace MockCache with Cache.test() (#66946) 2020-09-30 14:53:57 -07:00
Jenn Magder
e8fbb43aac
Replace MockFile with memory file system files (#66941) 2020-09-29 17:50:33 -07:00
Jenn Magder
5abe2d3364
Allow hyphens in iOS UDIDs (#62225) 2020-07-28 10:29:34 -07:00
Jenn Magder
c4bfa4c7ab
Inject iproxy into context (#61762) 2020-07-20 07:46:05 -07:00
Jenn Magder
d5225a560d
Fix daemon device discovery crash when Xcode isn't installed (#60546) 2020-06-29 14:54:19 -07:00
Jenn Magder
a4fa61b4f1
Use ephemeral ports for iOS port forwarding (#60381) 2020-06-26 15:02:05 -07:00
Jenn Magder
f41f795640
Clean up PollingDeviceDiscovery dispose (#59709) 2020-06-18 16:38:02 -07:00
Christopher Fujino
cf7e4a0b90
[flutter_tools] Fix slow ios_device_start_prebuilt_test (#59026) 2020-06-09 11:22:31 -07:00
Jonah Williams
4f88ed1d3c
[flutter_tools] only restrict devices based on arch + buildMode, not emulator status (#58887)
instead of restricting profile/release mode based on whether the tool thinks the device is an emulator, restrict based on the device target architecture and the requested build mode. Notably, this enables release mode on x86_64 Android emulators, but not x86 emulators since we do not support that as an AOT target.

This does not add release mode support for simulators, since this requires us to build and upload artifacts for simulator/x86_64
2020-06-08 11:20:15 -07:00
Jenn Magder
f4d26a3b85
Change iOS device discovery from polling to long-running observation (#58137) 2020-06-01 12:33:01 -07:00
Jenn Magder
b0c98b6651
Detect USB/network interface from iOS devices (#58257) 2020-05-29 15:50:23 -07:00
Zachary Anderson
6f0ed5e142
[flutter_tools] Restore base/platform.dart (#56410) 2020-05-06 08:15:39 -07:00
Christopher Fujino
03c566768b
[flutter_tools] Remove fromPlatform from tests (#54152) 2020-04-10 16:51:28 -07:00
Jonah Williams
2717eb6413
[flutter tools] rewrite launch non-prebuilt app tests (#53351) 2020-03-26 17:36:02 -07:00
Jonah Williams
c5800fe107
[flutter_tools] update iOS deploy tests for best practices (#53343) 2020-03-26 17:31:01 -07:00
Jenn Magder
0b321e6715
Remove IMobileDevice from globals, hoist to XCDevice constructor (#53144)
* Convert ios_device_logger_test.dart to testWithoutContext

* Remove IMobileDevice from globals, hoist to XCDevice constructor
2020-03-24 11:22:54 -07:00