iOS real device settings in Appium

This is my first posting here and trying to setup Appium by pointing to an app on the real device. The application is a ad-hoc build provided by the developer team in my company. They mentioned that they have included dev. certificate in the .ipa file. I have already installed the application on my iPhone 6+ using a URL given by the developers.

What settings do I need to provide in the appium UI application to use the Inspector and also while writing test cases?

I’m running on Appium 1.3.4 on Yosemite. Also, checked using Appium doctor and there are no errors.

Please help.

Thanks.

I checked here and got this code. Is this the code that has to be written when running my app on a real iOS device?

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“deviceName”, “iPhone”);
capabilities.setCapability(“platformName”, “ios”);
capabilities.setCapability(“udid”, “3##########”);
capabilities.setCapability(“bundleId”, “com.ssssss.mptest”);
capabilities.setCapability(“ipa”, “/Users/user/Desktop/Mptest.ipa”);

If BundleID is provided (which uniquely identifies my app), why should I have an .ipa file and set the ipa in the capabalities?. I’m not understanding this.

Also, does the last line correspond to the App Path setting in Appium GUI?

My goal is to automate my app directly on the device and not on the simulator.

Please advise.

I am new to Appium, i am unable to connect and run Appium Inspector, I am getting the following error message.
Please someone help me.

Xcode Version: 5.1.1 (5B1008).
iPOD iOS Version: 7.1.2
Node js Version: v0.10.35
NPM Version: 1.4.28

Error Message:

Launching Appium with command: ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ lib/server/main.js --address “127.0.0.1” --command-timeout “7200” --platform-version “7.1.1” --platform-name “iOS” --app “com.quisk.QuiskApp-iOS” --udid “b46d35609a2a9e445c8d1faa7c184d93ecc576c7” --no-reset --tracetemplate “/Users/bhaskar/Documents/iOS Builds/Appium.tracetemplate” --device-name “iPod” --language “en” --locale “en_IN” --trace-dir “/Users/bhaskar/Documents/iOS Builds” --platform-version 7.1.2

info: Welcome to Appium v1.3.4 (REV c8c79a85fbd6870cd6fc3d66d038a115ebe22efe)

info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {“app”:“com.quisk.QuiskApp-iOS”,“udid”:“b46d35609a2a9e445c8d1faa7c184d93ecc576c7”,“address”:“127.0.0.1”,“noReset”:true,“deviceName”:“iPod”,“platformName”:“iOS”,“platformVersion”:“7.1.2”,“language”:“en”,“locale”:“en_IN”,“automationTraceTemplatePath”:"/Users/bhaskar/Documents/iOS Builds/Appium.tracetemplate",“defaultCommandTimeout”:7200,“traceDir”:"/Users/bhaskar/Documents/iOS Builds"}
info: Console LogLevel: debug

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}

info: <-- GET /wd/hub/status 200 7.082 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}
info: <-- GET /wd/hub/status 200 1.715 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}
info: <-- GET /wd/hub/status 200 1.060 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}

info: --> GET /wd/hub/sessions {}
info: [debug] Responding to client with success: {“status”:0,“value”:[]}
info: <-- GET /wd/hub/sessions 200 3.470 ms - 23 {“status”:0,“value”:[]}

info: --> POST /wd/hub/session {“desiredCapabilities”:{“platformName”:“iOS”,“locale”:“en_IN”,“newCommandTimeout”:“999999”,“deviceName”:“iPod”,“platformVersion”:“7.1.1”,“language”:“en”,“automationName”:“Appium”}}

info: Client User-Agent string: Appium (unknown version) CFNetwork/596.6.3 Darwin/12.5.0 (x86_64) (iMac10%2C1)
info: [debug] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 5cc32873-3cf3-4a8c-b6a6-127e34af7761
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder

info: [debug] Setting Xcode version

info: [debug] Setting iOS SDK Version

error: Could not determine Xcode version:Could not get Xcode version: /Applications/Xcode.app/usr/bin/xcodebuild does not exist on disk.

error: Could not get the iOS SDK version because the Xcode version could not be determined.

error: Could not get the iOS SDK version because the Xcode version could not be determined.

info: [debug] Cleaning up appium session

error: Could not get the iOS SDK version because the Xcode version could not be determined.
error: Could not determine iOS SDK version
error: Failed to start an Appium session, err was: Error: Could not get the iOS SDK version because the Xcode version could not be determined.

info: [debug] Error: Could not get the iOS SDK version because the Xcode version could not be determined.
at /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/xcode.js:60:10
at /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/xcode.js:37:9
at /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/xcode.js:16:9
at ChildProcess.exithandler (child_process.js:656:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Socket. (child_process.js:979:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Could not get the iOS SDK version because the Xcode version could not be determined.)”,“origValue”:“Could not get the iOS SDK version because the Xcode version could not be determined.”},“sessionId”:null}
info: <-- POST /wd/hub/session 500 86.451 ms - 290

Please some one help me.

A couple of things:

  1. When you start Appium on real device, you need to start it this way. No brackets.
    appium -U ${udid} --app “${bundle_id}”

  2. your capabilities look ok. Not sure what the viability still with xcode 5.x. curious as to why you are not on xcode 6?

  3. Also, make sure that your binary is indeed built for device and not simulator.

hope it helps
thanks!
Eric

I am new to Appium so I don’t know how to start Appium with the cmd which u have given.
U ${udid} --app “${bundle_id}”

Thanking you,
Bhaskar

The appium docs have a pretty good explanation on this:

http://appium.io/slate/en/master/ > “Appium on real iOS devices”

The UDID can be found if you plug in your device and launch Xcode.
Select Devices
Find your device identifier. That’s your UDID

the bundle id starts with com.X.Y.Z. It’s found in the Xcode project settings. Ask your developers what the bundle id is for your project - they should be able to tell you.

Also, for real devices - you need to enable ui automation.
Good luck!