Skip to content

Commit 0d756d0

Browse files
committed
Merge pull request ios-control#16 from dbriones/master
ios-sim should exit immediately if app path doesn't exist
2 parents d782dd7 + ce66720 commit 0d756d0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Source/iPhoneSimulator.m

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,15 @@ - (int)launchApp:(NSString *)path withFamily:(NSString *)family
151151
DTiPhoneSimulatorSession *session;
152152
NSError *error;
153153

154+
NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease];
155+
if (![fileManager fileExistsAtPath:path]) {
156+
nsprintf(@"Application path %@ doesn't exist!", path);
157+
exit(EXIT_FAILURE);
158+
}
159+
154160
/* Create the app specifier */
155161
appSpec = [DTiPhoneSimulatorApplicationSpecifier specifierWithApplicationPath:path];
156-
if (appSpec == nil) {
157-
nsprintf(@"Could not load application specification for %s", path);
158-
return EXIT_FAILURE;
159-
}
162+
160163
if (verbose) {
161164
nsprintf(@"App Spec: %@", appSpec);
162165
nsprintf(@"SDK Root: %@", sdkRoot);

0 commit comments

Comments
 (0)