4

To start with I got a .ipa file from the development team to test, the developer has mentioned the .ipa file with the device UDID so that I can install it on my iPhone.

[Appium] Welcome to Appium v1.6.0
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {"capabilities":{"desiredCapabilities":{"app":"/Users/apple/Downloads/ReaderManager.ipa","noReset":true,"platformVersion":"10.0","bundleId":"com.hidglobal.pacs.se.readermanager","platformName":"iOS","udid":"1f51471daf2a4674f11ece1a19d6cb4fa5569c02","deviceName":"iPhone 6"},"requiredCapabilities":{}},"desiredCapabilities":{"app":"/Users/apple/Downloads/ReaderManager.ipa","noReset":true,"platformVersion":"10.0","bundleId":"com.hidglobal.pacs.se.readermanager","platformName":"iOS","udid":"1f51471daf2a4674f11ece1a19d6cb4fa5569c02","deviceName":"iPhone      6"},"requiredCapabilities":{}}    
[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {"required":["desiredCapabilities"],"optional":["requiredCapabilities","sessionId","id"]} and you sent ["capabilities","desiredCapabilities","requiredCapabilities"]
[HTTP] <-- POST /wd/hub/session 400 6 ms - 201 
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/apple/Downloads/ReaderManager.ipa","noReset":true,"platformVersion":"10.0","bundleId":"com.hidglobal.pacs.se.readermanager","platformName":"iOS","udid":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","deviceName":"iPhone 6"},"requiredCapabilities":{}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/apple/Downl...
[Appium] Requested iOS support with version >= 10, using XCUITest driver instead of UIAutomation-based driver, since the latter is unsupported on iOS 10 and up.
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium]   app: '/Users/apple/Downloads/xyz.ipa'
[Appium]   noReset: true
[Appium]   platformVersion: '10.0'
[Appium]   bundleId: 'xxxxxxxx'(Changed Manually)
[Appium]   platformName: 'iOS'
[Appium]   udid: 'xxxxxxxxxxxxxxxxxxxxx'(Changed Manually)
[Appium]   deviceName: 'iPhone 6'
[debug] [XCUITest] XCUITestDriver version: 2.0.26
[BaseDriver] Session created with session id: f1a2a222-8e4f-47fb-bbbd-2429f159b403
[debug] [XCUITest] Xcode version set to '8.0'
[debug] [XCUITest] iOS SDK Version set to '10.0'
[debug] [XCUITest] Available devices: xxxxxxxxxxxxxx
[debug] [XCUITest] Creating iDevice object with udid xxxxxxxxxxxxxxxxxxx
[XCUITest] Determining device to run tests on: udid: 'xxxxxxxxxxxxxxxxx',     real device: true
[BaseDriver] Using local app '/Users/apple/Downloads/ReaderManager.ipa'
[debug] [BaseDriver] Copying local zip to tmp dir
[debug] [BaseDriver] Unzipping /var/folders/2d/qg1847_14nd90zgq9_m30zhc0000gn/T/2016926-3576-bfkmhz.8l1yycik9/appium-app.zip
[debug] [BaseDriver] Testing zip archive: /var/folders/2d/qg1847_14nd90zgq9_m30zhc0000gn/T/2016926-3576-bfkmhz.8l1yycik9/appium-app.zip
[BaseDriver] Unzipped local app to '/var/folders/2d/qg1847_14nd90zgq9_m30zhc0000gn/T/2016926-3576-bfkmhz.8l1yycik9/Payload/ReaderManager.app'
[debug] [XCUITest] Checking whether app is actually present
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog'
[XCUITest] Setting up real device
 [debug] [XCUITest] Stdout from app isInstalled check: [....] Waiting for iOS device to be connected
[....] Using iPhone 6 (GSM) 'Iphone 6' (xxxxxxxxxxxxxxx).
true
[debug] [XCUITest] App is installed.
[debug] [XCUITest] Full reset not requested. No need to install.
[XCUITest] Using default agent:     /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
[XCUITest] Using default bootstrap: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Beginning test with command '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/bin/run-xcodebuild.sh --project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj --scheme WebDriverAgentRunner --destination id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Waiting for WebDriverAgent to start on device
   [XCUITest] The real device logger 'idevicesyslog' was unable to start log capture. Please try installing 'deviceconsole' ('npm install -g deviceconsole') and specify the path to it using the 'realDeviceLogger' capability.
[debug] [XCUITest] Log file for xcodebuild test: /Users/apple/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/5D3AF14D-B012-422A-B281-1F3CE59A49EA/Session-WebDriverAgentRunner-2016-10-26_150854-8VLGgF.log
[Xcode] 2016-10-26 15:08:58.437 xcodebuild[3594:21573] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/apple/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/5D3AF14D-B012-422A-B281-1F3CE59A49EA/Session-WebDriverAgentRunner-2016-10-26_150854-8VLGgF.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/apple/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/5D3AF14D-B012-422A-B281-1F3CE59A49EA/Session-WebDriverAgentRunner-2016-10-26_150854-8VLGgF.log}
[Xcode] Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.0'
[Xcode] Signing for "WebDriverAgentRunner" requires a development team. Select a development team in the project editor.enter code here
[Xcode] Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.0'

During my execution of script I am getting the above issue.

Request the team to help me in identifying the issue and how to resolve it.

Thanks, Goutham

SaiPawan
  • 1,189
  • 7
  • 20
goutham varma
  • 41
  • 1
  • 1
  • 4
  • did you install WebDriverAgent in your real device, you need to sign both WebDriverAgent and your app should same provisional profile . – Mani Oct 26 '16 at 13:58
  • Shall i know from where i can get WebDriverAgent. – SaiPawan Nov 03 '16 at 08:44
  • @sai If you installed via command line of which I believe you did you need to check with the Appium folder following this path to find the WebDriverAgent project > AppiumFolder/non_modules/appium-xcuitest-driver/WebDriverAgent – DrPatience Nov 09 '16 at 15:53
  • Where you able to run your tests on a real device ? I'm been having troubles doing the same – DrPatience Nov 09 '16 at 15:54

2 Answers2

7
  1. Run the below command in terminal to open WebDriverAgent project.

     Open usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
    
  2. Now this will open the WebDriverAgent project in xcode.

  3. Go to build settings of the project as shown in below screenshot and add the development team.

enter image description here

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

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

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

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

  4. Now add development team for all the targets also similarly by navigating to build settings.

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

Please refer Bluedev comment as well.

SaiPawan
  • 1,189
  • 7
  • 20
  • 1
    I have attempted all of that, and built the WebDriverAgent project with no errors but when I try to run the tests, I get the error : An unknown server-side error occurred while processing the command. Original error: Unknown device or simulator UDID: '20a548dc87a87ecddf7ab3975a4b5f3395ac1a0' Link to my question: http://stackoverflow.com/questions/40510858/cant-run-appium-tests-on-ios-10-on-real-device – DrPatience Nov 10 '16 at 10:54
  • Can u try by removing udid. Because you are running in simulator no need of UDID as you are giving device name,ios version – SaiPawan Nov 10 '16 at 11:16
  • I like to run the tests on a real device, hence I added the UDID of the device. Please advice. – DrPatience Nov 10 '16 at 11:20
  • 1
    note that after `brew install appium` we managed to find the xcodeproj of the Webdriveragent in this path: `/usr/local/Cellar/appium/1.21.0/libexec/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj` – George Pligoropoulos Aug 08 '21 at 22:22
  • 1
    This worked for me, but I did some things differently: **At Project level** (`WebDriverAgent > Build Settings > Signing > Code Signing Identity`) I each dropdown over there to 'Apple Development' **At each target** for signing I've selected my development team (not personal team, but my Company team) After those steps above, my tests started successfully on Physical device. Thank you @SaiPawan for a tip! – BlueDev Nov 25 '21 at 09:45
1

if you are unable to execute appium script even after creating a developer team and building the app in Xcode..

Follow the steps given in the below link and try running appium after those steps, I tried it (note: there were some unthinkable libraries missing installation:) and working for me. I am having Mac OS 10.12.5 and Appium version 1.6.5. Hope this is helpful.

Appium Setup for running on real and emulated devices

Learner_Programmer
  • 1,259
  • 1
  • 13
  • 38