Code Fail to install whats-app apk and convert apk to 1457162839737.tmp

Hello aim trying to run real device (Android S6 edge) in appuim tool

I follow these steps to setup the environment:
-Install JDK (jdk1.7.0_55)
-Install SDK (adt-bundle-windows-x86_64-20131030)
-Install Eclipse IDE for Java Developers Version: Luna Service Release 2 (4.4.2) Android SDK Manager (Android SDK Build-tools 24.4.1,23.1,20,19.1,19.0.3 / Extras Google USB Driver)
-Install Appium 1.2.0.1
-install node.js
-Install pdanet Desktop
-Install whats-app apk

Issue After user run TestNG test

  • Code Fail to install whats-app apk and convert apk to 1457162839737.tmp
  • pdanet Desktop return error message "Scoket close or error (code =10054)

code

import io.appium.java_client.android.AndroidDriver;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;

public class Whatsapp {

 @Test
  public void testApp() throws MalformedURLException  {

	 WebDriver dr;
	 
	 
	 File app = new File("C:\\DHA\\Workspace\\TestAppium\\Apk\\WhatsApp.apk");
		
		DesiredCapabilities capabilities = new DesiredCapabilities();
		capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
		capabilities.setCapability("deviceName", "Galaxy S6 edge");
		capabilities.setCapability("platformVersion", "5.1.1");
		capabilities.setCapability("platformName", "Android");
		capabilities.setCapability("app", app.getAbsolutePath());
		capabilities.setCapability("appPackage", "com.WhatsApp"); 
		capabilities.setCapability("appActivity", "com.WhatsApp");
		capabilities.setCapability("appWaitActivity", ".activities.SubActivity");
		 
	//	capabilities.setCapability("appPackage", "com.whatsapp");
	//	capabilities.setCapability("appActivity", "com.whatsapp.Main");
		 
		
		dr = new AndroidDriver(new URL("http://192.168.1.14:4723/wd/hub"), capabilities);
		dr.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);

}
}

Log

Starting Node Server

info: Welcome to Appium v1.2.0 (REV e53f49c706a25242e66d36685c268b599cc18da5)
debug: Non-default server args: {“address”:“192.168.1.14”,“noReset”:true,“logNoColors”:true,“platformName”:“Android”,“platformVersion”:“18”,“automationName”:“Appium”}
info: Appium REST http interface listener started on 192.168.1.14:4723
info: LogLevel: debug
info: → POST /wd/hub/session {“desiredCapabilities”:{“platformVersion”:“5.1.1”,“app”:“C:\DHA\Workspace\TestAppium\Apk\WhatsApp.apk”,“deviceName”:“Galaxy S6 edge”,“platformName”:“Android”,“browserName”:“”,“appActivity”:“com.WhatsApp”,“appWaitActivity”:“.activities.SubActivity”,“appPackage”:“com.WhatsApp”}}
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {“desiredCapabilities”:{“platformVersion”:“5.1.1”,“app”:“C:\DHA\Workspace\TestAppium\Apk\WhatsApp.apk”,“deviceName”:“Galaxy S6 edge”,“platformName”:“Android”,“browserName”:“”,“appActivity”:“com.WhatsApp”,“appWaitActivity”:“.activities.SubActivity”,“appPackage”:“com.WhatsApp”}}
info: Starting android appium
debug: Using local app from desired caps: C:\DHA\Workspace\TestAppium\Apk\WhatsApp.apk
info: Retrieving device
debug: Creating new appium session c1c26f20-96a9-4c31-9dd2-83e4f524b897
debug: Using fast reset? false
debug: Preparing device for session
debug: Checking whether app is actually present
debug: Checking whether adb is present
debug: Using adb from C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe
debug: Trying to find a connected android device
debug: Getting connected devices…
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” devices
info: Found device adb server is out of date. killing…
debug: Setting device id to adb server is out of date. killing…
debug: Waiting for device to be ready and to respond to shell commands (timeout = 5)
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
wait-for-device
warn: code=OK, errno=OK, syscall=spawn
error: Error running wait-for-device
debug: Retrying restartAdb
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
kill-server
warn: code=OK, errno=OK, syscall=spawn
error: Error killing ADB server, going to see if it’s online anyway
debug: Getting connected devices…
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
devices
warn: code=OK, errno=OK, syscall=spawn
debug: Waiting for device to be ready and to respond to shell commands (timeout = 5)
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
wait-for-device
warn: code=OK, errno=OK, syscall=spawn
error: Error running wait-for-device
debug: Retrying restartAdb
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
kill-server
error: Error killing ADB server, going to see if it’s online anyway
warn: code=OK, errno=OK, syscall=spawn
debug: Getting connected devices…
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
devices
warn: code=OK, errno=OK, syscall=spawn
debug: Waiting for device to be ready and to respond to shell commands (timeout = 5)
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
wait-for-device
warn: code=OK, errno=OK, syscall=spawn
error: Error running wait-for-device
debug: Retrying restartAdb
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
kill-server
warn: code=OK, errno=OK, syscall=spawn
error: Error killing ADB server, going to see if it’s online anyway
debug: Getting connected devices…
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
devices
warn: code=OK, errno=OK, syscall=spawn
debug: Waiting for device to be ready and to respond to shell commands (timeout = 5)
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
wait-for-device
warn: code=OK, errno=OK, syscall=spawn
error: Error running wait-for-device
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
kill-server
warn: code=OK, errno=OK, syscall=spawn
error: Error killing ADB server, going to see if it’s online anyway
debug: Getting connected devices…
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
devices
warn: code=OK, errno=OK, syscall=spawn
debug: Waiting for device to be ready and to respond to shell commands (timeout = 5)
debug: executing: “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe” -s adb server is out of date. killing…
wait-for-device
warn: code=OK, errno=OK, syscall=spawn
error: Error running wait-for-device
debug: Sent shutdown command, waiting for UiAutomator to stop…
warn: UiAutomator did not shut down fast enough, calling it gone
debug: Cleaning up android objects
debug: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: spawn OK
debug: Error: spawn OK
at errnoException (child_process.js:988:11)
at Process.ChildProcess._handle.onexit (child_process.js:779:34)
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}

Please Help ?

Is there a reason that you aren’t running a current version? The simplest help would be to suggest to update to 1.4.16.

After installing AppiumForWindows_1_4_16_1 and run TestNG test

  • pdanet Desktop return error message "Scoket close or error (code =10054)

Log

Launching Appium server with command: C:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 192.168.19.2 --port 4723 --platform-name Android --platform-version 23 --automation-name Appium --log-no-color
info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
info: Appium REST http interface listener started on 192.168.19.2:4723
info: [debug] Non-default server args: {“address”:“192.168.19.2”,“logNoColors”:true,“platformName”:“Android”,“platformVersion”:“23”,“automationName”:“Appium”}
info: Console LogLevel: debug
info: → POST /wd/hub/session {“desiredCapabilities”:{“platformVersion”:“5.1.1”,“app”:“C:\DHA\Workspace\TestAppium\Apk\WhatsApp.apk”,“deviceName”:“Galaxy S6 edge”,“platformName”:“Android”,“browserName”:“”,“appActivity”:“com.WhatsApp”,“appWaitActivity”:“.activities.SubActivity”,“appPackage”:“com.WhatsApp”}}
info: Client User-Agent string: Apache-HttpClient/4.5.1 (Java/1.7.0_80)
info: [debug] Using local app from desired caps: C:\DHA\Workspace\TestAppium\Apk\WhatsApp.apk
info: [debug] Creating new appium session 14f0d685-9165-4201-b365-5919f8219856
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.7.0
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.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:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe devices
info: [debug] 2 device(s) connected
info: Found device adb server is out of date. killing…
info: [debug] Setting device id to adb server is out of date. killing…
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
wait-for-device
error: Error running wait-for-device
info: [debug] Retrying restartAdb
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
devices
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
wait-for-device
error: Error running wait-for-device
info: [debug] Retrying restartAdb
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
devices
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
wait-for-device
error: Error running wait-for-device
info: [debug] Retrying restartAdb
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
devices
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
wait-for-device
error: Error running wait-for-device
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
devices
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
wait-for-device
error: Error running wait-for-device
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
warn: UiAutomator did not shut down fast enough, calling it gone
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: C:\windows\system32\cmd.exe /s /c “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
wait-for-device”
error: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
could not read ok from ADB Server

  • could not start server *

info: [debug] Error: Command failed: C:\windows\system32\cmd.exe /s /c “C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…
wait-for-device”
error: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
could not read ok from ADB Server

  • could not start server *

    at ChildProcess.exithandler (child_process.js:751:12)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1016:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
    info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Command failed: C:\windows\system32\cmd.exe /s /c "C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…\r wait-for-device"\nerror: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)\r\ncould not read ok from ADB Server\r\n* could not start server \r\n)",“killed”:false,“code”:4294967295,“signal”:null,“cmd”:“C:\windows\system32\cmd.exe /s /c "C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…\r wait-for-device"”,“origValue”:"Command failed: C:\windows\system32\cmd.exe /s /c "C:\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s adb server is out of date. killing…\r wait-for-device"\nerror: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)\r\ncould not read ok from ADB Server\r\n could not start server *\r\n”},“sessionId”:null}
    info: ← POST /wd/hub/session 500 14237.457 ms - 1250

Cool. Now update adb server and you should be good to go.

It’s working now ,but i want to user Protractor can you please help me ?

I actually don’t know what Protractor is. Do you have a link?

https://angular.github.io/protractor/#/

Have you done everything here?