Unable to run test on real device but running on simulator

Hi All,

As I am new to real time device testing, I need your support in resolving an issue which I am facing since long now. I have following issues in iOS devices and simulators:

  1. I am able to run my script in simulator but not on real time device.
  2. Unable to see WebDriverAgentRunner app on the device, however I have build that app multiple times.
  3. My Scrip is able to interact with Appium, it gets installed also but never gets open (In Eclipse it gets failed with error: No element found)

Please find the attached appium logs and desired capabilities below:
Desired Capabilities:
IOSDriver wd = null;
DesiredCapabilities capabilities = new DesiredCapabilities();
System.out.println(" ");
capabilities.setCapability(“appium-version”, “1.7.2”);
capabilities.setCapability(“automationName”, “XCUITest”);
capabilities.setCapability(“platformName”, “iOS”);
capabilities.setCapability(“udid”, “UDID”); //6Plus
//capabilities.setCapability(“noReset”, “true”);
capabilities.setCapability(“platformVersion”, “11.2.6”);
capabilities.setCapability(“deviceName”, "iPhone 6”);
capabilities.setCapability(“app”,
“”);

	capabilities.setCapability("bundleID", “<com.bundel id>”);
	wd = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);

AppiumLogs.txt (17.8 KB)

Request you to please help me ASAP, as it is completely blocking me. Also in simulator I am able to run only in one device.

you must start appium server but not with this IP 0.0.0.0.
try 127.0.0.1

and verify if it is the right udid and deviceName.

Hi Langme,

I have tried with this wd = new IOSDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);
but unfortunately no luck

verify if it is the right udid and deviceName

Yes it is. I am able to uninstall and install the app, but it never gets open and my script in eclipse continues

To automate iOS app ,WebDriverAgentRunner app need to be installed on real device and because of this issue, app is not getting opened.

You can follow below link which would help in installing webdriveragent runner app on real device.

https://appium.io/docs/en/drivers/ios-xcuitest-real-devices/

Thanks.

@Gunkan_Gupta Thanks for the help, I have update accordinly, but still I am facing the same issue :frowning:
When I ran the command (xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ‘id=cc789ad93a5a735670c3379fa3de44f20fefac9e’ test), I got this error (
Testing failed:
No profile for team ‘6L7TU2565M’ matching ‘WebDriverAgentRunner’ found: Xcode couldn’t find any provisioning profiles matching ‘6L7TU2565M/WebDriverAgentRunner’. Install the profile (by dragging and dropping it onto Xcode’s dock item) or select a different one in the General tab of the target editor.
Code signing is required for product type ‘UI Testing Bundle’ in SDK ‘iOS 11.3’)

Can you please help

Just go to the location where your WebDriverAgent.xcodeproj present and open same in Xcode .
Once it is open update bundle id and developer profile with same bundle id on which the app is build.

To complete above step please follow below steps:
• Go to build settings of the project as shown in below screenshot and add the development team.

• If no options are available in development team to select then follow the below procedure to add the account.

• Click on xcode and navigate to preferences.
• Click on Accounts.
• Click on ‘+’ symbol and add the account same as the account used for the code signing activity.

• Now you can select the added account in Development Team.

• The account selected for the development team should be same as the account selected for code signing activity.

• Now add development team for all the “Targets” also similarly by navigating to build settings.

• Now go to “WebdriverAgent.lib” under Target and update bundleid in General Tab with bundleid used in test app.

• Similarly repeat above step for “WebdriverAgentRunner” and “Integration.app” targets.

• Run the code to check for any errors and build succeeded message should be displayed.

Once all above steps are done then again run the appium script .Now it should download webdriver agent runner app in real device.

Hi Gunjan,

I have tried these steps, still getting the same error. In Xcode it shows build succeeded but WebDriverAgent App never gets installed.
Please find the attached screenshots

App:

WebDriver:

Please help

Add xcodeOrgid or team id and xcodeSigningId in your desired capabilities, like this
capabilities.setCapability(“xcodeOrgId”,“ABC”);
capabilities.setCapability(“xcodeSigningId”,“iPhone Developer”);

Just change xcodeOrgid in above code and add in your desired capabilities
It should work

Can you share the logs?

I’m am hoping that you have already added Xcodeorgid and xcodeSigningId in desired capability.

Hi, Yes I have added XcodeOrgid and XcodeSigningId in capabilities:
Please find the attachments for your reference.
Appreciate your time and patience!

Appium logs_2704.txt (21.4 KB)

Please find the screen recording of real device in this link:
https://drive.google.com/file/d/1M2tbGIexNI99WM82IxKAazoK9DXmcLWe/view?usp=sharing

From logs it shows that xcode is unable to find correct certificate for team id “P986P3SPG2”.

I think you are giving wrong team id, please check right team id from:

You can find your Team ID using your developer account. Sign in to developer.apple.com/account, and click Membership in the sidebar. Your Team ID appears in the Membership Information section under the team name.

And also i can’t see through logs that you are passing xcodeSigningId through desired capability.

Hi Gunjan,

I will share the logs on Monday.
Apology for the delay!

Hi Gunjan,

I am still getting the same error.
I believe the issue is with some certificate and profile. Could you please help me on that, also let me know what information you need so that I can tell you my current settings