Window 10: How to run script on Genymotion emulator with appium using eclipse - eclipse

Please help to solve my problem
Genymotion with VirtualBox download from genymotion site and install properly
Add Genymotion pluging on eclipse and set Genymotion directory
Add virtual device Nexus9 os version 5.1.0 API 22
Add Selenium and Appium java client jar files under project
Use Genymotion Android Tool and Custom Android SDK tool as Genymotion ADB tool connection setting
Configure Appium Setting and run appium
Run below source code
import java.io.IOException;
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.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.URL;
import io.appium.java_client.android.AndroidDriver;
public class Firstappium {
static String deviceName = "Nexus9-6.0.0-API23";
static WebDriver driver;;
public static void main(String[] args) throws InterruptedException, ExecuteException, IOException {
DesiredCapabilities capabilities = new DesiredCapabilities();
DefaultExecutor executor = new DefaultExecutor();
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
capabilities.setCapability("deviceName","Nexus9-5.1.0API22");
capabilities.setCapability("platformVersion", "5.1");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("app","G:/appium/apk/cz.hipercalc.apk");
driver = new AndroidDriver(new URL("http://127.0.0.1:4720/wd/hub"),capabilities);
System.out.println("SetUp is successful and Appium Driver is launched successfully");
}
}
Show below log in Appium
info: [debug] 1 device(s) connected
info: Found device adb server version (32) doesn't match this client (36); killing...
info: [debug] Setting device id to adb server version (32) doesn't match this client (36); killing...
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
wait-for-device
info: [debug] Retrying restartAdb
error: Error running wait-for-device
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); 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: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
devices
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
wait-for-device
error: Error running wait-for-device
info: [debug] Retrying restartAdb
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
error: Error running wait-for-device
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); 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: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...
devices
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); 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 "G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); 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 "G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); 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 \"G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); 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 \"G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); killing...\r wait-for-device\"","origValue":"Command failed: C:\WINDOWS\system32\cmd.exe /s /c \"G:\Android\sdk\platform-tools\adb.exe -s adb server version (32) doesn't match this client (36); 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 30628.747 ms - 1226

From the logs what I can is "adb server version does not match".
Try updating your Android SDK first through ANDROID SDK MANAGER.
And you need to start appium server before you try to initialise the driver.
When you start appium server, by default it starts with port number 4723.
If you are not mentioning any port number while starting appium server then the url should be http://127.0.0.1:4723/wd/hub

Related

HW Debugging ARM Controller with J-Link error (Truncated register 16 in remote 'g' packet*)

I tried to debug my code with eclipse with the j-link debugger and gdb sserver and client.
I tried different settings but couldn't solve the error.
Eclipse error:
Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:2331
Error message from debugger back end:
Truncated register 16 in remote 'g' packet
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link LITE-Cortex-M-5V compiled Mar 3 2016 12:49:54
GDB Server output:
Hardware: V8.00
S/N: 638100545
Feature(s): GDB
Checking target voltage...
Target voltage: 5.03 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
GDB closed TCP/IP connection
Any hint what could solve my problem?

debugging with OpenOCD reports Protocol error with Rcmd

I'm working on establishing a debug connection to a Renesas RZ/G2L MPU.
My OpenOCD connection appears to launch fine (and i can connect to it with gdb from the shell afterwards with (gdb) target remote localhost:3333 fine):
Open On-Chip Debugger 0.12.0-rc2+dev-00989-g9501b263e-dirty (2022-12-12-17:03)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
G2L
G2L - 0 CA57(s), 2 CA55(s), 0 CA53(s), 0 CR7(s), 1 CM33(s)
Boot Core - CA55
r9a07g044l.cpu
SMP targets: r9a07g044l.a55.0 r9a07g044l.a55.1
init_reset
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : J-Link V11 compiled Dec 5 2022 13:50:41
Info : Hardware version: 11.00
Info : VTarget = 1.812 V
Info : clock speed 4000 kHz
Info : JTAG tap: r9a07g044l.cpu tap/device found: 0x6ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x6)
Info : r9a07g044l.a55.0: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for r9a07g044l.a55.0 on 3333
Info : Listening on port 3333 for gdb connections
Info : starting gdb server for r9a07g044l.m33 on 3334
Info : Listening on port 3334 for gdb connections
Info : gdb port disabled
I'm trying to hook it up with eclipse to debug Flash Writer which should allow me to bring up the system. I createda debug configuration, set the init commands under start up (per instructions from Renesas) and set the launch target to localhost:3333. Upon launch of a debug session from Eclipse however, I get the following error:
Error in final launch sequence:
Failed to execute MI command:
source /home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer
Error message from debugger back end:
/home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer:12: Error in sourced command file:
Protocol error with Rcmd
Failed to execute MI command:
source /home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer
Error message from debugger back end:
/home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer:12: Error in sourced command file:
Protocol error with Rcmd
Failed to execute MI command:
source /home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer
Error message from debugger back end:
/home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer:12: Error in sourced command file:
Protocol error with Rcmd
/home/mistywest/git/rzg2_flash_writer/gdb_smarc_g2l_flash_writer:12: Error in sourced command file:\nProtocol error with Rcmd
and on the OpenOCD console:
Info : accepting 'gdb' connection on tcp/3333
Info : r9a07g044l.a55.0 cluster 0 core 0 multi core
r9a07g044l.a55.0 halted in AArch64 state due to debug-request, current mode: EL3H
cpsr: 0x400003cd pc: 0x3a94
MMU: disabled, D-Cache: disabled, I-Cache: enabled
Info : New GDB Connection: 1, Target r9a07g044l.a55.0, state: halted
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: r9a07g044l.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Invalid ACK (0) in DAP response
Info : Deferring arp_examine of r9a07g044l.a55.1
Info : Use arp_examine command to examine it manually!
Info : Deferring arp_examine of r9a07g044l.m33
Info : Use arp_examine command to examine it manually!
Error: Invalid ACK (0) in DAP response
Error: Debug regions are unpowered, an unexpected reset might have happened
Error: JTAG-DP STICKY ERROR
Error: Could not initialize the APB-AP
Info : dropped 'gdb' connection
Oh I'm running this from a Fedora 36 host - if it matters

how to solve Exception: Gradle task assembleDebug failed with exit code 1

I am try to learn flutter. but in first when I want to run default app in flutter(counter) I face to this error. can you help me how I can solve it?
Launching lib\main.dart on Android SDK built for x86 in debug mode…
Running Gradle task ‘assembleDebug’…
FAILURE: Build failed with an exception.
What went wrong:
Could not connect to the Gradle daemon.
Daemon uid: 7e121133-e94a-477f-b757-cb0b2f130b5e with diagnostics:
Daemon pid: 11244
log file: C:\Users\Morteza.gradle\daemon\5.6.2\daemon-11244.out.log
----- Last 20 lines from daemon log file - daemon-11244.out.log -----
23:51:11.367 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
23:51:11.368 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #2-Native WiFi Filter Driver-0000
23:51:11.371 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
23:51:11.372 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #2-QoS Packet Scheduler-0000
23:51:11.375 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
23:51:11.376 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Microsoft Wi-Fi Direct Virtual Adapter #2-WFP 802.3 MAC Layer LightWeight Filter-0000
23:51:11.380 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
23:51:11.383 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Listening on [dcd48d42-facd-4af7-9888-10006483df5b port:65384, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]].
23:51:11.388 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Wed Sep 16 23:51:11 PDT 2020, with address: [dcd48d42-facd-4af7-9888-10006483df5b port:65384, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]]
23:51:11.389 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertising the daemon address to the clients: [dcd48d42-facd-4af7-9888-10006483df5b port:65384, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]]
23:51:11.389 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=7e121133-e94a-477f-b757-cb0b2f130b5e,javaHome=C:\Program Files\Android\Android Studio\jre,daemonRegistryDir=C:\Users\Morteza.gradle\daemon,pid=11244,idleTimeout=10800000,priority=NORMAL,daemonOpts=-Xmx1536M,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]
23:51:11.391 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [dcd48d42-facd-4af7-9888-10006483df5b port:65384, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], context: DefaultDaemonContext[uid=7e121133-e94a-477f-b757-cb0b2f130b5e,javaHome=C:\Program Files\Android\Android Studio\jre,daemonRegistryDir=C:\Users\Morteza.gradle\daemon,pid=11244,idleTimeout=10800000,priority=NORMAL,daemonOpts=-Xmx1536M,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]
23:51:11.405 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
23:51:11.411 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
23:51:11.420 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
23:51:11.420 [LIFECYCLE] [org.gradle.launcher.daemon.server.Daemon] Daemon server started.
23:51:11.423 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams…
23:51:11.433 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
23:51:11.435 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
23:51:11.435 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
----- End of the daemon log -----
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Exception: Gradle task assembleDebug failed with exit code 1
What you can try is flutter clean flutter upgrade and Invalidate caches and restart. If you are using Android Studio/IntelliJ

"Connection timed out" error while connecting vscode to gcloud cloud shell

I have set up the cloud shell for vscode as given in this document; however it stopped connecting to the remote shell and it was only connected once initially. No VS Code version change happened. Current VSCode version is 1.46.1
Following are the logs thrown -
[13:31:22.078] Log Level: 2
[13:31:22.086] remote-ssh#0.51.0
[13:31:22.086] win32 x64
[13:31:22.093] SSH Resolver called for "ssh-remote+cloud-shell", attempt 1
[13:31:22.094] SSH Resolver called for host: cloud-shell
[13:31:22.094] Setting up SSH remote "cloud-shell"
[13:31:23.942] Using commit id "cd9ea6488829f560dc949a8b2fb789f3cdc05f5d" and quality "stable" for server
[13:31:23.945] Install and start server if needed
[13:31:23.951] Checking ssh with "ssh -V"
[13:31:23.957] Got error from ssh: spawn ssh ENOENT
[13:31:23.958] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[13:31:23.962] Got error from ssh: spawn C:\Windows\System32\OpenSSH\ssh.exe ENOENT
[13:31:23.962] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[13:31:28.385] > OpenSSH_8.3p1, OpenSSL 1.1.1g 21 Apr 2020
[13:31:28.390] Running script with connection command: "C:\Program Files\Git\usr\bin\ssh.exe" -T -D 50396 cloud-shell bash
[13:31:28.412] Terminal shell path: C:\Windows\System32\cmd.exe
[13:31:33.205] >
[13:31:33.206] Got some output, clearing connection timeout
[13:31:54.348] > ssh: connect to host 34.87.29.174 port 6000: Connection timed out
>
[13:31:54.764] "install" terminal command done
[13:31:54.765] Install terminal quit with output: ssh: connect to host 34.87.29.174 port 6000: Connection timed out
[13:31:54.766] Received install output: ssh: connect to host 34.87.29.174 port 6000: Connection timed out
[13:31:54.768] Resolver error: The connection timed out
[13:31:54.781] ------

Successfully installed vs code server on remote host, but it's still trying to install something

I have successfully installed vs code server on the remote host following the steps here SSH with VSCode without internet.
Now when I ssh into the remote host, I can connect successfully and start working, but in the install terminal, it's still trying to install something, not sure if it's an extension on the remote host that I wanted to install earlier and later successfully installed with vsix. See the log from remote - ssh below, further down there's also output from the install terminal which shows a small bar moving, seemingly indicating progress of something.
How can I stop it from doing this every time I connect to the host? Thank you!!
[11:58:58.011] remote-ssh-nightly#2019.10.9540
[11:58:58.011] win32 x64
[11:58:58.013] SSH Resolver called for "ssh-remote+<hostname>", attempt 1
[11:58:58.013] SSH Resolver called for host: <hostname>
[11:58:58.013] Setting up SSH remote "<hostname>"
[11:58:58.028] Using commit id "<mycommitid>" and quality "stable" for server
[11:58:58.029] Testing ssh with ssh -V
[11:58:58.287] ssh exited with code: 0
[11:58:58.287] Got stderr from ssh: OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[11:58:58.290] Running script with connection command: ssh -T -D 61671 <hostname> bash
[11:58:58.292] Install and start server if needed
[11:58:58.295] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[11:58:58.639] >
[11:58:58.639] Got some output, clearing connection timeout
[11:58:59.616] > 6c2c07692b2a: running
>
[11:58:59.677] > Acquiring lock on /users/<myuserid>/.vscode-server/bin/<mycommitid>/vscode-remote-lock.<mycommitid>
> Found existing installation at /users/<myuserid>/.vscode-server/bin/<mycommitid>...
>
[11:58:59.718] > Found running server...
>
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
>
[11:58:59.739] > Checking server status on port 32772 with wget
> 6c2c07692b2a: start
> sshAuthSock====
> agentPort==32772==
> webViewServerPort====
> osReleaseId==centos==
> arch==x86_64==
> webUiAccessToken====
> 6c2c07692b2a: end
>
[11:58:59.739] Received install output:
sshAuthSock====
agentPort==32772==
webViewServerPort====
osReleaseId==centos==
arch==x86_64==
webUiAccessToken====
[11:58:59.740] Remote server is listening on port 32772
[11:58:59.740] Parsed server configuration: {"agentPort":32772,"osReleaseId":"centos","arch":"x86_64","webUiAccessToken":"","sshAuthSock":""}
[11:58:59.741] Starting forwarding server. localPort 61674 -> socksPort 61671 -> remotePort 32772
[11:58:59.742] Forwarding server listening on 61674
[11:58:59.742] Waiting for ssh tunnel to be ready
[11:58:59.750] [Forwarding server 61674] Got connection 0
[11:58:59.755] Tunneled remote port 32772 to local port 61674
[11:58:59.756] Resolved "ssh-remote+<hostname>" to "127.0.0.1:61674"
[11:58:59.756] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"success","osReleaseId":"centos","arch":"x86_64","askedPw":"0","askedPassphrase":"0","asked2fa":"0","askedHostKey":"0","remoteInConfigFile":"1","gotUnrecognizedPrompt":"0"},"measures":{"resolveAttempts":1,"retries":1}}
[11:58:59.756] ------
[11:58:59.784] [Forwarding server 61674] Got connection 1
[11:58:59.789] [Forwarding server 61674] Got connection 2
[12:01:59.722] >
[12:04:59.733] >
[12:07:59.744] >
Below is the output on the install terminal. At the end of this output, there's a small bar moving very slowly like a progress bar.
6c2c07692b2a: running
Acquiring lock on /users/<myuserid>/.vscode-server/bin/<commitid>/vscode-remote-lock.<commitid>
Found existing installation at /users/<myuserid>/.vscode-server/bin/<commitid>...
Found running server...
*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
*
Checking server status on port 32772 with wget
6c2c07692b2a: start
sshAuthSock====
agentPort==32772==
webViewServerPort====
osReleaseId==centos==
arch==x86_64==
webUiAccessToken====
6c2c07692b2a: end