Can we start the Appium server from automation script instead of Appium Client?
If Yes, Could you please paste the syntax here.
Can we start the Appium server from automation script instead of Appium Client?
If Yes, Could you please paste the syntax here.
When I try with the code you said, I got the below error.
[TestNG] Running:
/private/var/folders/jx/ffh_slbj46l55xd0wqb7j7sc0000gp/T/testng-eclipse-122749652/testng-customsuite.xml
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,warn:error,error,error:debug,error:info,error:warn,error:error,debug,debug:debug,debug:info,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]
appium.js: error: argument â-g/âlogâ: Expected one argument. null
FAILED: f
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: â2.45.0â, revision: â5017cb8â, time: â2015-02-26 23:59:50â
System info: host: âpcnicmcdev01â, ip: â172.25.11.137â, os.name: âMac OS Xâ, os.arch: âx86_64â, os.version: â10.10.2â, java.version: â1.8.0_45â
Driver info: driver.version: AndroidDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:593)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:109)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:39)
at androidAppium.NewTest1.f(NewTest1.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:648)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:834)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1142)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:771)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
at org.testng.SuiteRunner.run(SuiteRunner.java:259)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1176)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1101)
at org.testng.TestNG.run(TestNG.java:1009)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:4723 [/127.0.0.1] failed: Connection refused
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:142)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:319)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:126)
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:72)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:133)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572)
⌠31 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:72)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:125)
⌠44 more
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@626b2d4a: 26 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@cac736f: 34 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@123772c4: 8 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@73a28541: 5 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 5 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@4926097b: 7 ms
package androidAppium;
import io.appium.java_client.android.AndroidDriver;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecuteResultHandler;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteException;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;
public class NewTest1 {
//public static AndroidDriver driver;
@Test
public void f() throws MalformedURLException {
CommandLine command = new CommandLine("/Applications/Appium.app/Contents/Resources/node/bin/node");
//command.addArgument("/Applications/Appium.app/Contents/Resources/node/bin/node",false);
command.addArgument("/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js",false);
command.addArgument("âaddress",false);
command.addArgument(â127.0.0.1â);
command.addArgument("âport",false);
command.addArgument(â4723â);
//command.addArgument("âfull-reset",false);
command.addArgument("âlog");
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
DefaultExecutor executor = new DefaultExecutor();
executor.setExitValue(0);
try {
executor.execute(command, resultHandler);
} catch (ExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
File app = new File("/Users/mahesh/Desktop/****.apk");
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("deviceName", "XT1022");
caps.setCapability("platformVersion", "4.4.2");
caps.setCapability("app", app.getAbsolutePath());
caps.setCapability("appPackage", "com.****.****");
AndroidDriver driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), caps);
}
}
That is becaue your server arguments are missing an argument after the âlog, you should add an absolute path to a file to save the server logs to it.
Something like:
command.addArgument(ââlogâ);
command.addArgument(âABSOLUTE_FILE_PATHâ);
As you said the server logs are stored in a separate file. But, the Appium console logs also visible in the Eclipse console.
When I give this
command.addArgument(ââlogâ);
command.addArgument(âD:\AppiumConsole.txtâ);
All the logs are saved in that text file.
I want the Appium console logs alone in a separate file and the further things in the eclipse console.
Also I have a clarification over console mode as debug, could you explain that?
That file should include Appium logs only. All the rest of the logs should be printed in the Eclipse console as normal. I am not sure what is causing that behavior, please provide your Appium logs and code for further investigation.
Overall Eclipse Console log:
[TestNG] Running:
C:\Users\ashokkumarg\AppData\Local\Temp\testng-eclipseâ1518959040\testng-customsuite.xml
ERROR: The process ânode.exeâ not found.
e[33mwarne[39m: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade!
e[36minfoe[39m: Welcome to Appium v1.4.0 (REV 8f63e2f91ef7907aed8bda763f4e5ca08e86970a)
e[36minfoe[39m: Appium REST http interface listener started on 127.0.0.1:4725
e[36minfoe[39m: [debug] Non-default server args: {âaddressâ:â127.0.0.1â,âportâ:4725,âfullResetâ:true,âlogâ:âD:\AppiumConsole.txtâ}
e[36minfoe[39m: Console LogLevel: debug
e[36minfoe[39m: File LogLevel: debug
Row is not empty
1 8 in Execution_Config
Into Android Desired Capabilities Setup
Row is not empty
7 2 in Execution_Config
Row is not empty
8 2 in Execution_Config
Row is not empty
9 2 in Execution_Config
Row is not empty
10 2 in Execution_Config
Row is not empty
11 2 in Execution_Config
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See Apache log4j 1.2 - Frequently Asked Technical Questions for more info.
e[36minfoe[39m: e[37mâ>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m e[90m{âdesiredCapabilitiesâ:{âavdâ:âAutoInsuranceâ,âplatformVersionâ:â4.4.2â,âappâ:âD:/SOFTWARES/Apks/autoInsurance.apkâ,âdeviceNameâ:âemulator-5554â,âplatformNameâ:âAndroidâ}}e[39m
e[36minfoe[39m: Client User-Agent string: Apache-HttpClient/4.4.1 (Java/1.7.0_51)
e[36minfoe[39m: [debug] No appActivity desired capability or server param. Parsing from apk.
e[36minfoe[39m: [debug] No appPackage desired capability or server param. Parsing from apk.
e[36minfoe[39m: [debug] Using local app from desired caps: D:\SOFTWARES\Apks\autoInsurance.apk
e[36minfoe[39m: [debug] Creating new appium session fb683095-5196-4e95-8bac-e3e961769ef5
e[36minfoe[39m: Starting android appium
e[36minfoe[39m: [debug] Getting Java version
e[36minfoe[39m: Java version is: 1.7.0_51
e[36minfoe[39m: [debug] Checking whether adb is present
e[36minfoe[39m: [debug] Using adb from D:\SOFTWARES\sdk\platform-tools\adb.exe
e[36minfoe[39m: [debug] Parsing package and activity from app manifest
e[36minfoe[39m: [debug] Checking whether aapt is present
e[36minfoe[39m: [debug] Using aapt from D:\SOFTWARES\sdk\build-tools\android-4.2.2\aapt.exe
e[36minfoe[39m: [debug] Extracting package and launch activity from manifest.
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\build-tools\android-4.2.2\aapt.exe dump badging D:\SOFTWARES\Apks\autoInsurance.apk
e[36minfoe[39m: [debug] badging package: com.htcindia.autoinsurance
e[36minfoe[39m: [debug] badging act: com.htcindia.autoinsurance.SplashActivity
e[36minfoe[39m: [debug] Parsed package and activity are: com.htcindia.autoinsurance/com.htcindia.autoinsurance.SplashActivity
e[36minfoe[39m: [debug] Set chromedriver binary as: D:\programfiles\node_modules\appium\build\chromedriver\windows\chromedriver.exe
e[36minfoe[39m: [debug] Using fast reset? false
e[36minfoe[39m: [debug] Preparing device for session
e[36minfoe[39m: [debug] Checking whether app is actually present
e[36minfoe[39m: [debug] Trying to find AutoInsurance emulator
e[36minfoe[39m: [debug] Getting connected emulators
e[36minfoe[39m: [debug] Getting connected devicesâŚ
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe devices
e[36minfoe[39m: [debug] 1 device(s) connected
e[36minfoe[39m: [debug] 1 emulator(s) connected
e[36minfoe[39m: [debug] Sending telnet command to device: avd name
e[36minfoe[39m: [debug] Getting running emulator port
e[36minfoe[39m: [debug] Socket connection to device created
e[36minfoe[39m: [debug] Socket connection to device ready
e[36minfoe[39m: [debug] Telnet command got response: AutoInsurance
e[36minfoe[39m: [debug] Found emulator AutoInsurance in port 5554
e[36minfoe[39m: [debug] Setting device id to emulator-5554
e[36minfoe[39m: [debug] Did not launch AVD because it was already running.
e[36minfoe[39m: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 wait-for-device
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âecho âreadyââ
e[36minfoe[39m: [debug] Starting logcat capture
e[36minfoe[39m: [debug] Getting device API level
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âgetprop ro.build.version.sdkâ
e[36minfoe[39m: [debug] Device is at API Level 19
e[36minfoe[39m: Device API level is: 19
e[36minfoe[39m: [debug] Extracting strings for language: default
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âgetprop persist.sys.languageâ
e[36minfoe[39m: [debug] Current device persist.sys.language: en
e[36minfoe[39m: [debug] java -jar âD:\programfiles\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jarâ âstringsFromApkâ âD:\SOFTWARES\Apks\autoInsurance.apkâ âC:\Users\ASHOKK~1\AppData\Local\Temp\com.htcindia.autoinsuranceâ en
e[36minfoe[39m: [debug] No strings.xml for language âenâ, getting default strings.xml
e[36minfoe[39m: [debug] java -jar âD:\programfiles\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jarâ âstringsFromApkâ âD:\SOFTWARES\Apks\autoInsurance.apkâ âC:\Users\ASHOKK~1\AppData\Local\Temp\com.htcindia.autoinsuranceâ
e[36minfoe[39m: [debug] Reading strings from converted strings.json
e[36minfoe[39m: [debug] Setting language to default
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 push âC:\Users\ASHOKK~1\AppData\Local\Temp\com.htcindia.autoinsurance\strings.jsonâ /data/local/tmp
e[36minfoe[39m: [debug] Checking whether aapt is present
e[36minfoe[39m: [debug] Using aapt from D:\SOFTWARES\sdk\build-tools\android-4.2.2\aapt.exe
e[36minfoe[39m: [debug] Retrieving process from manifest.
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\build-tools\android-4.2.2\aapt.exe dump xmltree D:\SOFTWARES\Apks\autoInsurance.apk AndroidManifest.xml
e[36minfoe[39m: [debug] Set app process to: com.htcindia.autoinsurance
e[36minfoe[39m: [debug] Uninstalling com.htcindia.autoinsurance
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âam force-stop com.htcindia.autoinsuranceâ
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 uninstall com.htcindia.autoinsurance
e[36minfoe[39m: [debug] App was uninstalled
e[36minfoe[39m: [debug] Checking app cert for D:\SOFTWARES\Apks\autoInsurance.apk.
e[36minfoe[39m: [debug] executing cmd: java -jar D:\programfiles\node_modules\appium\node_modules\appium-adb\jars\verify.jar D:\SOFTWARES\Apks\autoInsurance.apk
e[36minfoe[39m: [debug] App already signed.
e[36minfoe[39m: [debug] Zip-aligning D:\SOFTWARES\Apks\autoInsurance.apk
e[36minfoe[39m: [debug] Checking whether zipalign is present
e[36minfoe[39m: [debug] Using zipalign from D:\SOFTWARES\sdk\tools\zipalign.exe
e[36minfoe[39m: [debug] Zip-aligning apk.
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\tools\zipalign.exe -f 4 D:\SOFTWARES\Apks\autoInsurance.apk C:\Users\ASHOKK~1\AppData\Local\Temp\11566-5900-1255dsr\appium.tmp
e[36minfoe[39m: [debug] MD5 for app is 0558b16961dfb119afe15696d2e3ff60
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âls /data/local/tmp/0558b16961dfb119afe15696d2e3ff60.apkâ
e[36minfoe[39m: [debug] Getting install status for com.htcindia.autoinsurance
e[36minfoe[39m: [debug] Getting device API level
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âgetprop ro.build.version.sdkâ
e[36minfoe[39m: [debug] Device is at API Level 19
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âpm list packages -3 com.htcindia.autoinsuranceâ
e[36minfoe[39m: [debug] App is not installed
e[36minfoe[39m: Installing App
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âmkdir -p /data/local/tmp/â
e[36minfoe[39m: [debug] Removing any old apks
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âls /data/local/tmp/*.apkâ
e[36minfoe[39m: [debug] Found an apk we want to keep at /data/local/tmp/0558b16961dfb119afe15696d2e3ff60.apk
e[36minfoe[39m: [debug] Couldnât find any apks to remove
e[36minfoe[39m: [debug] Uninstalling com.htcindia.autoinsurance
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âam force-stop com.htcindia.autoinsuranceâ
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 uninstall com.htcindia.autoinsurance
e[36minfoe[39m: [debug] App was not uninstalled, maybe it wasnât on device?
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âpm install -r /data/local/tmp/0558b16961dfb119afe15696d2e3ff60.apkâ
e[36minfoe[39m: [debug] Forwarding system:4724 to device:4724
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:4724 tcp:4724
e[36minfoe[39m: [debug] Pushing appium bootstrap to deviceâŚ
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 push âD:\programfiles\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jarâ /data/local/tmp/
e[36minfoe[39m: [debug] Pushing settings apk to deviceâŚ
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 install âD:\programfiles\node_modules\appium\build\settings_apk\settings_apk-debug.apkâ
e[36minfoe[39m: [debug] Pushing unlock helper app to deviceâŚ
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 install âD:\programfiles\node_modules\appium\build\unlock_apk\unlock_apk-debug.apkâ
e[36minfoe[39m: Starting App
e[36minfoe[39m: [debug] Attempting to kill all âuiautomatorâ processes
e[36minfoe[39m: [debug] Getting all processes with âuiautomatorâ
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âps âuiautomatorââ
e[36minfoe[39m: [debug] No matching processes found
e[36minfoe[39m: [debug] Running bootstrap
e[36minfoe[39m: [debug] spawning: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.htcindia.autoinsurance -e disableAndroidWatchers false
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] WARNING: linker:e[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.e[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1e[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=e[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:e[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunnere[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServere[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrape[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1e[39m
e[36minfoe[39m: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1e[39m
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Loading jsonâŚ
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] json loading complete.
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
e[36minfoe[39m: [debug] Waking up device if itâs not alive
e[36minfoe[39m: [debug] Pushing command to appium work queue: [âwakeâ,{}]
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Client connected
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âdumpsys windowâ
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got data from client: {âcmdâ:âactionâ,âactionâ:âwakeâ,âparamsâ:{}}
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command action: wake
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Returning result: {âvalueâ:true,âstatusâ:0}
e[36minfoe[39m: [debug] Screen already unlocked, continuing.
e[36minfoe[39m: [debug] Pushing command to appium work queue: [âgetDataDirâ,{}]
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got data from client: {âcmdâ:âactionâ,âactionâ:âgetDataDirâ,âparamsâ:{}}
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Returning result: {âvalueâ:â/dataâ,âstatusâ:0}
e[36minfoe[39m: [debug] dataDir set to: /data
e[36minfoe[39m: [debug] Pushing command to appium work queue: [âcompressedLayoutHierarchyâ,{âcompressLayoutâ:false}]
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got data from client: {âcmdâ:âactionâ,âactionâ:âcompressedLayoutHierarchyâ,âparamsâ:{âcompressLayoutâ:false}}
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
e[36minfoe[39m: [debug] Getting device API level
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âgetprop ro.build.version.sdkâ
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Returning result: {âvalueâ:false,âstatusâ:0}
e[36minfoe[39m: [debug] Device is at API Level 19
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âam start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.htcindia.autoinsurance/com.htcindia.autoinsurance.SplashActivityâ
e[36minfoe[39m: [debug] Waiting for pkg âcom.htcindia.autoinsuranceâ and activity âcom.htcindia.autoinsurance.SplashActivityâ to be focused
e[36minfoe[39m: [debug] Getting focused package and activity
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âdumpsys window windowsâ
e[36minfoe[39m: [debug] executing cmd: D:\SOFTWARES\sdk\platform-tools\adb.exe -s emulator-5554 shell âgetprop ro.build.version.releaseâ
e[36minfoe[39m: [debug] Device is at release version 4.4.2
e[36minfoe[39m: [debug] Device launched! Ready for commands
e[36minfoe[39m: [debug] Setting command timeout to the default of 60 secs
e[36minfoe[39m: [debug] Appium session started with sessionId fb683095-5196-4e95-8bac-e3e961769ef5
e[36minfoe[39m: e[37m<-- POST /wd/hub/session e[39me[36m303e[39me[90m 8791.481 ms - 74e[39m e[90me[39m
e[36minfoe[39m: e[37mâ>e[39m e[37mGETe[39m e[37m/wd/hub/session/fb683095-5196-4e95-8bac-e3e961769ef5e[39m e[90m{}e[39m
e[36minfoe[39m: [debug] Responding to client with success: {âstatusâ:0,âvalueâ:{âplatformâ:âLINUXâ,âbrowserNameâ:âAndroidâ,âplatformVersionâ:â4.4.2â,âwebStorageEnabledâ:false,âtakesScreenshotâ:true,âjavascriptEnabledâ:true,âdatabaseEnabledâ:false,ânetworkConnectionEnabledâ:true,âlocationContextEnabledâ:false,âwarningsâ:{},âdesiredâ:{âavdâ:âAutoInsuranceâ,âplatformVersionâ:â4.4.2â,âappâ:âD:/SOFTWARES/Apks/autoInsurance.apkâ,âdeviceNameâ:âemulator-5554â,âplatformNameâ:âAndroidâ},âavdâ:âAutoInsuranceâ,âappâ:âD:/SOFTWARES/Apks/autoInsurance.apkâ,âdeviceNameâ:âemulator-5554â,âplatformNameâ:âAndroidâ},âsessionIdâ:âfb683095-5196-4e95-8bac-e3e961769ef5â}
e[36minfoe[39m: e[37m<-- GET /wd/hub/session/fb683095-5196-4e95-8bac-e3e961769ef5 e[39me[32m200e[39me[90m 2.230 ms - 595e[39m e[90m{âstatusâ:0,âvalueâ:{âplatformâ:âLINUXâ,âbrowserNameâ:âAndroidâ,âplatformVersionâ:â4.4.2â,âwebStorageEnabledâ:false,âtakesScreenshotâ:true,âjavascriptEnabledâ:true,âdatabaseEnabledâ:false,ânetworkConnectionEnabledâ:true,âlocationContextEnabledâ:false,âwarningsâ:{},âdesiredâ:{âavdâ:âAutoInsuranceâ,âplatformVersionâ:â4.4.2â,âappâ:âD:/SOFTWARES/Apks/autoInsurance.apkâ,âdeviceNameâ:âemulator-5554â,âplatformNameâ:âAndroidâ},âavdâ:âAutoInsuranceâ,âappâ:âD:/SOFTWARES/Apks/autoInsurance.apkâ,âdeviceNameâ:âemulator-5554â,âplatformNameâ:âAndroidâ},âsessionIdâ:âfb683095-5196-4e95-8bac-e3e961769ef5â}e[39m
Appium SetUp for Android is successful and Appium Driver is launched successfully
Hello @ashokkumarg,
I think I misunderstood you at first; Appium logs are stored in a separate file as you requested, but they would still show up in your IDEâs console screen as this is the normal behavior. If you want to separate the two logs in two separate streams, I suggest using a logger like Log4j instead of the normal System.out.println. Make sure to save your Log4j logs to an external file.
Hope that helps and sorry for the misunderstanding .
Hassan
Thanks @Hassan_Radi In Appium settings there is an option called as âQuiet Loggingâ. That operation is not working when I run in GUI mode.
Do I need to pass it via command line arguments. If so how can be done?
@Hassan_Radi I am still getting the same error even after adding the log file Path as argument in very next line of --log line. What would have been the problem for this?
Can you please tell me,how can we start appium server progmatically .As i have to run my Appium Automated test cases through pipelines