(Yum) How can you find out which version of Google Chrome you have when it is installed remotely (i.e. you have to run it from the command line)? - version

I want to run Selenium Webdriver in a python script, to use Google Chrome. But on the chromedriver downloads page (https://sites.google.com/a/chromium.org/chromedriver/downloads) you have to know your version of Google Chrome.
I do have Google Chrome installed on my AWS instance, but when I try to run it remotely just to find out what version it is, I get a segmentation fault:
From my /usr/bin folder:
[ec2-user#ip-xxx-xx-xx-xxx bin]$ ./google-chrome --version
Segmentation fault
How can you run it remotely from the command line like that (when it is installed remotely), just to find out what version you have?
Or maybe the version is specified somewhere else, so you don't have to run it from the command line?

You can try to identify the version via package manager:
yum list installed|grep chrome
or
dpkg -l|grep chrome
Depending on your operating system.
If this is not possible, get it out of the strings of the binary:
$ strings /opt/google/chrome/chrome | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,4}\.[0-9]{1,4}$'
7.9.317.33
127.0.0.1
79.0.3945.130
0.1.0.0
224.0.0.251
0.46.0.4
8.8.8.8
0.0.0.0
239.255.255.250
127.0.0.1
0.0.0.0
In my case it is version 79.0.3945.130
Problem is to find the binary of the file - on my system it is symlinked to a script. In the same folder where is the script, also the binary resists.

Related

syntax error when running iperf through adb

I am trying to execute iperf through adb shell, however I am getting following error:
syntax error: unexpected 'newline'
here are the steps:
push android compiled iperf binary to /data/local/tmp
enter adb shell, go to /data/local/tmp folder.
chmod +x ./iperf2.0.10
./iperf2.0.10
I tried executing command from outside like: adb shell "command"
I tried few other phones.
I tried few iperf versions.
host machine: tried both mac and windows. on windows version info:
Android Debug Bridge version 1.0.41
Version 31.0.3-7562133
phone info: adb shell getprop ro.product.cpu.abilist
arm64-v8a,armeabi-v7a,armeabi
I made sure to pick relevant iperf binary form: https://github.com/KnightWhoSayNi/android-iperf
This is a galaxy S7 SM-G930U, android version 8.0.0, kernel version 3.18.71-14970140
I looked at the iperf source code and could not find any place which would print this error message, so seems like some issue with how adb is treating my command.
Please suggest what can I do now ?
Edit: updated some details

How to solve this adb server version doesn't match this client error in android?

adb server version (39) doesn't match this client (40); killing...
could not read ok from ADB Server
* failed to start daemon
error: cannot connect to daemon
adb: error: failed to get feature set: protocol fault (couldn't read status): Connection reset by peer
* daemon not running; starting now at tcp:5037
* daemon started successfully
- waiting for device -
error: protocol fault (couldn't read status): Connection reset by peer
I have the same issue when running adb devices command.
adb devices
List of devices attached
adb server version (36) doesn't match this client (40); killing...
* daemon started successfully
2322dc3d device
I ran command which adbwhich gave me the location of the adb that the previous command was using, in my case output was:
which adb
/usr/bin/adb
Then i ran whereis adb command which gave me the location of adb's:
whereis adb
adb: /usr/bin/adb /home/arefin/Android/Sdk/platform-tools/adb
/usr/share/man/man1/adb.1.gz
I get rid of this problem by moving the adb from /usr/bin directory with mv command: (meaning this is of no use thus instead of deleting just put in desktop),
/usr/bin$ `sudo mv adb /home/arefin/Desktop/`
After this i executed this command adb kill-server then ran adb devices. I found everything is fine this time.
My Android development related path in in $HOME/.profile file is, as below:
export ANDROID_HOME=/home/arefin/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$JAVA_HOME/bin
When encountered this error in Linux,I deleted the adb file in my
/usr/bin/
and replaced with one which located in path (usually in home path)
~/Android/Sdk/platform-tools/
and it worked.
As pointed out in previous answers, this is due to having multiple adb versions installed in your system. Probably one from the android-sdk-platform-tools installed via apt and other from Android Sdk itself (which is usually newer version).
The simplest way to solve this in Ubuntu (or Ubuntu-based OS's) is to add this line at the end of ~/.bashrc file:
alias adb='~/Android/Sdk/platform-tools/adb'
#Change path according to your Android Sdk installation directory
And then reopen terminal for changes to reflect.
This avoids the need to mess with system files as well.
Probably you have two versions of adb in two different locations in your system. The running server version is 39 and the adb client version is 40. You can resolve this by keeping only one adb in your PC.
You can figure it out as shown below-
In Linux below command gives you adb location if adb binary is added to path.
which adb
if adb is not added to path and still you are getting this error then search for adb using below command.
locate adb
if your adb client is other than above location, you may add newest version to above path and delete the old adb version.
If you are using windows, you figure it out the two adb locations and keep only at single place.
I know this is a little old, but if you have this problem and you have Vysor installed, then you can resolve it by looking in the Vysor application folder for the adb.exe (and Adb*.dll files) and replacing them from your Android SDK folder. I'm on a Windows machine and the relevant paths for me were:
Vysor
C:\Users\\AppData\Roaming\Vysor\crx\gidgenkbbabolejbgbpnhbimgjbffefm\app-2.1.7.crx-unpacked\native\win32*
(I'm guessing the path will vary according to the version, etc, but this will hopefully help figure it out.)
APK
C:\Users\\AppData\Local\Android\Sdk\platform-tools
On my machine, the relevant files were:
adb.exe,
AdbWinApi.dll,
AdbWinUsbApi.dll
After this, you will need to kill the existing ADB task as described in the other answers to this post.
Solved by
Open terminal in Android studio
adb kill-server
sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin/adb
sudo chmod +x /usr/bin/adb
adb start-server
Run
tasklist | findstr adb
then kill the duplicate process
TASKKILL /PID "PID_NUMBER" /f
Encountered this problem myself, none of the solutions online worked for me.
did this by chance and it solved my problem!
I'm using Android Studio on a Macbook Pro.
first I tried to install adb from brew:
brew cask install android-platform-tools
then I uninstalled it:
brew cask uninstall android-platform-tools
After the last line adb didn't work in terminal but did work in Android Studio immediately! =D
posted so it may help someone else - good luck!
For ubuntu (more precise - kubuntu) i had the similar problem.
The problem was in android-studio, to fix it you need to do these steps:
Go to SDK-Manager
In SDK-Manager click the SDK Tools menu.
Uncheck "Android SDK Command-line Tools (latest)"
I had the same issue connecting to my SFTP Server app and could solve it as follows:
The error was caused (in my case, Ubuntu 18.04.5 LTS) by conflicting adb installations. One Installation coming with AndroidStudio (IntelliJ) located in .../Sdk/platform-tools and one coming with the package manager installation apt install located in the standard directory for executables /usr/bin. The installation location for AndroidStudio (IntelliJ) can be found in the AndroidStudio (IntelliJ) Menu: Tools → Android → SDK Manager: Android SDK Location. And the installation location related to the package manager can be found invoking the command which adb.
And the solution to this problem is to uninstall one of them.
Depending on your use case, if you’re most of the time working with AndroidStudio (IntelliJ) (and this version is up to date), then remove the (outdated) version installed with the package manager as follows.
To uninstall first find out which packages relates to /usr/bin/adb with the following command: dpkg -S /usr/bin/adb.
And then call apt autoremove adb to uninstall the adb package and all its dependencies.
And last but not least in order to still being able to call adb from the command line update the PATH variable in “/etc/profile”, if it should be accessible for all users, or ~/.bash_profile or ~/.profile (whichever exists) if it should only be accessible for the current user and append the path “.../Sdk/platform-tools” (that you looked up above) at the end. And then reboot or log-out & log-in for the new path to get applied.
In ubuntu
delete the adb
-> usr/bin
-> (delete command) sudo rm -rf /usr/bin/adb
Android/Sdk/platform-tools/adb
-> copy this folderpath.
paste into
->usr/bin
->(paste command) sudo ln -s /home/yourfile/Android/Sdk/platform-tools/adb /usr/bin
restarting your system, would also work for you.
I have faced the following error and what worked in my case was just to restart the system.
could not read ok from ADB Server
* failed to start daemon
error: cannot connect to daemon code here
adb.exe: failed to check server version: cannot connect to daemon
I had a similar error. Two different adb versions were conflicting with each other which caused it to keep restarting.
Run this command in terminal => where adb.exe
This will show you where the different adb files are. You can look at the file property date to see which is the latest one. Then copy the latest one and use it to overwrite/replace the older one(s). This will make both adb versions be the same and prevent a conflict.
This generally happens when there are two adb paths are available. Uninstall one will help
--> npm uninstall adb
This worked in my case.
None of the other solutions worked for me - Windows/WSL2-Ubuntu
The error is misleading but for me it was cos the adb port 5037 was in use.
Solution: find and kill the process using port 5037
Windows: netstat -aon | findstr 5037 and Stop-Process -Id <id-from-netstat>
WSL will attempt to connect to Windows port 5037
In my case wsl Ubuntu has different adb --version than Windows, I don't have to keep my Android Studio latest(since this might not your choice and do not guarantee same version as apt) or try with $PATH(wsl run Windows exe is not make sense).
The solution is simple, I download both Linux and Windows SDK Platform-Tools from official site which guarantee same version, then invoke relevant adb on each platform.
In my case I'd installed "AirDroid" on my windows machine and it runs "AirDroid_adb.exe", I had to kill that to get things to work. I have reported that they are using an old version of adb and they will hopefully fix it.
A Working Simple Answer for Windows:
make sure you have the sideload file (whatever.bin) in a sub directory of your adb executable.
make sure your adb executable folder, and sub directories are in PATH (look up DOS commands for PATH in Windows)
open a command prompt in the same directory as the sideload file
enter your command for example:
adb sideload mynewrom-5.4.3.2.1.bin
(Your device needs to be in recovery - sideload state before you send)

Using appengine with arch and zsh unable to find goapp

I am new to appengine and have installed google-cloud-sdk from the AUR(arch user repository) and and the google-appengine-go extention at /opt/google-cloud-sdk
thanks to this I am able to run a dev server using
dev_appserver.py app.yaml
But when using goapp serve I found
goapp: command not found
After adding /opt/google-cloud-sdk/platform/google_appengine:$PATH to my $PATH variable in zshrc and running goapp serve i now get the error.
zsh: permission denied: goapp
if sudo goapp serve
sudo: goapp: command not found
Due to this I am unable to use the updated sdk to run tests using goapp test
Thank you in advance for your help.
I had the same problem and I think I figured out how it usually works.
You download the google cloud sdk (https://cloud.google.com/sdk/downloads)
After downloading and unzipping to the folder where you want to use it you have to executet the ./google-cloud-sdk/install.sh.
Appengine is not part of the download.
It can be chosen with that install.sh script.
it will download items like appengine.
Afterwards you have a folder called
platform/google_appengine
as you mentioned yourself.
You might have to change execution permissions like
chmod 755 platform/google_appengine/go*
Add folder platform/google_appengine to the PATH if not done already.
The command "which" will not show non-executable binaries.
If you did not change permissions it will not show the path, even being within the PATH variable.

Google App Engine PHP SDK - How to install on Ubuntu (15.10)?

Google official documentation is available here:
https://cloud.google.com/appengine/downloads#Google_App_Engine_SDK_for_PHP
But it doesn't provide sufficient information about the following step:
"4 - Build and install the PHP interpreter and App Engine PHP extension. Specify the path to php-cgi and gae_runtime_module.so when running the development server."
I'm using a new Virtualbox machine with Ubuntu 15.10 and PhpStorm to test GAE.
Could someone please provide clear instructions about step 4? What do I need to do to install the php interpreter and the App Engine php extension?
P.s. I've already searched with google but I only found old/confusing tutorials
That GAE PHP extension seems like a quite new thing. Don't remember using it on the SDK in Ubuntu 14.04.
You need to build PHP and that extension from source. You should grab the latest PHP5.5 branch from their source repo (http://php.net/git.php) and build it. That linked page contains instructions on building PHP but the procedure is similar to the following:
$ git clone <php-src>
$ cd ./php-src/
$ git checkout PHP-5.5
$ ./buildconf
$ ./configure --prefix="/opt/php55"
$ sudo make && sudo make install
And remember to pick the modules and packages you want to compile with PHP5.5 to be used in the SDK. I think Google had an official list of modules and extensions they use inside GAE PHP and inside the SDK PHP. The prefix argument tells the compiler where to install the resulting application.
Then you need to get that source for the PHP extension and build it
$ git clone https://github.com/GoogleCloudPlatform/appengine-php-extension
$ cd appengine-php-extension
$ phpize # remember to use the phpize from the just built PHP5.5 binaries
$ ./configure
$ sudo make && sudo make install
(That Git repository contains detailed building instructions so you should probably refer to them when building.)
Enable the resulting .so for the PHP5.5 you just built using the PHP configuration files.
After that you need to install the PHP SDK and configure it to use the newly built PHP binary
$ dev_appserver.py <...> --php_executable_path=/opt/php55/bin/php-cgi
The SDK will let you know if the built PHP binaries are incompatible with the SDK version you use. I remember compiling the PHP from source around 5 times before it worked without any warnings.
But essentially they are telling you to compile PHP from source, then compile their extension from source and then use the built PHP+extension with the downloaded SDK. These instructions are from the top of my head so you may need to adjust the commands and procedures.
The process can be simplified by using Docker, here is an image you can use: https://hub.docker.com/r/mhariri/docker-google-appengine-php/
To run your app, you just need docker installed, and then run the following command in your app directory:
docker run -it -v $(pwd):/app --rm --net=host mhariri/docker-google-appengine-php

xdebug not loading. not found in phpinfo() after apache restart

I've been scouring every resource I could find, but came up empty. I get the dreaded "Waiting for Connection" message in NetBeans 6.9 when I start a debug session. After much reading, most folks are able to get phpinfo() to display that it loaded the xdebug module. Not so with me.
I downloaded the source through SVN using this call
svn co svn://svn.xdebug.org/svn/xdebug/xdebug/trunk xdebug
I switched to the xdebug directory and then ran phpize on the source
sudo /Applications/MAMP/bin/php5/bin/phpize
Password:
grep: /Applications/MAMP/bin/php5/include/php/main/php.h: No such file or directory
grep: /Applications/MAMP/bin/php5/include/php/Zend/zend_modules.h: No such file or directory
grep: /Applications/MAMP/bin/php5/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
A big fat nothing! The referenced directories don't even exist. So, I make the assumption that any .ini tweaking I do beyond this point is useless. If I do a whereis php, I find it in /usr/bin. That's the default php pre-loaded with the OS. I don't want that one. I need to use the php installed with MAMP. I cannot believe how insanely frustrating it is to get this thing working!
For the record, my xdebug section in my php.ini looks like this:
[xdebug]
; xdebug config for Linux and Mac OS X
zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"
xdebug.profiler_enable=1
xdebug.profiler_output_name=xdebug.cachegrind-out.%s.%p
xdebug.remote_log="/Applications/MAMP/logs/xdebug_log.log"
It's a mish-mash of many different attempts to get xdebug to work. So, I don't know which pieces are valid or not.
I throw myself on the mercy of the experts because I obviously am not one of them. I have absolutely no idea how to proceed at this point.
Thanks in advance.
To use phpize in the MAMP directory instead of your system path, you should add MAMP's directory for PHP binaries to your $PATH. Below I'm using MAMP 1.9.1, which offers PHP 5.2 and PHP 5.3. We'll assume you're compiling for PHP 5.3.
Open or create ~/.bash_profile and put the following contents:
#Add MAMP binaries to path
export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5.3/bin:$PATH"
You may also need to chmod the binaries inside /Applications/MAMP/bin/php5.3/bin to be executable:
chmod 755 /Applications/MAMP/bin/php5.3/bin/pear
chmod 755 /Applications/MAMP/bin/php5.3/bin/peardev
chmod 755 /Applications/MAMP/bin/php5.3/bin/pecl
chmod 755 /Applications/MAMP/bin/php5.3/bin/phar
chmod 755 /Applications/MAMP/bin/php5.3/bin/phar.phar
chmod 755 /Applications/MAMP/bin/php5.3/bin/php
chmod 755 /Applications/MAMP/bin/php5.3/bin/php-config
chmod 755 /Applications/MAMP/bin/php5.3/bin/phpcov
chmod 755 /Applications/MAMP/bin/php5.3/bin/phpize
Restart your Terminal session for the new $PATH to be loaded. Run the command which phpize and it should display /Applications/MAMP/bin/php5.3/bin/phpize. If not, the path to phpize in your MAMP directory is not being loaded in your $PATH. Use echo $PATH in Terminal to make sure /Applications/MAMP/bin/php5.3/bin is in the $PATH.
To get xDebug to compile, you need the header files from when PHP was compiled. These are available on the MAMP website in a DMG, and called "MAMP Components": http://www.mamp.info/en/downloads/index.html
Unpack MAMP Components and copy MAMP_src to your Desktop. Unpack MAMP_src/php-5.3.2.tar.gz and move it into the include path present in php-config --includes which should include /Applications/MAMP/bin/php5.3/include/php.
cd ~/Desktop/MAMP_src
tar -xvzf php-5.3.2.tar.gz
mkdir -p /Applications/MAMP/bin/php5.3/include
mv php-5.3.2/ /Applications/MAMP/bin/php5.3/include/php
You can now run phpize in the xDebug source dir.
I had a similar problem with XAMPP on Mac OSX 10.6.
I got no version Numbers when running phpize in the xdebug download directory.
PHP Api Version:
Zend Module Api No:
Zend Extension Api No
I had to install the 'Development Package' which adds /Applications/XAMPP/xamppfiles/include and other files to your XAMPP install. Installing the Development Package also fixed pecl so I tried using pecl to install xdebug.
pecl install xdebug
but apache failed to start with error
Failed loading /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/xdebug.so: dlopen(/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/xdebug.so, 9): no suitable image found. Did find:
/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/xdebug.so: mach-o, but wrong architecture
I tried compiling from source and got the same 'wrong architecture' errors
Finally I just used the KomodoIDE binary from active state which worked.
I just started working with xdebug myself due to problems with PHP 5.3.1. I had used PECL per instructions a couple weeks ago but it looks like phpize is the new black. I looked over the new instructions (generated from my phpinfo()) # http://xdebug.org/find-binary.php
this is of note:
Run: phpize
As part of its output it should show:
Configuring for:
PHP Api Version: 20090626
...
Zend Extension Api No: 220090626
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.
2 things:
have you checked that phpize is up to date?
if that doesnt work try these instructions: http://xdebug.org/docs/install

Resources