Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to set up AppiumDriverLocalService #274

Closed
saikrishna321 opened this issue Nov 29, 2015 · 21 comments
Closed

[Question] How to set up AppiumDriverLocalService #274

saikrishna321 opened this issue Nov 29, 2015 · 21 comments
Labels

Comments

@saikrishna321
Copy link
Member

@TikhomirovSergey is it possible to set the Android UDID when running appium server programmatically, as i'm running my tests in parallel. Can we set the way BOOTSTRAP port is set below?

new AppiumServiceBuilder().
withArgument(AndroidServerFlag.BOOTSTRAP_PORT_NUMBER,"Your port number");

@TikhomirovSergey
Copy link
Contributor

@saikrishna321
Yes. You can

new AppiumServiceBuilder().
withArgument(GeneralServerFlag.UIID,"your UIID");

https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/service/local/flags/GeneralServerFlag.java#L40

If it is enough please close this ticket. Otherwise please provide some more details.

@saikrishna321
Copy link
Member Author

@TikhomirovSergey Awesome.. 👍 Closing the ticket

@saikrishna321
Copy link
Member Author

@TikhomirovSergey How can we set the path of LOG_LEVEL, like i want to name the file as udid.txt where should i specify that ?

@saikrishna321 saikrishna321 reopened this Dec 17, 2015
@saikrishna321
Copy link
Member Author

(GeneralServerFlag.LOG_LEVEL, "info") i see logs.txt created under ma project dir. How can i specify the path and fileName of this ?

@TikhomirovSergey
Copy link
Contributor

@saikrishna321
You can specify the path to the desired log file this way

new AppiumServiceBuilder().withLogFile(new File("path to the log file"))

Please close it again if the answer is right.

@saikrishna321
Copy link
Member Author

@TikhomirovSergey Thanks a lot.. very helpfull.. 👍

any info on how to use SHELL and WebHOOK flag ? Would b great if you can join the gitter room .

@TikhomirovSergey TikhomirovSergey changed the title [Question] Can we set Android UDID in AppiumLocalService [Question] How to set up AppiumDriverLocalService Dec 17, 2015
@TikhomirovSergey
Copy link
Contributor

@saikrishna321
Sorry
Lots af everyday work.

new AppiumServiceBuilder().withArgument(GeneralServerFlag.SHELL). //here I can be wrong
.withArgument(GeneralServerFlag.WEB_HOOK("localhost:9876")); //Also send log output to this HTTP listener

Some flags are boolean. At this case you have only

new AppiumServiceBuilder().withArgument(YOUR_DESIRED_FLAG);

Some flags require values

new AppiumServiceBuilder().withArgument(YOUR_DESIRED_FLAG, "ITS_VALUE");

The full list of flags you can fing here:

http://appium.io/slate/en/master/?ruby#appium-server-arguments

Here are samples. All flags are described in java_cleint via:
GeneralServerFlag here are flags for all platforms
AndroidServerFlag Android-specific flags
IOSServerFlag iOS-specific flags

@saikrishna321
Copy link
Member Author

@TikhomirovSergey

new AppiumServiceBuilder().withArgument(GeneralServerFlag.SHELL). //here I can be wrong
.withArgument(GeneralServerFlag.WEB_HOOK("localhost:9876")); //Also send log output to this HTTP listener

During the test execution, if i hit localhost:9876 nothing on this port is running

@TikhomirovSergey
Copy link
Contributor

It just was a sample :)

@cdewangan
Copy link

Can we run Appium Server as daemon ? Do we have any flag to run AppiumDriverLocalService in background, as it is blocking my code to execute further.

@TikhomirovSergey
Copy link
Contributor

@cdewangan it is most likely you are facing up this issue
#283

@cdewangan
Copy link

Thats right @TikhomirovSergey , Thanks for letting me know. I will wait for this merge.

@TikhomirovSergey
Copy link
Contributor

If there is no question anymore I'm closing it...

@ravikr42
Copy link

Hi @saikrishna321 @TikhomirovSergey

I am not able to set the device Udid using the code below:

new AppiumServiceBuilder().
withArgument(GeneralServerFlag.UIID,"your UIID");

For me "UIID" flag is not coming in GeneralServerFlag. I am using appium java_client 4.0.0 .

kindly help me on this.

Thanks
Ravi

@saikrishna321
Copy link
Member Author

@ravikr42
Copy link

ravikr42 commented Jul 18, 2016

Hi @saikrishna321
Thank you for your reply.
I am trying to supply Udid by shown code below:

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.UDID, "UdidValue");

new AppiumServiceBuilder().withCapabilities(caps);

But if I am supplying like this, my Appium server is not getting started.Am I doing wrong? could you please let me know the actual implementation.

After supplying capabilities I am getting output on console like this shown below:

usage: appium.js [-h] [-v] [--shell]
[--localizable-strings-dir LOCALIZABLESTRINGSDIR] [--app APP]
[--ipa IPA] [-U UDID] [-a ADDRESS] [-p PORT]
[-ca CALLBACKADDRESS] [-cp CALLBACKPORT] [-bp BOOTSTRAPPORT]
[-k] [-r BACKENDRETRIES] [--session-override] [--full-reset]
[--no-reset] [-l] [-lt LAUNCHTIMEOUT] [-g LOG]
[--log-level {info,info:debug,info:info,info:warn,info:error,warn,warn:debug,warn:info,warn:warn,awpaprinu:me.rjsr: eorrr,oerrror,e:rro rU:ndreebcuognized arggu,meernrtos: r:-info,er-rdoerf:awuarlnt,-capabielirtrior:erroers, {"udiddebu"g,: "Sodmeebug:debug,debug:i1nf2o3,ew"}.
debug:warn,debug:error}]
[--log-timestamp] [--local-timezone] [--log-no-colors]
[-G WEBHOOK] [--native-instruments-lib]
[--app-pkg ANDROIDPACKAGE] [--app-activity ANDROIDACTIVITY]
[--app-wait-package ANDROIDWAITPACKAGE]
[--app-wait-activity ANDROIDWAITACTIVITY]
[--android-coverage ANDROIDCOVERAGE] [--avd AVD]
[--avd-args AVDARGS]
[--device-ready-timeout ANDROIDDEVICEREADYTIMEOUT] [--safari]
[--device-name DEVICENAME] [--platform-name PLATFORMNAME]
[--platform-version PLATFORMVERSION]
[--automation-name AUTOMATIONNAME]
[--browser-name BROWSERNAME] [--default-device]
[--force-iphone] [--force-ipad] [--language LANGUAGE]
[--locale LOCALE] [--calendar-format CALENDARFORMAT]
[--orientation ORIENTATION]
[--tracetemplate AUTOMATIONTRACETEMPLATEPATH]
[--instruments INSTRUMENTSPATH] [--show-sim-log]
[--show-ios-log] [--nodeconfig NODECONFIG] [-ra ROBOTADDRESS]
[-rp ROBOTPORT] [--selendroid-port SELENDROIDPORT]
[--chromedriver-port CHROMEDRIVERPORT]
[--chromedriver-executable CHROMEDRIVEREXECUTABLE]
[--use-keystore] [--keystore-path KEYSTOREPATH]
[--keystore-password KEYSTOREPASSWORD] [--key-alias KEYALIAS]
[--key-password KEYPASSWORD] [--show-config]
[--no-perms-check] [--command-timeout DEFAULTCOMMANDTIMEOUT]
[--keep-keychains] [--strict-caps] [--isolate-sim-device]
[--tmp TMPDIR] [--trace-dir TRACEDIR]
[--intent-action INTENTACTION]
[--intent-category INTENTCATEGORY]
[--intent-flags INTENTFLAGS]
[--intent-args OPTIONALINTENTARGUMENTS]
[--dont-stop-app-on-reset] [--debug-log-spacing]
[--suppress-adb-kill-server] [--async-trace]

@SrinivasanTarget
Copy link
Member

@ravikr42 Which version of appium server are you using? If it is appium 1.4.x please use the latest server and client which is 1.5.3 & 4.0

@ravikr42
Copy link

Hi @SrinivasanTarget
I am using node appium 1.4.16 and appium java client 4.0.0

-Ravi

@SrinivasanTarget
Copy link
Member

Uninstall Appium 1.4.x and install Appium1.5.3. Give a try after that, it
will work.

On 18-Jul-2016 11:16 PM, "Ravi Kumar" notifications@github.com wrote:

Hi @SrinivasanTarget https://github.com/SrinivasanTarget
I am using node appium 1.4.16 and appium java client 4.0.0

-Ravi


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#274 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIfAJdak4eIRdxS3r2n4z1b8GEPmksQxks5qW7wTgaJpZM4Gq-iT
.

@ravikr42
Copy link

@SrinivasanTarget Thank you for your reply.

I will try this and let you know.

Thank you 👍

@ravikr42
Copy link

Hi @SrinivasanTarget

It Worked. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants