Real iPhone app automation using appium

To automate the apps on real iPhone, you will have to take below steps
  1. Find the udid of real iphone using command "instruments -s devices". Then pass the value of udid of your iPhone as the capability. Without udid, appium was targeting simulators only. After I passed the udid capability, I was able to send the commands to Real iPhone.
  2. xcodeOrgId and xcodeSigningId desired capabilities should be passed in code. You can use your Apple ID for xcodeOrgId capability and xcodeSigningId can be set to "iPhone Devloper". If you are working in a company, company might have enrolled for developer program . In this case, you can get xcodeOrgId by going to Apple developer account.

caps.setCapability("platformName", "iOS");
caps.setCapability("platformVersion", "13.1.3");
caps.setCapability("deviceName", "Sagar's iPhone");
caps.setCapability("AutomationName" , "XCUITest");
caps.setCapability("xcodeOrgId" , "[email protected]");
caps.setCapability("xcodeSigningId" , "iPhone Developer");
caps.setCapability("udid" , "4e303daa76aa2e35e525104e0dc46c7c39631b7e");
caps.setCapability("bundleId", "");

When I ran above code using my iPhone 7 plus running on iOS 13.1.3, I got below error. Below error can be fixed by upgrading the xcode version to latest one.

org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. 
Please check the server log for more details. Original error: An unknown server-side error 
occurred while processing the command. Original error: Unable to launch WebDriverAgent because 
of xcodebuild failure: xcodebuild failed with code 70
xcodebuild error message:

2019-12-08 14:37:21.972 xcodebuild[44504:20408060] 
iPhoneConnect: <DVTiOSDevice (0x7fb538e1f7e0), Sagar’s iPhone, iPhone, 13.1.3 (17A878), 
4e303daa76aa2e35e525104e0dc46c7c39631b7e> unable to mount developer disk image, 
(Error Code=601 "Could not locate device support files." 
UserInfo={DeviceType=iPhone9,4, NSLocalizedDescription=Could not locate device support files., 
NSLocalizedRecoverySuggestion=This iPhone 7 Plus (Model 1661, 1784, 1785, 1786) is running iOS 13.1.3 
(17A878), which may not be supported by this version of Xcode.}) {
    DeviceType = "iPhone9,4";
    NSLocalizedDescription = "Could not locate device support files.";
    NSLocalizedRecoverySuggestion = "This iPhone 7 Plus (Model 1661, 1784, 1785, 1786) is running 
	iOS 13.1.3 (17A878), which may not be supported by this version of Xcode.";

Web development and Automation testing

solutions delivered!!