Skip to content

Commit aa398c7

Browse files
committed
Improved messaging and minor refactoring
1 parent aa70d47 commit aa398c7

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lib/config.dart

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,33 +50,34 @@ class Config {
5050
if (config['devices']['ios'] != null) {
5151
// check simulators
5252
final Map simulators = utils.getIosDevices();
53-
for (String device in config['devices']['ios']) {
53+
for (String deviceName in config['devices']['ios']) {
5454
// check screen available for this device
55-
screenAvailable(screens, device);
55+
screenAvailable(screens, deviceName);
5656

5757
// check simulator installed
5858
bool simulatorInstalled = false;
5959
simulators.forEach((simulator, os) {
6060
// print('device=$device, simulator=$simulator');
61-
if (simulator == device) {
61+
if (simulator == deviceName) {
6262
// check for duplicate installs
6363
// print('os=$os');
6464

65-
final osName = os.keys.first;
66-
final osDevice = os[osName][0]['udid'];
65+
final iOSVersion = os.keys.first;
66+
final udid = os[iOSVersion][0]['udid'];
6767
// check for device present with multiple os's
6868
// or with duplicate name
69-
if (os.length > 1 || os[osName].length > 1) {
70-
print('Warning: multiple versions of \'$device\' detected.');
71-
print(' Using \'$device\' with iOS: $osName, ID: $osDevice.');
69+
if (os.length > 1 || os[iOSVersion].length > 1) {
70+
print('Warning: \'$deviceName\' has multiple iOS versions.');
71+
print(
72+
' Using \'$deviceName\' with iOS version $iOSVersion (ID: $udid).');
7273
}
7374

7475
simulatorInstalled = true;
7576
}
7677
});
7778
if (!simulatorInstalled) {
7879
stderr.write('configuration error: simulator not installed for '
79-
'device \'$device\' in $configPath.\n');
80+
'device \'$deviceName\' in $configPath.\n');
8081
stdout.write('\nInstall the missing simulator or use a supported '
8182
'device with an installed simulator in $configPath.\n');
8283
configGuide(screens);

0 commit comments

Comments
 (0)