Testing Failed when build using Xcode build command or appium - 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.

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.

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

Xcode executes successful build but is unable to launch on a physical device

I'm having this exact same issue:
https://github.com/facebook/react-native/issues/26152
This is on react-native 0.60.4
I'm able to have a successful build in Xcode, but I'm not able launch the app on a physical device.
This is the error that I'm given:
This is the readout from the console:
Details
Unable to launch com.news.arg
Domain: com.apple.platform.iphoneos
Code: -12
--
Request to launch com.news.arg failed.
Domain: com.apple.dt.deviceprocesscontrolservice
Code: 2
Failure Reason: The operation couldn’t be completed. Application "com.news.arg" is unknown to FrontBoard. : Failed to launch process with bundle identifier 'com.news.arg'.
--
The operation couldn’t be completed. Application "com.news.arg" is unknown to FrontBoard.
Domain: FBSOpenApplicationErrorDomain
Code: 4
Failure Reason: Application "com.news.arg" is unknown to FrontBoard.
User Info: {
BSErrorCodeDescription = NotFound;
}
--
Someone said on the react native reddit that expo posted a workaround on their twitter, but we were unable to find it when we went back and looked.

iOS Release App crashes on Launch "Unable to get pid for label"

Disclaimer: I am not using Expo.
react: 16.8.3
react-native: 0.59.9
react-native-cli: 2.0.1
iOS 12.2 (16E227)
I have this weird problem with my React Native iOS app that has been happening for a while. At a first glance everything works as excepted, both Development and Release. I am able to install it in my device and use it without the metro server running.
However after some time, like couple of days the app in my phone won't launch, it crashes at the launch screen, the one that says "Powered by React Native ..." with the following errors showing up in the console:
Process: assertiond
Failed to start job with error <NSError: 0x103e56f70; domain: NSPOSIXErrorDomain; code: 3; reason: "No such process"> {
description = "Unable to get pid for label UIKitApplication:org.josemigallas.RealmsCounter[0x953c][62]";
failureReason = "No such process";
userInfo = {
BKLaunchdJobLabel = UIKitApplication:org.josemigallas.RealmsCounter[0x953c][62];
BKLaunchdOperation = launch_get_running_pid_4SB;
}
}
Process: SpringBoard
[org.josemigallas.RealmsCounter] Bootstrap failed with error: <NSError: 0x2830c26a0; domain: BKSProcessErrorDomain; code: 1 (bootstrap-failed); reason: "Failed to start job">
Process: SpringBoard
Bootstrapping failed for <FBApplicationProcess: 0x1371b5470; org.josemigallas.RealmsCounter; pid: -1> with error: Error Domain=BKSProcessErrorDomain Code=1 "Unable to bootstrap process with bundleID org.josemigallas.RealmsCounter" UserInfo={NSLocalizedDescription=Unable to bootstrap process with bundleID org.josemigallas.RealmsCounter, BKSProcessExitReason=0, NSLocalizedFailureReason=Failed to start job, NSUnderlyingError=0x2830c0210 {Error Domain=NSPOSIXErrorDomain Code=3 "No such process" UserInfo={BKLaunchdOperation=launch_get_running_pid_4SB, NSLocalizedDescription=Unable to get pid for label UIKitApplication:org.josemigallas.RealmsCounter[0x953c][62], BKLaunchdJobLabel=UIKitApplication:org.josemigallas.RealmsCounter[0x953c][62], NSLocalizedFailureReason=No such process}}, BKSProcessJobLabel=UIKitApplication:org.josemigallas.RealmsCounter[0x953c][62], BSErrorCodeDescription=bootstrap-failed}
Is this a bug? Or did I do something wrong with the Xcode configuration? The React Native documentation is of no use Xcode wise and so is iOS's because this is something in between of both.
Any ideas?
OK, turned out it as simple as the provisioning profile is only valid for 6 days without a paid Apple Developer account... The app will work during the first days then inevitably it won't start anymore and it has to be rebuild again.

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