Hi Folks,
We are unable to execute selendroid script on real device. Script works fine on Emulator but, facing an issue with real device.
Configurations:-
- Appium:-1.2.4.1
- Android version:-4.1.2
Please find the capabilities code:-
File appDir = new File(“C:\AndroidDocuments\Appium_Test\”);
//File app = new File(appDir, “robodemo-sample-1.0.1.apk”);
File app = new File(appDir, “Airfryer.apk”);
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“deviceName”, “4d08d8c26a009000”);
capabilities.setCapability(“automationName”, “Selendroid”);
capabilities.setCapability(“platformVersion”, “4.1.2”);
capabilities.setCapability(“platformName”, “Android”);
capabilities.setCapability(“appPackage”, “com.philips.cl.dl.kitchenappliances.airfryer”);
capabilities.setCapability(“appium-version”, “1.2.4.1”);
capabilities.setCapability(“app”, app.getAbsolutePath());
capabilities.setCapability(CapabilityType.PLATFORM, “WINDOW”);
capabilities.setCapability(“appactivity”, “com.wordpad.Main”);
driver = new AppiumDriver(new URL(“http://127.0.0.1:5552/wd/hub”),
capabilities);
Please find the Appium log:-
Starting Node Server
info: Welcome to Appium v1.2.4 (REV 71584425ecf777349e3215f0f18e71e7782acfb6)
info: Appium REST http interface listener started on 127.0.0.1:5552
info: [debug] Non-default server args: {“app”:“C:\AndroidDocuments\Appium_Test\Airfryer.apk”,“address”:“127.0.0.1”,“port”:5552,“logNoColors”:true,“deviceName”:“4d08d8c26a009000”,“platformName”:“Android”,“platformVersion”:“16”,“automationName”:“Selendroid”,“language”:“en”,“selendroidPort”:5552}
info: Console LogLevel: debug
info: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m e[90m{“desiredCapabilities”:{“appPackage”:“com.philips.cl.dl.kitchenappliances.airfryer”,“app”:“C:\AndroidDocuments\Appium_Test\Airfryer.apk”,“appium-version”:“1.2.4.1”,“appactivity”:“com.wordpad.Main”,“platformVersion”:“4.1.2”,“automationName”:“Selendroid”,“platformName”:“Android”,“deviceName”:“4d08d8c26a009000”,“platform”:“WINDOW”}}e[39m
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. : appium-version, appactivity, platform
info: [debug] No appActivity desired capability or server param. Parsing from apk.
info: [debug] Using local app from desired caps: C:\AndroidDocuments\Appium_Test\Airfryer.apk
info: [debug] Creating new appium session 186dcb68-246b-4986-a37e-ed8e1543848a
info: [debug] Starting selendroid server
info: [debug] Checking whether selendroid is built yet
info: [debug] Selendroid server exists!
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe
info: [debug] Setting Android Device Language to en
info: [debug] executing: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe” shell “setprop persist.sys.language en;”
info: [debug] executing: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe” shell “stop; sleep 2; setprop sys.boot_completed 0; start”
info: [debug] waiting for reboot, this takes time.
info: [debug] executing: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe” shell “getprop sys.boot_completed”
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe” devices
info: [debug] 1 device(s) connected
info: Found device 4d08d8c26a009000
info: [debug] Setting device id to 4d08d8c26a009000
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe” -s 4d08d8c26a009000 wait-for-device
info: [debug] executing: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe” -s 4d08d8c26a009000 shell “echo ‘ready’”
info: [debug] Starting logcat capture
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\build-tools\android-4.4W\aapt.exe
info: [debug] hasInternetPermissionFromManifest: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\build-tools\android-4.4W\aapt.exe” dump badging “C:\AndroidDocuments\Appium_Test\Airfryer.apk”
info: [debug] Parsing package and activity from app manifest
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\build-tools\android-4.4W\aapt.exe
info: [debug] packageAndLaunchActivityFromManifest: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\build-tools\android-4.4W\aapt.exe” dump badging “C:\AndroidDocuments\Appium_Test\Airfryer.apk”
info: [debug] badging package: com.philips.cl.di.kitchenappliances.airfryer
info: [debug] badging act: com.philips.cl.di.kitchenappliances.views.SplashScreenActivity
info: [debug] Parsed package and activity are: com.philips.cl.di.kitchenappliances.airfryer/com.philips.cl.di.kitchenappliances.views.SplashScreenActivity
info: [debug] Rebuilt selendroid server already exists, no need to rebuild it with a new manifest
info: [debug] Checking signed status of C:\Windows\Temp\selendroid.com.philips.cl.dl.kitchenappliances.airfryer.apk
info: [debug] Checking app cert for C:\Windows\Temp\selendroid.com.philips.cl.dl.kitchenappliances.airfryer.apk: java -jar “C:\AndroidDocuments\AppiumForWindows-1.2.4.1\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar” “C:\Windows\Temp\selendroid.com.philips.cl.dl.kitchenappliances.airfryer.apk”
info: [debug] Checking signed status of C:\AndroidDocuments\Appium_Test\Airfryer.apk
info: [debug] Checking app cert for C:\AndroidDocuments\Appium_Test\Airfryer.apk: java -jar “C:\AndroidDocuments\AppiumForWindows-1.2.4.1\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar” “C:\AndroidDocuments\Appium_Test\Airfryer.apk”
info: [debug] App already signed.
info: [debug] Zip-aligning C:\Windows\Temp\selendroid.com.philips.cl.dl.kitchenappliances.airfryer.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\build-tools\android-4.4W\zipalign.exe
info: [debug] zipAlignApk: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\build-tools\android-4.4W\zipalign.exe” -f 4 “C:\Windows\Temp\selendroid.com.philips.cl.dl.kitchenappliances.airfryer.apk” “C:\Users\Automob\AppData\Local\Temp\appium1141026-4156-184a8jv.tmp”
info: [debug] App already signed.
info: [debug] Zip-aligning C:\AndroidDocuments\Appium_Test\Airfryer.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\build-tools\android-4.4W\zipalign.exe
info: [debug] zipAlignApk: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\build-tools\android-4.4W\zipalign.exe” -f 4 “C:\AndroidDocuments\Appium_Test\Airfryer.apk” “C:\Users\Automob\AppData\Local\Temp\appium1141026-4156-5amsu7.tmp”
info: [debug] Rebuilt selendroid apk does not exist, uninstalling any instances of it on device to make way for new one
info: [debug] Uninstalling com.philips.cl.dl.kitchenappliances.airfryer.selendroid
info: [debug] executing: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe” -s 4d08d8c26a009000 shell “am force-stop com.philips.cl.dl.kitchenappliances.airfryer.selendroid”
info: [debug] executing: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe” -s 4d08d8c26a009000 uninstall com.philips.cl.dl.kitchenappliances.airfryer.selendroid
info: [debug] App was not uninstalled, maybe it wasn’t on device?
info: [debug] Getting install status for com.philips.cl.dl.kitchenappliances.airfryer.selendroid
info: [debug] Getting device API level
info: [debug] executing: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe” -s 4d08d8c26a009000 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 16
info: [debug] executing: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe” -s 4d08d8c26a009000 shell “pm list packages -3 com.philips.cl.dl.kitchenappliances.airfryer.selendroid”
info: [debug] App is not installed
info: [debug] Rebuilt selendroid is not installed, installing it
info: [debug] executing: “C:\AndroidDocuments\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe” -s 4d08d8c26a009000 install -r “C:\Windows\Temp\selendroid.com.philips.cl.dl.kitchenappliances.airfryer.apk”
info: [debug] Cleaning up appium session
info: [debug] Error: spawn OK
at errnoException (child_process.js:988:11)
at Process.ChildProcess._handle.onexit (child_process.js:779:34)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: spawn OK)”,“code”:“OK”,“errno”:“OK”,“syscall”:“spawn”,“origValue”:“spawn OK”},“sessionId”:null}
info: e[37m<-- POST /wd/hub/session e[39me[31m500e[39me[90m 10712.412 ms - 181e[39m e[90me[39m
error: Failed to start an Appium session, err was: Error: spawn OK
Should I use any other capabilities or installation to work with API level below 17(For selendroid)
Any suggestions/help would be appreciated.
Thanks&Regards,
Matti