Appium Not Running Xcode 12.3 - ios

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

Related

Error when trying to upload image using react-native-webview v11.0.2 in a simulator iPhone 11 on xCode 12.4

When trying to upload an image to a web system, using webview in react-native v0.63.2 and react-native-webview v11.0.2 on an iPhone 11 emulator using iOS 14, I get the error on the xCode console:
2021-02-11 19:07:33.784921-0300 Ebank[2851:26809] [ProcessSuspension] 0x111cac210 - ProcessAssertion: Failed to acquire RBS UnboundedNetworking assertion 'WebKit uploads' for process with PID 2860, error: Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"UnboundedNetworking" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Required client entitlement is missing}
Emulating on Android, the upload happens normally. Any idea what it might be?
Thank you all.

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.

NativeScript iOS: release build failed

I want to update my app that is currently in AppStore. So I logged in into apple developer and downloaded the certificate from there (which is not expired yet).
What do I have now:
The certificate file $my_certificatename.cer
I still have a .p12-file in my project directory, which (I thought) should be the corresponding private key.
The following build.xcconfig:
CODE_SIGN_IDENTITY = $my_certificatename;
DEVELOPMENT_TEAM = $my_TeamID;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
updated version numbers in my Info.plist
Then I tried to run the following command:
tns build ios --release --for-device
Which does some stuff and then displays the following error:
** ARCHIVE SUCCEEDED **
2017-09-19 12:35:15.309 xcodebuild[3302:410544] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/nl/z3cdbrb17776dtxlltdqvc4h0000gn/T/HandyApp_2017-09-19_12-35-15.308.xcdistributionlogs'.
2017-09-19 12:35:17.352 xcodebuild[3302:410544] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7f8964985730>: Error Domain=IDEDistributionErrorDomain Code=1 "(null)"
error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomain error 1.)
Error Domain=IDEDistributionErrorDomain Code=1 "(null)"
** EXPORT FAILED **
Command xcodebuild failed with exit code 70
# build ios
Did I miss something in my configuration? Can anyone relate to this error?
My Xcode Signing Identities of my Account:

The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file

I have installed Appium 1.6.4 on Mac using Terminal. Also I can able to inspect iPhone WebElements using Safari Browser in MAC.
But I need to inspect the keyboard elements and date picker elements on iPhone real device. For this, I have again installed Appium-desktop 1.0.2 beta2 version. When I launch the Appium desktop(GUI) and run the selenium code. It throws the below error.
XCUITest] Log file for xcodebuild test: /Users/msubramaniam/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/D3F3B94A-A324-4996-B60F-0732CEBFB00D/Session-WebDriverAgentRunner-2017-05-30_125049-1uf7KZ.log
[Xcode] 2017-05-30 12:50:49.364 xcodebuild[87735:236610] Error Domain=NSCocoaErrorDomain Code=260 "The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/msubramaniam/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app, NSUnderlyingError=0x7fb4306026c0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
[Xcode] 2017-05-30 12:50:49.364 xcodebuild[87735:236610] Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
[Xcode]
[Xcode] ** TEST EXECUTE FAILED **
[Xcode]
[Xcode]
[XCUITest] xcodebuild exited with code '65' and signal 'null'
[BaseDriver] Event 'wdaStartFailed' logged at 1496128849419 (12:50:49 GMT+0530 (IST))
[XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down iproxy process (pid 87701)
[XCUITest] iproxy exited with code 'null'
[XCUITest] Removing WDA application from device
[BaseDriver] Event 'wdaStartAttempted' logged at 1496128859998 (12:50:59 GMT+0530 (IST))
As per the above log, I have navigated to the below location,
/Users/msubramaniam/Library/Developer/Xcode/DerivedData
I found that there are two WebDriverAgents
WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy
WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs
It is calling the second WebDriverAgent and it does not have the "WebDriverAgentRunner-Runner.app".
First WebDriverAgent has "WebDriverAgentRunner-Runner.app".
So how to call the first WebDriverAgent.
I have also tried to remove the WebDriverAgent by using the below command.
rm -rf /WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs
But it is not deleted.
Kindly provide the solution for this to resolve.
There was issue with carthage. Ran below commands and it got resolved :
rm '/usr/local/bin/carthage'
brew install carthage
brew link carthage

Failed to export archive to ipa (No applicable devices found)

Well, just tried to create an IPA build / package with no luck. I found similar issues on the web but they didn't fix the error.
Here's the stack that it sends me while trying:
[ERROR] : Failed to export archive to ipa
[ERROR] : 2017-03-25 16:47:25.761 xcodebuild[29128:87514] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/fr/nqly_t5n1f13l_k9hbm9vzb80000gn/T/App_2017-03-25_16-47-25.759.xcdistributionlogs'.
[ERROR] : 1.2.840.113635.100.1.61
[ERROR] : 2017-03-25 16:47:26.196 xcodebuild[29128:87514] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7f8e3cd349e0>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
[ERROR] : error: exportArchive: No applicable devices found.
[ERROR] :
[ERROR] : Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
My environment is as follows:
OS: macOS Sierra
Xcode: 8.21
Appcelerator Studio: 4.8.1
Thing already tried:
Tried to remove rbenv and use system ruby with no luck.
I updated CFPropertyList gem as well.
With the release of SDK 6.0.3.GA they solved also a problem with ad-hoc release, have a look at this one:
https://jira.appcelerator.org/browse/TIMOB-24483
In these last weeks I'm having problems with in-house distribution but for me ad-hoc works.

Resources