diff --git a/FBControlCore/Codesigning/FBCodesignProvider.m b/FBControlCore/Codesigning/FBCodesignProvider.m index 4689e4d49..a935117bc 100644 --- a/FBControlCore/Codesigning/FBCodesignProvider.m +++ b/FBControlCore/Codesigning/FBCodesignProvider.m @@ -67,6 +67,7 @@ + (NSRegularExpression *)cdHashRegex } id logger = self.logger; [logger logFormat:@"Signing bundle %@ with identity %@", bundlePath, self.identityName]; + return [[[[[[[FBTaskBuilder withLaunchPath:@"/usr/bin/codesign" arguments:@[@"-s", self.identityName, @"-f", bundlePath]] withNoUnacceptableStatusCodes] diff --git a/FBControlCore/Management/FBiOSTarget.h b/FBControlCore/Management/FBiOSTarget.h index e7894e4b8..b2d6c2a3b 100644 --- a/FBControlCore/Management/FBiOSTarget.h +++ b/FBControlCore/Management/FBiOSTarget.h @@ -190,6 +190,13 @@ extern FBiOSTargetStateString const FBiOSTargetStateStringUnknown; */ - (NSComparisonResult)compare:(id)target; +/** + If the target's bundle needs to be codesigned or not. + + @return if it needs to be signed or not. + */ +- (BOOL)requiresBundlesToBeSigned; + /** Env var replacements diff --git a/FBControlCoreTests/Doubles/FBiOSTargetDouble.m b/FBControlCoreTests/Doubles/FBiOSTargetDouble.m index fc33eebae..69420f7c3 100644 --- a/FBControlCoreTests/Doubles/FBiOSTargetDouble.m +++ b/FBControlCoreTests/Doubles/FBiOSTargetDouble.m @@ -177,4 +177,9 @@ - (NSComparisonResult)compare:(id)target return [FBFuture futureWithError:[[FBControlCoreError describe:@"Unimplemented"] build]]; } +- (BOOL) requiresBundlesToBeSigned +{ + return NO; +} + @end diff --git a/FBDeviceControl/Management/FBDevice.m b/FBDeviceControl/Management/FBDevice.m index d134c521b..b66c411b0 100644 --- a/FBDeviceControl/Management/FBDevice.m +++ b/FBDeviceControl/Management/FBDevice.m @@ -132,6 +132,10 @@ - (NSComparisonResult)compare:(id)target return NSDictionary.dictionary; } +- (BOOL) requiresBundlesToBeSigned { + return YES; +} + #pragma mark NSObject - (NSString *)description diff --git a/FBSimulatorControl/Management/FBSimulator.m b/FBSimulatorControl/Management/FBSimulator.m index d2da6a39f..b473b7ef2 100644 --- a/FBSimulatorControl/Management/FBSimulator.m +++ b/FBSimulatorControl/Management/FBSimulator.m @@ -175,6 +175,10 @@ - (NSComparisonResult)compare:(id)target }; } +- (BOOL) requiresBundlesToBeSigned { + return YES; +} + #pragma mark Properties - (FBControlCoreProductFamily)productFamily diff --git a/XCTestBootstrap/MacStrategies/FBMacDevice.m b/XCTestBootstrap/MacStrategies/FBMacDevice.m index a147f3f65..aef02dc1b 100644 --- a/XCTestBootstrap/MacStrategies/FBMacDevice.m +++ b/XCTestBootstrap/MacStrategies/FBMacDevice.m @@ -239,6 +239,9 @@ - (nonnull NSString *)consoleString @synthesize containerApplication; @synthesize deviceType; +- (BOOL) requiresBundlesToBeSigned { + return NO; +} + (nonnull instancetype)commandsWithTarget:(nonnull id)target { diff --git a/idb_companion/Utility/FBIDBStorageManager.m b/idb_companion/Utility/FBIDBStorageManager.m index 3d0bc6566..5e797ef88 100644 --- a/idb_companion/Utility/FBIDBStorageManager.m +++ b/idb_companion/Utility/FBIDBStorageManager.m @@ -153,7 +153,7 @@ - (BOOL)checkArchitecture:(FBBundleDescriptor *)bundle error:(NSError **)error [self.logger logFormat:@"Persisted %@", bundle.identifier]; FBInstalledArtifact *artifact = [[FBInstalledArtifact alloc] initWithName:bundle.identifier uuid:bundle.binary.uuid]; - if (!self.relocateLibraries) { + if (!self.relocateLibraries || ![self.target requiresBundlesToBeSigned]) { return [FBFuture futureWithResult:artifact]; } bundle = [FBBundleDescriptor bundleFromPath:destinationBundlePath.path error:&error];