Crashlytics - codesign user interaction is not allowed - ios

I've been building an iOS app on our Jenkins server with no problems until I've added the Crashlytics framework to that project.
Now it fails when running this command:
/usr/bin/codesign --force --sign 97B4681D342EA8BD5AE8D283B6A924BF6AF3CF95 --resource-rules=/Users/jenkins/dev/workspace/megared-ios/build/Megared\ Stage.app/ResourceRules.plist --entitlements /Users/jenkins/Library/Developer/Xcode/DerivedData/Megared-hitcnfjdmnrzijfoehutangiwnos/Build/Intermediates/Megared.build/Stage-iphoneos/Megared.build/Megared\ Stage.xcent /Users/jenkins/dev/workspace/megared-ios/build/Megared\ Stage.app
The error is the following:
/Users/jenkins/dev/workspace/megared-ios/build/Megared Stage.app: User interaction is not allowed.
Command /usr/bin/codesign failed with exit code 1
I have a shell script that runs at the beginning of the build project that creates a new keychain, imports the certificates for distribution, copies the mobileprovision to the correct Library folder and unlocks the newly created keychain.
If I remove the Crashlytis script from the build phases, it goes back to building fine.
It looks like something happens when the "run" command of Crashlytics is being called, just like if the keychain gets locked up again or just messed up. I'm struggling to find a solution.
Update:
It looks like the failing command from Crashlytics is this one and it's got nothing to do with the GUI:
2014-04-28 09:40:45.004 run[54378:507] Crashlytics.framework/run 1.3.6
2014-04-28 09:40:45.033 run[54378:507]
Crashlytics: Src root /Users/jenkins/dev/workspace/megared-ios/Megared
2014-04-28 09:40:45.033 run[54378:507]
Crashlytics: Current directory path /Users/jenkins/dev/workspace/megared-ios/Megared
2014-04-28 09:40:45.035 run[54378:507]
Crashlytics: Run script build phase called from Xcode Bots 0
2014-04-28 09:40:45.036 run[54378:507]
Crashlytics: Run script build phase called from Xcode.app 0
2014-04-28 09:40:46.612 run[54378:507]
Crashlytics: Could not be onboarded statusCode 404
2014-04-28 09:40:49.805 run[54378:507]
Crashlytics: Uploading dSYM at path /Users/jenkins/dev/workspace/megared-ios/build/Megared Stage.app.dSYM
2014-04-28 09:41:39.635 run[54378:507]
Crashlytics: Uploading dSYM at path /Users/jenkins/dev/workspace/megared-ios/build/Megared Stage.app.dSYM
2014-04-28 09:42:02.295 run[54378:507]
Crashlytics: Megared Stage.app.dSYM could not be uploaded statusCode 0 Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x10026a490 {NSUnderlyingError=0x1002add30 "The request timed out.", NSErrorFailingURLStringKey=https://api.crashlytics.com/api/v1/1fc7b0115d986225bd4df420f1a979cd6114256d/dsyms, NSErrorFailingURLKey=https://api.crashlytics.com/api/v1/1fc7b0115d986225bd4df420f1a979cd6114256d/dsyms, NSLocalizedDescription=The request timed out.}
Command /bin/sh failed with exit code 1

Sounds you need to run Jenkins in a GUI session. You seem to have installed Jenkins to run as a background daemon where it has no access to GUI to draw windows or access any of the services a GUI application needs. I made https://github.com/stisti/jenkins-app for this purpose. Or you can just run "java -jar jenkins.war" in a Terminal window.

Related

An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=3):

Trying to run this project on a MacBook but this error keeps showing. Looked for some solutions but they all failed.
I am working on Flutter project.
The code was built on a different MacBook.
That's the whole error:
Exception: Unable to launch com.projectname.client on 9CE7CA53-67B5-442B-AA2C-35A19A42CEEF:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=3):
The request to open "com.bringitback.client" failed.
The process did launch, but has since exited or crashed.
Command: xcrun simctl launch 9CE7CA53-67B5-442B-AA2C-35A19A42CEEF com.bringitback.client --enable-dart-profiling --enable-checked-mode --verify-entry-points --start-paused --observatory-port=0
Error launching application on iPhone 14 Pro Max.

Appium Not Running Xcode 12.3

I'm trying to use Appium version 1.19.1 to test an ipad app on a physical ipad device that I have built with Xcode 12.3. Previously this has worked as expected, but recently I have not been able to get Appium to run at all, and I suspect that Xcode 12.3 may be the issue based on what I have discovered.
When I try to run Appium from python this is the trace printed to my python console (device serial number/udid intentionally hidden):
File "/Users/opt/anaconda3/lib/python3.7/site-packages/appium/webdriver/webdriver.py", line 155, in __init__
proxy
File "/Users/opt/anaconda3/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/Users/opt/anaconda3/lib/python3.7/site-packages/appium/webdriver/webdriver.py", line 225, in start_session
response = self.execute(RemoteCommand.NEW_SESSION, parameters)
File "/Users/opt/anaconda3/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Users/opt/anaconda3/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
xcodebuild error message:
2021-01-06 17:04:24.366 xcodebuild[16217:213101] Error writing xctestrun file: Error Domain=NSCocoaErrorDomain Code=4 "The folder “WebDriverAgentRunner_iphoneos14.3-arm64.xctestrun” doesn’t exist." UserInfo={NSFilePath=/Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products/WebDriverAgentRunner_iphoneos14.3-arm64.xctestrun, NSUserStringVariant=Folder, NSUnderlyingError=0x7fb116ac6ad0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
** TEST BUILD FAILED **
2021-01-06 17:04:24.380 xcodebuild[16217:213102] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.06_17-04-22--0600.xcresult/Staging/2_Test/Diagnostics/WebDriverAgentRunner-E1E91CAE-6813-4009-872F-D9B73C898BBD/WebDriverAgentRunner-0D722399-E7A6-4474-8791-593FA62358F6/Session-WebDriverAgentRunner-2021-01-06_170424-nMI8G0.log
2021-01-06 17:04:24.382 xcodebuild[16217:213028] [MT] IDETestOperationsObserverDebug: (DF79B2A2-04AF-4A59-87B7-DBB8279EC46E) Beginning test session WebDriverAgentRunner-DF79B2A2-04AF-4A59-87B7-DBB8279EC46E at 2021-01-06 17:04:24.381 with Xcode 12C33 on target 📱<DVTiOSDevice (0x7fb11a157e10), ****, iPad, 14.3 (18C66), ****> {
deviceSerialNumber: ****
identifier: ****
deviceClass: iPad
deviceName: ****
deviceIdentifier: ****
productVersion: 14.3
buildVersion: 18C66
deviceSoftwareVersion: 14.3 (18C66)
deviceArchitecture: arm64e
deviceTotalCapacity: 249024532480
deviceAvailableCapacity: 240144109568
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsPaired: YES
deviceIsActivated: YES
deviceActivationState: Activated
isPasscodeLocked: NO
deviceType: <DVTDeviceType:0x7fb113d0a3d0 Xcode.DeviceType.iPhone>
supportedDeviceFamilies: (
1,
2
)
applications: (null)
provisioningProfiles: (null)
hasInternalSupport: NO
hasWritableSystem: NO
isSupportedOS: YES
bootArgs: (null)
nextBootArgs: (null)
connected: YES
isWirelessEnabled: NO
connectionType: direct
hostname: (null)
bonjourServiceName: ****
activeProxiedDevice: (null)
} (14.3 (18C66))
2021-01-06 17:04:24.498 xcodebuild[16217:213028] [MT] IDETestOperationsObserverDebug: (****) Finished requesting crash reports. Continuing with testing.
*** If you believe this error represents a bug, please attach the result bundle at /Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.06_17-04-22--0600.xcresult
2021-01-06 17:04:24.514 xcodebuild[16217:213028] [MT] IDETestOperationsObserverDebug: 0.141 elapsed -- Testing started completed.
2021-01-06 17:04:24.514 xcodebuild[16217:213028] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2021-01-06 17:04:24.514 xcodebuild[16217:213028] [MT] IDETestOperationsObserverDebug: 0.141 sec, +0.141 sec -- end
Test session results, code coverage, and logs:
/Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.06_17-04-22--0600.xcresult
Testing failed:
Building for iOS, but the embedded framework 'CocoaAsyncSocket.framework' was built for iOS + iOS Simulator.
Building for iOS, but the embedded framework 'YYCache.framework' was built for iOS + iOS Simulator.
Building for iOS, but the linked and embedded framework 'CocoaAsyncSocket.framework' was built for iOS + iOS Simulator.
Building for iOS, but the linked and embedded framework 'YYCache.framework' was built for iOS + iOS Simulator.
WebDriverAgentRunner:
WebDriverAgentRunner-Runner.app encountered an error (Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.06_17-04-22--0600.xcresult. (Underlying Error: The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file. The file doesn’t exist. (Underlying Error: The operation couldn’t be completed. No such file or directory)))
** TEST EXECUTE FAILED **
Testing started. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
Through researching I came across this answer which linked to an apple developer forum post that leads me to believe the issue is with one of the frameworks that appium must be using that is not cooperating with Xcode 12.3.
I have also come across another suggestion that I tried but it did not fix my issue.
Also, this is what I'm seeing in Test-WebDriverAgentRunner-2021.01.06_17-04-19--0600.xcresult:
Assertions: System: Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.06_17-04-19--0600.xcresult. (Underlying Error: The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file. The file doesn’t exist. (Underlying Error: The operation couldn’t be completed. No such file or directory))
So is there anything else I can try at this point, or is this going to come down to a framework being used by appium needing to be updated? Any ideas or suggestions are definitely appreciated!
Turns out I had to follow the suggestion in this answer but on the WebDriverAgent Xcode project. Seems to have fixed it for me.
After the installation WDA on real device, worked for me on appium 1.20 such workaround:
$ cd ~/Library/Developer/Xcode/DerivedData
$ rm -rf WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp
$ mv WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp

iOS React Native App/ Build Succeeded but App not getting open in iOS device/ Simulator

iOS App is build successfully but App is not getting open in the Simulator or device.
Getting chmod error for the app path.
Error:
info ** BUILD SUCCEEDED **
info Installing <PATH TO APP>.app
An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not install at this time.
Failed to chmod /Users/surabhiagrawal/Library/Developer/CoreSimulator/Devices/7A54A41E-006C-4B29-B33A-BE956F715255/data/Bundle/Application/0A68FDA4-1D57-49BB-8377-7BA5AC9BBB46/<AppName> : No such file or directory
Underlying error (domain=MIInstallerErrorDomain, code=4):
Failed to chmod /Users/surabhiagrawal/Library/Developer/CoreSimulator/Devices/7A54A41E-006C-4B29-B33A-BE956F715255/data/Bundle/Application/0A68FDA4-1D57-49BB-8377-7BA5AC9BBB46/<AppName>.app/<AppName> : No such file or directory
info Launching <Package Name>
com.goshopmatic.ShopmaticGoApp: -1
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):
The request to open "App Package name" failed.
The request was denied by service delegate (SBMainWorkspace) for reason: NotFound ("Application <App_Path_Name> is unknown to FrontBoard").
Underlying error (domain=FBSOpenApplicationErrorDomain, code=4):
The operation couldn’t be completed. Application "App package name" is unknown to FrontBoard.
Application "App package name" is unknown to FrontBoard.
I fixed this by upgrading XCode.

Testing Failed when build using Xcode build command or appium

I am using :
Xcode 10.1
Os Version : 12.1
iPhone 6
I did follow all required steps to setup build and everything but still getting error when try to build project using xcode build.
I am confuse between 2 thing that is it signing issue or I am missing some config. in webdriver agent xproj.
Actual Error on xcode build command
Testing failed:
WebDriverAgentRunner-Runner.app encountered an error (Failed to install or launch the test runner. (Underlying error: Unable to launch com.apple.test.WebDriverAgentRunner-Runner. (Underlying error: The operation couldn’t be completed. (DTXMessage error 1.))))
Actual Error on appium
Error: Unable to launch WebDriverAgent because of xcodebuild failure: “xcodebuild failed with code 65”. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
Some other logs if that helps :
2018-11-19 11:02:17.350 xcodebuild[2413:325556] Error Domain=com.apple.platform.iphoneos Code=-12 “Unable to launch com.apple.test.WebDriverAgentRunner-Runner” UserInfo={NSLocalizedDescription=Unable to launch com.apple.test.WebDriverAgentRunner-Runner, NSUnderlyingError=0x7f8ec758be20 {Error Domain=DTXMessage Code=1 “(null)” UserInfo={DTXExceptionKey=The operation couldn’t be completed. Unable to launch com.apple.test.WebDriverAgentRunner-Runner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. : Failed to launch process with bundle identifier ‘com.apple.test.WebDriverAgentRunner-Runner’}}}
2018-11-19 11:02:17.350 xcodebuild[2413:325556] Error Domain=IDETestOperationsObserverErrorDomain Code=4 “Failed to install or launch the test runner” UserInfo={NSLocalizedRecoverySuggestion=If you believe this error represents a bug, please attach the result bundle at /Users/asianweb/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/Test-WebDriverAgentRunner-2018.11.19_11-02-01-+0530.xcresult, NSLocalizedDescription=Failed to install or launch the test runner, NSUnderlyingError=0x7f8ec7ac6c70 {Error Domain=com.apple.platform.iphoneos Code=-12 “Unable to launch com.apple.test.WebDriverAgentRunner-Runner” UserInfo={NSLocalizedDescription=Unable to launch com.apple.test.WebDriverAgentRunner-Runner, NSUnderlyingError=0x7f8ec758be20 {Error Domain=DTXMessage Code=1 “(null)” UserInfo={DTXExceptionKey=The operation couldn’t be completed. Unable to launch com.apple.test.WebDriverAgentRunner-Runner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. : Failed to launch process with bundle identifier ‘com.apple.test.WebDriverAgentRunner-Runner’}}}}}
Other logs info
{
deviceSerialNumber: XXXXXXXXXXXX
identifier: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6
deviceClass: iPhone
deviceName: qa’s iPhone
deviceIdentifier: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6
productVersion: 12.1
buildVersion: 16B92
deviceSoftwareVersion: 12.1 (16B92)
deviceArchitecture: arm64
deviceTotalCapacity: 11945508864
deviceAvailableCapacity: 5477302272
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsPaired: YES
deviceIsActivated: YES
deviceActivationState: Activated
isPasscodeLocked: NO
deviceType: <DVTDeviceType:0x8f7ec4d00ca0 Xcode.DeviceType.iPhone>
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
bootArgs: (null)
connected: yes
isWirelessEnabled: no
connectionType: direct
hostname: (null)
bonjourServiceName: 90:60:f1:6b:7f:91#fe80::9760:f1ff:fe6b:2f92._apple-mobdev2._tcp.local.
} (12.1 (16B92))
Note : While I run it, it puts my app and webdriveragent into iphone device and then stopped.
I was able to resolve issue by following steps :
Uninstalled following :
Xcode,Appium,Xcode command line,ideviceinstaller,carthage,xpretty,deviceconsole
Reinstalled everything as per this video guide : https://youtu.be/ySglJIrDVMQ
Restart my mac machine and iphone
Again setup project in xcode as per this video guide : https://youtu.be/ySglJIrDVMQ
And Yes it works.
For iOS development I use Fastlane with the XCTest framework and I had the same problem as you described. However, I'm using a simulator, not a real device. To solve it I replaced iPhone 6 with iPhone XS Max in the list of simulators that should be used for testing. If you can also use any other device different from iPhone 6 you should try this solution.
However if you need to test your application on iPhone 6 you can recreate the corresponding simulator. In Xcode 10.1 press Window -> Devices and Simulators, then select the line called iPhone 6 and press Backspace. After that press + in the left bottom corner of window to create a new simulator. You will see this window:
Set all parameters as they are in this screenshot and then press Create. After that, try to run your test suite again.

LaunchServicesError error 0. when launching app

I've dug into several threads (here, here, and here to name a few) but I just cannot figure this out. I've cleared cache, reset the simulator, tripled checked .plist files, cloned my repo again, and even reinstalled Xcode.
And here's the rub - the same repo works on my other machine. Here is log error:
Oct 8 09:51:09 CoreSimulatorService[1941] <Error>: Could not register service com.apple.coreservices.lsuseractivity.simulatorsupport: Failed to lookup com.apple.coreservices.lsuseractivity.simulatorsupport: 0x44e
Oct 8 09:51:11 com.apple.dt.Xcode[1927] <Error>: Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=ExecutableTwiddleFailed, ErrorDescription=Failed to chmod file:///Users/Jason/Library/Developer/CoreSimulator/Devices/0593D533-2974-4464-937C-B77EC0299078/data/Library/Caches/com.apple.containermanagerd/Temp/Bundle/Application/FA2B923A-1015-43E5-BA59-716BBD114A3D/Test.app/PlugIns/TestActionExtension.appex/TestActionExtension : No such file or directory}
I also tried clearing the cache where it's looking for the extension that's giving me issues.

Resources