Closed tobiasbe closed 6 years ago
Ok the binary framework must be signed first.
A workaround for this is that you create a custom task that is executed after the cocoapodsInstall
and before the test
tasks an executes the following command:
/usr/bin/codesign --force --sign - --verbose ./Pods/Dynatrace/iOS/agent/Dynatrace.framework
Thank you, Rene.
This little workaround helps for now.
task manualCodeSign() {
def command = "/usr/bin/codesign --force --sign - --verbose ./Pods/Dynatrace/iOS/agent/Dynatrace.framework"
def proc = command.execute()
proc.waitFor()
}
xcodetest {
dependsOn manualCodeSign
}
@renep Unfortunately this did only work for the sample app. In my main app there seems to be yet another issue that makes xcodebuild
fail with error code 65.
The question here is, why signing is relevant for a simulator build at all?
I've recognized the following: When using the xcodetest
task, it starts xcodebuild
like this:
xcodebuild -scheme DynTest -workspace DynTest.xcworkspace -configuration Debug \
CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO \
-destination platform=iOS\ Simulator,id=9579DF94-884A-49A8-85EC-1842756997A8 \
-derivedDataPath /Users/tobiasbecker/Desktop/DynTest/connect-ios/build/derivedData \
DSTROOT=/Users/tobiasbecker/Desktop/DynTest/connect-ios/build/dst \
OBJROOT=/Users/tobiasbecker/Desktop/DynTest/connect-ios/build/obj \
SYMROOT=/Users/tobiasbecker/Desktop/DynTest/connect-ios/build/sym \
SHARED_PRECOMPS_DIR=/Users/tobiasbecker/Desktop/DynTest/connect-ios/build/shared \
-enableCodeCoverage yes test
When this command is run, xcodebuild runs the codesigning, even though in gradle i've specificied that i want to run a simulator build.
When i remove the CODE_SIGINING_IDENTITY=
and CODE_SIGNING_REQUIRED=NO
parts it does not code sign anything, which makes the tests run without any problems on both the sample app and my main project.
Is there any way to make the gradle-xcodePlugin not add these two or would that need a change?
I have updated the plugin that the CODE_SIGINING_IDENTITY=
and CODE_SIGNING_REQUIRED=NO
is not added for a iOS simualtor build.
Can you test the latest develop version if this solves this issue:
https://github.com/openbakery/gradle-xcodePlugin/tree/develop#current-develop-version
Hi Rene,
thank you very much. This indeed solves the problem. :+1:
@tobiasbe Can this issue be closed now?
Oh sure. Thanks for the reminder
Hi :)
I am facing an issue when trying to test my application using gradle.
Situation:
@testable import
instead of adding each file to the test target separatelyxcodetest
also builds the main applicationWhat i've found out myself:
--debug
's output, it seems to be a code signing issue (see below)How to reproduce:
pod install
gradle xcodetest,Debug,DynTest,DynTest '-PsimulatorOS=11.*' -PsimulatorBuild=true --debug
SampleApp.zip
Thanks in advance, Tobias
This is the part of the debug output i am referring to: