Specify UDID for idevicelistener. (#23854)
This is needed to run flutter app on multiple iOS devices at a time.
This commit is contained in:
committed by
GitHub
parent
0b35937b13
commit
47f62109d2
@@ -475,7 +475,7 @@ class _IOSDeviceLogReader extends DeviceLogReader {
|
||||
String get name => device.name;
|
||||
|
||||
void _start() {
|
||||
iMobileDevice.startLogger().then<void>((Process process) {
|
||||
iMobileDevice.startLogger(device.id).then<void>((Process process) {
|
||||
_process = process;
|
||||
_process.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen(_newLineHandler());
|
||||
_process.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen(_newLineHandler());
|
||||
|
||||
@@ -127,7 +127,7 @@ class IMobileDevice {
|
||||
}
|
||||
|
||||
/// Starts `idevicesyslog` and returns the running process.
|
||||
Future<Process> startLogger() => runCommand(<String>['idevicesyslog']);
|
||||
Future<Process> startLogger(String deviceID) => runCommand(<String>['idevicesyslog', '-u', deviceID]);
|
||||
|
||||
/// Captures a screenshot to the specified outputFile.
|
||||
Future<void> takeScreenshot(File outputFile) {
|
||||
|
||||
@@ -100,7 +100,7 @@ f577a7903cc54959be2e34bc4f7f80b7009efcf4
|
||||
});
|
||||
|
||||
testUsingContext('suppresses non-Flutter lines from output', () async {
|
||||
when(mockIMobileDevice.startLogger()).thenAnswer((Invocation invocation) {
|
||||
when(mockIMobileDevice.startLogger('123456')).thenAnswer((Invocation invocation) {
|
||||
final Process mockProcess = MockProcess();
|
||||
when(mockProcess.stdout).thenAnswer((Invocation invocation) =>
|
||||
Stream<List<int>>.fromIterable(<List<int>>['''
|
||||
@@ -130,7 +130,7 @@ f577a7903cc54959be2e34bc4f7f80b7009efcf4
|
||||
});
|
||||
|
||||
testUsingContext('includes multi-line Flutter logs in the output', () async {
|
||||
when(mockIMobileDevice.startLogger()).thenAnswer((Invocation invocation) {
|
||||
when(mockIMobileDevice.startLogger('123456')).thenAnswer((Invocation invocation) {
|
||||
final Process mockProcess = MockProcess();
|
||||
when(mockProcess.stdout).thenAnswer((Invocation invocation) =>
|
||||
Stream<List<int>>.fromIterable(<List<int>>['''
|
||||
|
||||
Reference in New Issue
Block a user