How to view iOS app UI elements to write mobile test automation scripts in Eclipse? Attempting to use 'Appium Inspector' gives error, "Could not remove '<bundle id of the app>' from device"

The goal is to view the UI elements for my app and write automation test scripts in Eclipse. I could not get the UI elements from XCode 8 since it doesn’t have UI Automation anymore (discontinued after XCode 7).

The solution I am expecting is for either the problem mentioned below OR detailed steps on how to view the UI elements for an iOS app similar to Android’s UIAutomator. Steps on how to set the desired capabilities properly for an iOS app in Eclipse to view the UI elements would be fantastic or even how to view the UI elements in XCode 8!!

I was trying to follow the steps mentioned here:

When you click on Appium Inspector, I get the error, “Could not remove ‘’ from device”. The exact appium logs are below. I tried a bunch of methods:

  1. Installed ideviceinstaller
  2. Tried the solution from here: Unable to install the application on Real Device using appium
  3. Tried to install other apps onto the device, and got the same error, “Could not remove ‘bundle id of the app’ from device.”

Appium logs:

Launching Appium with command: ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ appium/build/lib/main.js --debug-log-spacing --platform-version “9.3” --platform-name “iOS” --app “/Users/tejaspatil/Downloads/GlookoFDA.ipa” --udid “ec6b1da104686608ac403116f8616929c7cb22cd” --full-reset --show-ios-log --device-name “iPod Touch”

[Appium] Welcome to Appium v1.5.3

[Appium] Non-default server args:
[Appium] debugLogSpacing: true
[Appium] platformName: ‘iOS’
[Appium] platformVersion: ‘9.3’
[Appium] deviceName: ‘iPod Touch’
[Appium] app: ‘/Users/tejaspatil/Downloads/GlookoFDA.ipa’
[Appium] udid: ‘ec6b1da104686608ac403116f8616929c7cb22cd’
[Appium] fullReset: true
[Appium] showIOSLog: true
[Appium] Deprecated server args:
[Appium] --platform-name => --default-capabilities ‘{“platformName”:“iOS”}’
[Appium] --platform-version => --default-capabilities ‘{“platformVersion”:“9.3”}’
[Appium] --device-name => --default-capabilities ‘{“deviceName”:“iPod Touch”}’
[Appium] --app => --default-capabilities ‘{“app”:"/Users/tejaspatil/Downloads/GlookoFDA.ipa"}’
[Appium] -U,–udid => --default-capabilities ‘{“udid”:“ec6b1da104686608ac403116f8616929c7cb22cd”}’
[Appium] --full-reset => --default-capabilities ‘{“fullReset”:true}’
[Appium] --show-ios-log => --default-capabilities ‘{“showIOSLog”:true}’
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:

[Appium] platformName: ‘iOS’

[Appium] platformVersion: ‘9.3’
[Appium] deviceName: ‘iPod Touch’
[Appium] app: ‘/Users/tejaspatil/Downloads/GlookoFDA.ipa’
[Appium] udid: ‘ec6b1da104686608ac403116f8616929c7cb22cd’
[Appium] fullReset: true
[Appium] showIOSLog: true

[Appium] Appium REST http interface listener started on 0.0.0.0:4723

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.5.3”…

[HTTP] <-- GET /wd/hub/status 200 28 ms - 83

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.5.3”…
[HTTP] <-- GET /wd/hub/status 200 14 ms - 83
[HTTP] --> GET /wd/hub/sessions {}
[MJSONWP] Calling AppiumDriver.getSessions() with args: []
[MJSONWP] Responding to client with driver.getSessions() result: []
[HTTP] <-- GET /wd/hub/sessions 200 3 ms - 40

[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“platformName”:“iOS”,“newCommandTimeout”:“7200”,“app”:"/Users/tejaspatil/Downloads/GlookoFDA.ipa",“platformVersion”:“9.3”,“udid”:“ec6b1da104686608ac403116f8616929c7cb22cd”,“deviceName”:“iPod Touch”,“automationName”:“Appium”}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“platformName”:“iOS”,"new…
[Appium] Creating new IosDriver session
[Appium] Capabilities:
[Appium] platformName: ‘iOS’
[Appium] newCommandTimeout: ‘7200’
[Appium] app: ‘/Users/tejaspatil/Downloads/GlookoFDA.ipa’
[Appium] platformVersion: ‘9.3’
[Appium] udid: ‘ec6b1da104686608ac403116f8616929c7cb22cd’
[Appium] deviceName: ‘iPod Touch’
[Appium] automationName: ‘Appium’
[Appium] fullReset: true
[Appium] showIOSLog: true

[BaseDriver] Capability ‘newCommandTimeout’ changed from string (‘7200’) to integer (7200). This may cause unexpected behavior
[BaseDriver] Session created with session id: 7cb61b67-6e1d-460c-a448-ed0f5e4d9c4c
[debug] [iOS] Not auto-detecting udid.
[BaseDriver] Using local app ‘/Users/tejaspatil/Downloads/GlookoFDA.ipa’
[debug] [BaseDriver] Copying local zip to tmp dir

[debug] [BaseDriver] Unzipping /var/folders/gs/tl3j23q562jdsgk1fdc_bzsm0000gn/T/2016823-620-6lmmlm/appium-app.zip

[debug] [BaseDriver] Testing zip archive: /var/folders/gs/tl3j23q562jdsgk1fdc_bzsm0000gn/T/2016823-620-6lmmlm/appium-app.zip

[BaseDriver] Unzipped local app to ‘/var/folders/gs/tl3j23q562jdsgk1fdc_bzsm0000gn/T/2016823-620-6lmmlm/Payload/Glooko.app’

[debug] [iOS] Removing any remaining instruments sockets

[debug] [iOS] Cleaned up instruments socket /var/folders/gs/tl3j23q562jdsgk1fdc_bzsm0000gn/T/instruments_sock
[debug] [iOS] No language specified. Using default strings
[debug] [iOS] Parsed app ‘Localizable.strings’
[debug] [ios-app-utils] Getting bundle ID from app
[iOS] Extracted bundleID: com.glookoinc.GlookoFDA from app: /var/folders/gs/tl3j23q562jdsgk1fdc_bzsm0000gn/T/2016823-620-6lmmlm/Payload/Glooko.app
[debug] [iOS] Creating instruments
[debug] [UIAuto] Preparing bootstrap code
[debug] [UIAuto] Dynamic bootstrap dir: /Users/tejaspatil/Library/Application Support/appium/bootstrap
[debug] [UIAuto] Dynamic env: {“nodePath”:"/Applications/Appium.app/Contents/Resources/node/bin/node",“commandProxyClientPath”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js",“instrumentsSock”:"/var/folders/gs/tl3j23q562jdsgk1fdc_bzsm0000gn/T/instruments_sock",“interKeyDelay”:null,“justLoopInfinitely”:false,“autoAcceptAlerts”:false,“autoDismissAlerts”:false,“sendKeyStrategy”:“grouped”}

[debug] [UIAuto] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

[debug] [UIAuto] Dynamic bootstrap path: /Users/tejaspatil/Library/Application Support/appium/bootstrap/bootstrap-d46d1da3c1bc68a3.js
[debug] [UIAuto] Reusing dynamic bootstrap: /Users/tejaspatil/Library/Application Support/appium/bootstrap/bootstrap-d46d1da3c1bc68a3.js
[debug] [iOS] Running ios real device reset flow
[debug] [iOS] Full reset requested. Will try to uninstall the app ‘com.glookoinc.GlookoFDA’.
[debug] [iOS] Creating iDevice object with udid ec6b1da104686608ac403116f8616929c7cb22cd

[iOS] Could not remove ‘com.glookoinc.GlookoFDA’ from device

[MJSONWP] Encountered internal error running command: Error: Removing com.glookoinc.GlookoFDA failed
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/node-idevice/main.js:145:6
at ChildProcess.exithandler (child_process.js:193:7)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:850:16)
at Socket. (internal/child_process.js:323:11)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at Pipe._onclose (net.js:475:12)

[HTTP] <-- POST /wd/hub/session 500 3079 ms - 176

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.5.3”…
[HTTP] <-- GET /wd/hub/status 200 12 ms - 83


Try enabling UI Automation from Developer Tools in the test device.

Steps to enable UI Automation:

  1. Connect the device to machine and launch the Xcode
  2. Select Window —> Devices
  3. The device connected will be displayed in the Devices list
  4. Select the device and let all the updates get downloaded.
  5. From your mobile device settings, Goto developer options
  6. Enable UI Automation

I got rid of ‘Full Reset’ enabled option in Appium and it made the ‘Cannot remove app from device’ error go away. After that I get the error, ‘ideviceinstaller’ so I resolved that by reinstallating ideviceinstaller and following this link steps (Unable to install the application on Real Device using appium).

I also, got some error regarding device lockdown issue or something along those lines so I ran this command:
sudo chmod -R 777 /var/db/lockdown/

In addition to the above steps, you have to make sure your app has a development distribution certificate.

I tried a bunch of steps from above and finally ‘Appium Inspector’ would open up with my app.

That was not the issue. But, yes doing that is an important step.