Thursday, January 9, 2014

Inspecting IOS elements using Appium Inspector for .app file

  1. Launch the appium Server (GUI version)
  2. You need to setup additional Parameters using to run the tests on Real Devices
  3. Choose the app path. Here you need to choose from Xcode iphoneos folder as mentioned in one of my previous blog ex: /Users/kiran/Library/Developer/Xcode/DerivedData/UICatalog-fqsvdhmisheuvqbsuomezsujnqgi/Build/Products/Debug-iphoneos/UICatalog.app
  4. Check the option UDID. UDID is the device ID. You can find it from Xcode Organiser.
  5. Open xcode. Open organiser which is on top right of your Xcode
  6. Select you device in the left list of the organiser
  7. You should be able to see the device information
  8. Here Identifier is the UDID.
  9. provide this is identifier in the appium server option UDID
  10. Select option Force Device with selected option as iPhone
  11. Select option BundleID. This is the application bundle id. To find this Id follow the below screenshot
  1. I used Iphone configuration utility(freeware) to find the app bundle path. Google it and your should be able to find the download references
  2. Open the Iphone config utility, Under Application you should be able to see the app bundle id. In this case, 'com.yourcompany.UICatalog'. Set this to the appium server option 'BundleID'
  1. Start the appium server
  2. Click on Inspector Icon
  3. You should see your Iphone Screen in the Inspector



7 comments:

  1. Excellent Article !!

    I want to record tests on Real device , but there is a issue I am able to launch Application in Real iPhone Device ,but as soon as i open Appium Inspector the App on real device closes automatically and the Appium servers stops .

    On simulator it works great , i am able to record scripts and play back using Appium Inspector and also i am using selenium web-driver to play back the scripts its works perfect.

    Can u plz help me in this ...

    ReplyDelete
    Replies
    1. From where are you picking up .app file is it from xcode iphonesimulator or iphoneos?

      To run the appium on device, you will need to compile the IOS application on Iphone device and pick the .app file from Debug-iphoneos

      Also did you specify the bundle id of application & UDID of device?

      Delete
    2. Samyukth, Please send me the appium server log

      Delete
  2. Hi Kiran,

    I m not familiar with selenium and appium tool. Basically i m ios mobile app developer but now i need to automation for one of my project . When i m trying to launch appium i m getting below log and inspector didn't launched.

    Appium Version :both 0.18.0 and 1.0.0
    Server :0.0.0.0
    Port :4723
    apppath, bundledid, forcedevice and uuid all given

    info: Starting Appium in pre-launch mode

    info: Pre-launching app
    info: Using local app from command line: /Users/venkatnathan/Downloads/InternationalMountains/build/Release-iphonesimulator/InternationalMountains.app
    info: Creating new appium session 2258c7db-627c-4de0-9616-37c4caddbcdd
    info: Removing any remaining instruments sockets
    info: Cleaned up instruments socket /tmp/instruments_sock
    info: Setting Xcode folder
    info: Setting Xcode version

    info: Setting iOS SDK Version

    error: Could not determine Xcode version

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

    info: iOS SDK Version set to null

    error: Could not determine iOS SDK version

    info: Detecting automation tracetemplate

    info: Not auto-detecting udid, running on sim

    info: Parsed app Localizable.strings

    debug: Creating instruments

    info: Not setting locale because we're using a real device

    info: Not setting iOS and app preferences since we're on a real device
    warn: Xcode version passed into log capture code as null, assuming Xcode 5
    info: Starting iOS device log capture via idevicesyslog

    info: Not setting device type since we're connected to a device

    info: Creating iDevice object with udid 9ff487d2f724c64dc73cae19a3b4b6fcdafb30f3
    info: Couldn't find ideviceinstaller, trying built-in at /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller
    info: Installing app using cmd: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id 9ff487d2f724c64dc73cae19a3b4b6fcdafb30f3 --bundle /Users/venkatnathan/Downloads/InternationalMountains/build/Release-iphonesimulator/InternationalMountains.app

    info: Cleaning up appium session

    error: Could not pre-launch appium: Error: Unable to install [/Users/venkatnathan/Downloads/InternationalMountains/build/Release-iphonesimulator/InternationalMountains.app] to device with id [9ff487d2f724c64dc73cae19a3b4b6fcdafb30f3]. Error [Error: Command failed: ]

    -----------------------------
    and tried with simulator also but no luck...please help me out i got stuck from last 2 weeks

    ReplyDelete
  3. Sorry Sreeney, got to see your message little late. Looking at the logs your MAC does not have instruments which comes along with your XCODe. Inastalling the xCode should resolve the issue. Try installing XCode 5 version on your MAC

    ReplyDelete
  4. Hi Kiran,

    I m not familiar with selenium and appium tool. now i need to automation for one of my project . after launch inspector i m getting below log and blank screen.
    can you please help me this, how to connect app in Appium Inspector ?
    blank inspector :
    https://www.dropbox.com/s/vthpjkzn7164p91/Screen%20Shot%202014-08-20%20at%2010.15.39%20am.png

    Log:

    #import

    @implementation SeleniumTest

    -(void) run
    {
    SECapabilities *caps = [SECapabilities new];
    [caps addCapabilityForKey:@"appium-version" andValue:@"1.0"];
    [caps setPlatformName:@"iOS"];
    [caps setPlatformVersion:@"7.1"];
    [caps setDeviceName:@"iPhone"];
    [caps setApp:@"/Users/vivacity/Library/Developer/Xcode/DerivedData/TeamLink-guyjsgwaulwecicrztbbqbfwrmbs/Build/Products/Debug-iphoneos/TeamLink.app"];
    NSError *error;
    SERemoteWebDriver *wd = [[SERemoteWebDriver alloc] initWithServerAddress:@"127.0.0.1" port:4723 desiredCapabilities:caps requiredCapabilities:nil error:&error];
    }

    @end

    ReplyDelete
  5. Thanks for a great information in your blog.I have read all the post of your blog.Great work on Android

    ReplyDelete