Running appuim remotely from a server

I have an appium code working and it works fine on my device.

Is there a possibility of running my tests from a remote machine?

My machine has all the scripts and i connect the device on to a remote machine. Executing the script on my machine should run the code on the remote machine.

Here you can find all your answers for this specific problem.
Key is to instantiate a WebDriver object with a parameter with the url of your remote server. There may be network restrictions though, but as long as machine is in same LAN then I assume there should be no issues with connectivity.

Thanks Donald. Just a question what all should be set up on the remote machine?
Does it require all the set ups similar to that of the machine that has the code??

I get the below error and it stops. Any help? it is on Windows8 machine.

Starting Node Server
warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade!
info: Welcome to Appium v1.4.0 (REV 8f63e2f91ef7907aed8bda763f4e5ca08e86970a)
info: Appium REST http interface listener started on 163.33.230.52:4723
info: [debug] Non-default server args: {“address”:“163.33.230.52”,“logNoColors”:true,“platformName”:“Android”,“platformVersion”:“18”,“automationName”:“Appium”}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {“desiredCapabilities”:{“platformVersion”:“4.4.2”,“app”:“C:\s\com.mobileiron.apk”,“deviceName”:“emulator-5554”,“platformName”:“Android”,“browserName”:"",“appActivity”:“com.mobileiron.MIClientMain”,“appwaitActivity”:“com.mobileiron.MIClientMain”,“appPackage”:“com.mobileiron”}}
info: Client User-Agent string: undefined
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : appwaitActivity
info: [debug] Using local app from desired caps: C:\s\com.mobileiron.apk
info: [debug] Creating new appium session 60357e0f-6e08-446f-9c14-ec33a3a1a06d
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.7.0_76
info: [debug] Checking whether adb is present
warn: The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.
info: [debug] executing cmd: where adb
info: [debug] Using adb from C:\Intel\BeaconMountain\ADT\sdk\platform-tools\adb.exe

info: [debug] Set chromedriver binary as: C:\Program Files (x86)\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing cmd: “C:\Intel\BeaconMountain\ADT\sdk\platform-tools\adb.exe” devices
info: [debug] 1 device(s) connected
info: Found device 772ac035
info: [debug] Setting device id to 772ac035
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: “C:\Intel\BeaconMountain\ADT\sdk\platform-tools\adb.exe” -s 772ac035 wait-for-device
info: [debug] executing cmd: “C:\Intel\BeaconMountain\ADT\sdk\platform-tools\adb.exe” -s 772ac035 shell “echo ‘ready’”
info: [debug] Starting logcat capture
error: Logcat capture failed: spawn ENOENT
info: [debug] Stopping logcat capture

Hi Vish,

Your error looks like, You’ll need to set ANDROID_HOME.
Please follow http://appium.io/slate/en/master/?java#running-appium-on-windows tutorial to set up appium in a windows machine.

May be http://appium.io/slate/en/v1.2.0/?java#a-windows-gui-for-appium this will also help you .

Thanks,
Donald

Thanks a lot Donald!

So how do i install 2 different apps on the device using single appium session?

I get an error session cannot be created error. if i create a driver.

If i comment that section, it goes on to the element page and it shows up “Element not found” Error.

Since it doesnt install the app.

Thanks much for your help.

Hi Vish,

your previous problem is resolved ?
My next question is, why you want to install two apps in a device using appium. I assume you are testing only one app. If for any reason you want 1 more app to be installed in device, you can use scripting language capabilities to run terminal(system) commands and can execute adb install second_app.apk. If possible please explain your concern in detail.

Thanks,
Donald

Thanks Donald! I actually wanted 2 apps to be installed one after other for testing out an user registration.

But i just chose override session options in Appium settings. it worked. :smile: Thanks!

P.s: I will come back to you for more. :slight_smile:

Awesome :smile: .
Happy Testing !

1 Like

Is there a way were in i can run the test remotely on another machine.
Without having to Install Android SDK’s on the other machine?

Beacuse installing everything needed and running remotely makes no sense. Any help on this?

Donald,

I get this error when i try to run remotely any help? It works fine on my machine,

i have jdk path and java home set up already on thier machine, it doesnt work. Any help?

Original error: ‘java -version’ failed. Error: spawn ENOENT

Thanks!

Hi Vish,
Apologies on late reply, didn’t get time to log in.
On your first concern regarding Android SDK my view is that Appium automates Android using the UIAutomator library, which is provided by Google as part of the Android SDK. So Android SDK is a necessary part of server. If you have concerns with size of Android SDk what I can suggest is to delete stuff which you don’t want like samples and may be build tools. As My machine is a development as well as a server so I don’t wanna mess with that.But you can try, to be honest I never tried it and also not sure what kind of issues you will face. But make a note that Android SDK is a required component.

Lets come to your second concern, did you try running java -version from command line?

Hey,

As mentioned here did you try adding system32 location “%SystemRoot%\system32″ as PATH variable under System variables?

Tried all this. it doesnt work. It still shows java version error. We have the latest Java client on the machine downloaded.

It works on my machine, when i try to run it remotely on other persons machine. it throws up the error.

Hello all,
I want to run Appium on remote server and android emulator on local how to get it work.

1 Like

Hi Donald,

I’m trying to run scripts on ios simulator(MacBook) from Windows machine but no luck.

  1. Appium is running on Mac Machine with same ipaddress
  2. Scripts execution is happening from Windows 10 Machine

but getting following exception

Error–>HTTPConnectionPool(host=‘192.168.1.102’, port=4722): Max retries exceeded with url: /wd/hub/session (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x0000020DD7041C50>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond’))