Can I do Appium inspector connected simulator without error code 65 - appium

I had started a session between appium server and simulator(at xcode).
But xcodebuild failed with code 65
xcodebuild error message:
[debug] [W3C]
[debug] [W3C] at quitAndUninstall (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:588:15)
[debug] [W3C] at /usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:623:11
[debug] [W3C] at wrapped (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:60:13)
[debug] [W3C] at retry (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:43:13)
[debug] [W3C] at retryInterval (/usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:70:10)
[debug] [W3C] at /usr/local/Cellar/appium/1.22.3/libexec/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:603:7
[debug] [iOSSim] The simulator has '0' bundles which have 'WebDriverAgentRunner-Runner' as their 'CFBundleName':
[debug] [WebDriverAgent] No WDAs on the device.
I have kwnown that appium inspector connected with simulator does not need webAgentDriver. It isn't true?
In concolusion,
A simulator must need a WebDriverAgent? not for only a real device?
What is webDriverAgent? I think that it only let appium control iOS devices.

If using xcode 14 we need to have appium 2 and appium inspector installed to be able to access the app
Make sure you have node 16.16, if you don’t you can install nvm and use it to install multiple versions of node on the machine, you can fine NVM here
Install Appium 2 using: npm install -g appium#next
Once Appium is installed run appium -v to confirm that you have version > 2
Install XCUITest driver: appium driver install xcuitest
Install UIAutomator2: appium driver install uiautomator
Run appium driver list to confirm that both drivers are installed
Install Appium Inspector: can be downloaded here, download the latest version.

Related

Appium - Timing out and Never got a response from command

We have UI tests to be started by Jenkins using Appium, but it results with an error:
remote stacktrace: UnknownError: An unknown server-side error occurred
while processing the command. Original error: Error getting AVD with
retry. Original error: Condition unmet after 60063 ms. Timing out.
And there is no emulator process found when Appium's task is running.
Also Appium's output says:
[debug] [ADB] Emulator Nexus_5X_API_26 not running
[debug] [ADB] Trying to find Nexus_5X_API_26 emulator
[debug] [ADB] Getting connected emulators
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] 0 emulator(s) connected
OK, I see that device wasn't started and this is cause for the "Timeout" error.
But why Appium can't start it?
I'm able to get the emulator executable, and Jenkin's job which is starting Appium's task can see the device:
[Pipeline] sh
+ avdmanager list avd
...
Name: Nexus_5X_API_26
Device: Nexus 5X (Google)
Path: /home/user/.android/avd/Nexus_5X_API_26.avd
Target: Google Play (Google Inc.)
Based on: Android 8.0 (Oreo) Tag/ABI: google_apis_playstore/x86
Skin: 1080x1920
Sdcard: 100 MB
---------
Name: test
Path: /home/user/.android/avd/test.avd
Target: Google APIs (Google Inc.)
Based on: Android 7.1.1 (Nougat) Tag/ABI: google_apis/x86
[Pipeline] sh
+ emulator -list-avds
Nexus_5X_API_26
test
If I'm starting device manually just by running:
/android/Android/sdk/emulator/emulator -avd Nexus_5X_API_26
And trigger Jenkin's job after this - I have another error:
...
[ADB] Using adb from /android/Android/sdk/platform-tools/adb
[debug] [ADB] Trying to find Nexus_5X_API_26 emulator
[debug] [ADB] Getting connected emulators
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] 1 emulator(s) connected
[debug] [ADB] Sending telnet command to device: avd name
[debug] [ADB] Getting running emulator port
[debug] [ADB] Socket connection to device created
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1542807589908 (15:39:49 GMT+0200 (EET))
[debug] [W3C] Encountered internal error running command: Error: Error getting AVD. Original error: Never got a response from command
[debug] [W3C] at ADB.callee$0$0$ (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:488:11)
...
Any ideas?
Can't even google anything with the "appium Never got a response from command" request...
Also, I'm not able to reproduce this issue on my workstation's laptop - all works just perfectly.
UPD Properties are:
<profile>
<id>linux-emulator-8.0</id>
<properties>
<hub.url>http://0.0.0.0:4723/wd/hub</hub.url>
<device.name>Android Emulator</device.name>
<avd>Nexus_5X_API_26</avd>
<platform.name>Android</platform.name>
<platform.version>8.0</platform.version>
<auto.grant.permissions>true</auto.grant.permissions>
<full.reset>true</full.reset>
<no.reset>false</no.reset>
<app.path>/home/user/project/project.apk</app.path>
<app.name>com.gen.workoutme</app.name>
<screenshot.path>
${project.basedir}/../screenShots/${platform.name}/${platform.version}/${device.name}/
</screenshot.path>
<automation.name>UiAutomator2</automation.name>
</properties>
</profile>
UPD 2 Not sure how - but not it works if run emulator manually.
But still, there is a problem with starting the emulator from Appium itself.
Found the weird error in its log:
[ADB] [AVD OUTPUT] Fatal: QXcbConnection: Could not connect to display ((null):0, (null))
[ADB] [AVD OUTPUT] INFO: QtLogger.cpp:66: Fatal: QXcbConnection: Could not connect to display ((null):0, (null))
[ADB] Emulator avd Nexus_5X_API_26 exited with code null, signal SIGABRT
Can't google for reason yet but it looks like the main issue - something with a connection to the $DISPLAY, although it present.
I am able to start and run tests on emulator without any problem. I use following three capabilities along with other capabilities while setting up the driver.
avd: Name of AVD
avdLaunchTimeout: Time out to wait for emulator to launch.
avdReadyTimeout: Time out to wait for emulator to get ready.
Try using these capabilities and you should be good.
Also check if there is any updates for Android SDK and emulator. If there is update available, it's good idea to update it.
Settings or python:
options = UiAutomator2Options()
options.avd = 'YOUR_AVD_NAME'
# Timeout to wait until Android Emulator is started in milliseconds
options.avd_launch_timeout = 25 * 1000
# Timeout to wait until Android Emulator is fully booted and is ready for usage in milliseconds
options.avd_ready_timeout = 20 * 1000
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', options=options)

Appium path issue

I'm trying to run an apk file from my test suite in appium, the emulator runs successfully but at the time of launch of the apk it says apk not found. The path looks correct to me still unable to figure out the solution.
Below is the error from Appium.
AndroidDriver] Using device: emulator-5554
[ADB] Checking whether adb is present
[ADB] Using adb from /Library/Android/sdk/platform-tools/adb
[debug] [ADB] Setting device id to emulator-5554
[BaseDriver] Using local app '/src/test/resources/myapp.apk'
[debug] [AndroidDriver] Checking whether app is actually present
[debug] [AndroidDriver] Shutting down Android driver
[AndroidDriver] Cannot shut down Android driver; it has already shut down
[HTTP] <-- POST /wd/hub/session 500 25028 ms - 212
[AndroidDriver] Error: Could not find app apk at /src/test/resources/myapp.apk
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at AndroidDriver.checkAppPresent$ (lib/driver.js:274:11)
at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at run (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:104:47)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:115:28
at flush (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/$.microtask.js:19:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
[Error: Could not find app apk at /src/test/resources/myapp.apk]
I tried following path apart from the one listed above:
1. ./src/test
2. Start from the module name which is part of /src/test i.e. modulename/src/test
3. Tried ~./src/test
4. Tried ~/src/test
Any pointers as to what is it that I'm missing?
Also, why am I getting this ([debug] [AndroidDriver] Shutting down Android driver) before the apk launch?
Code:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.FULL_RESET,"true");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"Nexus10");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION,"4.4");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"Android");
capabilities.setCapability(MobileCapabilityType.APP,"myapp.package");
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "20");
capabilities.setCapability("app", "/src/test/resources/myapp.apk");
AndroidDriver = new AndroidDriver(new URL("http://127.0.0.1:4724/wd/hub"), capabilities);
AndroidDriver.rotate(ScreenOrientation.PORTRAIT);
log.info("Set up done for capabilities");
Thanks in advance.
If the 'src' folder is in the same location as you're running from, you want to remove the preceding '/' as that's telling Appium to look starting at the root of the entire file system rather than from your local path.
src/test/resources/myapp.apk
My experience is that using '~' does not work with Appium. I personally have parameterized the app location and pull it from an environment variable to account for it being in different places on different systems, but in all cases I provide the path from the file system root as it's simplest.

Unable to launch ipa file in IOS 10 real Device using appium 1.6.0

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
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
Now this will open the WebDriverAgent project in xcode.
Go to build settings of the project as shown in below screenshot and add the development team.
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.
Now you can select the added account in Development Team.
The account selected for the development team should be same as the account selected for code signing activity.
Now add development team for all the targets also similarly by navigating to build settings.
Run the code to check for any errors and build succeeded message should be displayed.
Please refer Bluedev comment as well.
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

Could not pre-launch appium and app doesn't get installed in iphone real device using appium

I am using appium version 1.3.7.
I have connected physical device via usb.
I have launched appium server,after a while appium get crashed.
I have pasted that full log below.
I have attached the screen shot below.
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --command-timeout "7200" --pre-launch --platform-version "8.1" --platform-name "iOS" --app "/Users/al/work/sample.app" --udid "f5de3fd5ccded92e40e86c652ce2a6f9414fe1a0" --device-name "iPhone 4s"
info: [debug] Starting Appium in pre-launch mode
info: Pre-launching app
info: [debug] Using local app from command line: /Users//al/work/sample.app
info: [debug] Creating new appium session 1cdc5dc0-36d2-40b9-922b-33601f28846b
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
info: [debug] Getting sdk version from xcrun with a timeout
info: [debug] iOS SDK Version set to 8.1
info: [debug] Not checking whether simulator is available since we're on a real device
info: [debug] Detecting automation tracetemplate
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Parsed app Localizable.strings
info: [debug] Getting bundle ID from app
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating instruments
info: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/alk/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
info: [debug] Dynamic bootstrap path: /Users/alk/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Reusing dynamic bootstrap: /Users/alk/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.1.1","iOSSDKVersion":"8.1","deviceName":"iPhone 4s","platformVersion":"8.1"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 4s (8.1 Simulator)'
info: [debug] Not setting device type since we're on a real device
info: [debug] Checking whether we need to set app preferences
info: [debug] Not setting iOS and app preferences since we're on a real device
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons
info: [debug] On a real device; cannot clean device state
info: [debug] Not setting locale because we're using a real device
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS device log capture via deviceconsole
info: [debug] Not pre-launching simulator
info: [debug] Creating iDevice object with udid f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2
info: [debug] Checking app install status using: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2 --bundle com.vr.iphone.sample
info: [debug] App is not installed. Will try to install the app.
info: [debug] Installing app using cmd: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2 --bundle "/Users/al/work/sample.app
info: [debug] Cleaning up appium session
error: Could not pre-launch appium: Error: Unable to install [/Users/al/work/sample.app] to device with id [f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2]. Error [Error: Command failed: /bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2 --bundle "/Users/al/work/sample.app"
Assertion failed: (AMDeviceStartService(device, CFSTR("com.apple.afc"), &afcFd, NULL) == 0), function handle_device, file fruitstrap.c, line 523.
]
You can use Appium to install your app on your device, Just uninstall your App manually and in setUp code use absolute path of .apk file like this:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("VERSION", "5.1.1");
capabilities.setCapability("deviceName", "Name");
File appDir = new File("/home/filename/ProjectFile");
File app = new File(appDir, "appname.apk");
capabilities.setCapability("app",app.getAbsolutePath());
It will install your app on your device.
You said you tried to launch on real device, but your logs saying you tried to launch on simulator.
If you are using UI version of appium, Please uncheck Force Device option in appium and give UDID of real device which you connected in appium and prelaunch. your app will be installed.

Appium iOS real device - issue with ideviceinstaller

I am running the appium test script on iOS real device., where I am getting the ideviceinstaller error.
I have installed ideviceinstaller manually using "brew install --HEAD ideviceinstaller" still getting the same error.
error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l dyld: Library not loaded: /usr/local/lib/libplist.3.dylib Referenced from: /usr/local/bin/ideviceinstaller Reason: image not found
Please check the below logs.Using xcode 6.1.1 and iOS 8.1.
info: Appium REST http interface listener started on 0.0.0.0:4723
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformVersion":"8.1.1","app":"/Users/rajesh.madaswamy/FlydotREZ.ipa","deviceName":"iPhone","platformName":"iOS","fullReset":true,"browserName":"","bundleId":"com.accenture.ams.dev.london.Voyage-Air","udid":"0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9"}}
info: Client User-Agent string: Apache-HttpClient/4.3.6 (java 1.5)
info: [debug] Using local .ipa from desired caps: /Users/rajesh.madaswamy/FlydotREZ.ipa
info: [debug] Copying local zip to tmp dir
info: [debug] /Users/rajesh.madaswamy/FlydotREZ.ipa copied to /var/folders/bc/7qkw5sfd221dbcm_fg2fp0g9dhyybh/T/115224-74086-ga247s/appium-app.zip
info: [debug] Unzipping /var/folders/bc/7qkw5sfd221dbcm_fg2fp0g9dhyybh/T/115224-74086-ga247s/appium-app.zip
info: [debug] Testing zip archive: /var/folders/bc/7qkw5sfd221dbcm_fg2fp0g9dhyybh/T/115224-74086-ga247s/appium-app.zip
info: [debug] Zip archive tested clean
info: [debug] Unzip successful
info: [debug] Using locally extracted app: /var/folders/bc/7qkw5sfd221dbcm_fg2fp0g9dhyybh/T/115224-74086-ga247s/Payload/Fly dotREZ.app
info: [debug] Creating new appium session 153304f6-3daf-4ee3-b72c-3f181d3a8ffa
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
info: [debug] Getting sdk version from xcrun with a timeout
info: [debug] iOS SDK Version set to 8.1
info: [debug] Not checking whether simulator is available since we're on a real device
info: [debug] Detecting automation tracetemplate
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Parsed app Localizable.strings
info: [debug] Creating instruments
info: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/usr/local/Cellar/node/0.12.0_1/bin/node","commandProxyClientPath":"/Users/rajesh.madaswamy/.npm-packages/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. D...ot manually modify!
info: [debug] Dynamic bootstrap path: /Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap/bootstrap-4f4c08d246c5f17c.js
info: [debug] Reusing dynamic bootstrap: /Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap/bootstrap-4f4c08d246c5f17c.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.1.1","iOSSDKVersion":"8.1","deviceName":"iPhone","platformVersion":"8.1.1"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone (8.1.1 Simulator)'
info: [debug] Not setting device type since we're on a real device
info: [debug] Checking whether we need to set app preferences
info: [debug] Not setting iOS and app preferences since we're on a real device
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons
info: [debug] On a real device; cannot clean device state
info: [debug] Not setting locale because we're using a real device
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS device log capture via deviceconsole
info: [debug] Not pre-launching simulator
info: [debug] Creating iDevice object with udid 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9
info: [debug] Checking app install status using: /Users/rajesh.madaswamy/.npm-packages/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 --bundle com.accenture.ams.dev.london.Voyage-Air
info: [debug] App is installed.
info: [debug] fullReset requested. Forcing app install.
info: [debug] Installing ipa found at /Users/rajesh.madaswamy/FlydotREZ.ipa
info: [debug] Creating iDevice object with udid 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l
dyld: Library not loaded: /usr/local/lib/libplist.3.dylib
Referenced from: /usr/local/bin/ideviceinstaller
Reason: image not found
info: [debug] Error: Command failed: /bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l
dyld: Library not loaded: /usr/local/lib/libplist.3.dylib
Referenced from: /usr/local/bin/ideviceinstaller
Reason: image not found
at ChildProcess.exithandler (child_process.js:744:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Socket.<anonymous> (child_process.js:1176:11)
at Socket.emit (events.js:107:17)
at Pipe.close (net.js:476:12)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: /bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l \ndyld: Library not loaded: /usr/local/lib/libplist.3.dylib\n Referenced from: /usr/local/bin/ideviceinstaller\n Reason: image not found\n)","killed":false,"code":null,"signal":"SIGTRAP","cmd":"/bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l ","origValue":"Command failed: /bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l \ndyld: Library not loaded: /usr/local/lib/libplist.3.dylib\n Referenced from: /usr/local/bin/ideviceinstaller\n Reason: image not found\n"},"sessionId":null}
info: <-- POST /wd/hub/session 500 2042.905 ms - 714
I was getting this error after installing the Appium Inspector. What ultimately fixed it for me was what you have already tried, specifically installing ideviceinstaller manually.
Until I figured that out, I just put 'libplist.3.dylib' on my path so it would be found. It felt like a hack, but it worked.
to install ideviceistaller
Install the App
Press Command+F and type Terminal and press enter/return key.
Run in Terminal app:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
and press enter/return key. Wait for the command to finish.
Run:
brew install ideviceinstaller

Resources