How to install / upgrade Appium 1.6.3 / 1.6.x with Appium Version Manager - automation

Appium 1.4.16 or any 1.4.x version works fine. We used Appium Version Manager (avm) to upgrade to new versions, but with 1.5.x onwards does not seem to be working.
I am currently on Appium 1.4.16 and would want to upgrade to Appium 1.6.3 (current latest). Can we do that?
Note - the reason we need avm is to switch between appium versions, which i feel is good to have. Helps us specially when we are in the process of upgrading our suite to cater the changes in 1.6.x, so that until we finish, we can still use an older (stable) version

Phew... after some searching, testing and playing around, found a way.
When Appium releases a newer version or a beta, I feel its an advantage to keep an older (stable) version and switch between Appium versions. Because in my experience, a newer Appium version could break some existing automation tests, so until we fix them separately, having an older version helps in executing those tests without errors.
Plus switching versions without every time needing to install / uninstall is advantageous while testing out a beta.
AVM was (rather is) a great utility that allows this switching between versions, but somehow it had stopped working after Appium1.5.0.
So here are the steps to use AVM to install Appium after version 1.5.0 and keep switching between as many instances of Appium.
At the moment, Appium1.6.4 is the official release, so I'll highlight the steps with that version.
(Also, I use a Mac but think installing it on Windows should be similar).
Steps to Install Appium with AVM:
Part A) Install AVM --> (first time only to get AVM)
Pre requisite --> install 'brew' and 'node'.
Launch terminal
npm install -g appium-version-manager
brew update
note: if step 2 did not execute, then perform steps 3 and 4.
(optional) sudo chown -R $(whoami):admin /usr/local
(optional) cd $(brew --prefix) && git fetch origin && git reset --hard origin/master
avm --help
If it shows list of commands, then congrats, avm is installed !!!
Now since AVM is not maintained since Appium1.5.0, we need to install a version < 1.5.0. Let us do with 1.4.16
Part B) Install Appium 1.4.16 (or any old version) --> (one time only)
avm 1.4.16
In Finder --> Go to Folder /usr/local/bin/ --> Open filename ‘avm’ in an editor
Search for method 'activate ()' and comment this line
ln -s $dir/node_modules/appium/bin/appium.js $AVM_PREFIX/bin/appium
replace with
ln -s $dir/node_modules/appium/build/lib/main.js $AVM_PREFIX/bin/appium
sample screenshot to edit 'activate ()' method
Similarly, Search for method 'execute_with_version ()' and comment this line
local bin=$VERSIONS_DIR/$version/node_modules/appium/bin/appium.js
replace with
local bin=$VERSIONS_DIR/$version/node_modules/appium/build/lib/main.js
note - i'll post a reference link that mentioned about this change being made to 'avm' file.
brew unlink node
brew install node6-lts (node version - v6.9.4)
and this is our final act !!! :)
Part C) Install Appium version 1.6.x (or any version above 1.5.0)
avm 1.6.x (x = minor version of appium. To install Appium version 1.6.4, in terminal type --> avm 1.6.4)
cd /usr/local/avm/versions/1.6.x/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
npm install -g ios-deploy
if step 3 does not install ios-deply try step 4.
(optional) sudo npm install --global --unsafe-perm=true ios-deploy
brew install carthage
./Scripts/bootstrap.sh
./Scripts/build.sh -d
Launch Xcode. For Appium1.6.4, I used Xcode8.3.1
In Finder, navigate to path in step 2. Open WebDriverAgent Project in Xcode.
Sign profiles. I select the WebDriverAgent project and click on the 'Automatically manage signing'. Then select the team profiles for WebDriverAgentLib and WebDriverAgentRunner.
Build the WebDriverAgent Project and Run. If it Succeeds, then welcome aboard Appium1.6.x via AVM.
More information on singing profiles for WDA in a nice detail manner here --> https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md
note - while executing tests on real devices, if you get an Error 65, means the WebDriverAgent has not been signed properly.
Once installed, for any Future versions of Appium, only Part C is required, no need of Part A and Part B if you've got avm
credit to the creator of Appium-Version-Manager - abhinavsingh. ( couldn't post the link as I do not have a reputation > 10 yet)

Below is the command to install and upgrade specific version of appium.
Installation :
SYNTAX : npm install -g appium#versionNumber
e.g. : npm install -g appium#1.4.16
Upgrade :
SYNTAX : npm update -g appium#versionNumber
e.g. : npm update -g appium#1.4.16

Related

Need help installing the VUE plug in for TestCafe

I am new to the product and have minimal coding knowledge. I need to install the testcafe-vue-selectors plugin but the instructions on the github page are lacking detail. The say Install "$ npm install testcafe-vue-selectors" Where do I run this command?
Thanks and sorry for my lack of knowledge.
I assume that you have already installed TestCafe by running a single command in your terminal (command-prompt):
npm install -g testcafe
To install the plug-in, you need to execute a similar command in your terminal (in your project folder):
npm install testcafe-vue-selectors
No additional steps are required. Just ensure that Node.js and npm are installed on your computer.

"appium &" won't start appium server in mac

I have downloaded all the required tools and able to set up environment variable.
macOS mojave : version 10.14.3
I have install node, appium and wd:
brew install node
npm install -g appium
npm install wd
when i try yo start appium server using appium & I got following error;
[1] 49460
-bash: appium: command not found
[1]+ Exit 127 appium
Updated:
None of app opens which is installed using npm command. The app installed using npm shows command not found error
It was working fine in macOs Mojave 10.14.2
Logs while using npm install -g appium
$npm install -g appium
npm WARN deprecated fsevents#2.0.1: Not Ready For Production
/Users/infotmt/bin/appium -> /Users/infotmt/lib/node_modules/appium/build/lib/main.js
> appium-chromedriver#4.9.0 install /Users/infotmt/lib/node_modules/appium/node_modules/appium-chromedriver
> node install-npm.js
[18:22:48] [Chromedriver Install] Installing Chromedriver version '2.44' for platform 'mac' and architecture '64'
[18:22:48] [Chromedriver Install] Opening temp file to write 'chromedriver_mac64' to...
[18:22:48] [Chromedriver Install] Opened temp file '/var/folders/ng/_2f_j78n1vg4gf8xnxvx9c780000gn/T/2019025-62054-1018qcf.8dtn/chromedriver_mac64.zip'
[18:22:48] [Chromedriver Install] Downloading https://chromedriver.storage.googleapis.com/2.44/chromedriver_mac64.zip...
[18:22:52] [Chromedriver Install] Writing binary content to /var/folders/ng/_2f_j78n1vg4gf8xnxvx9c780000gn/T/2019025-62054-1018qcf.8dtn/chromedriver_mac64.zip...
[18:22:52] [Chromedriver Install] Extracting /var/folders/ng/_2f_j78n1vg4gf8xnxvx9c780000gn/T/2019025-62054-1018qcf.8dtn/chromedriver_mac64.zip to /var/folders/ng/_2f_j78n1vg4gf8xnxvx9c780000gn/T/2019025-62054-1018qcf.8dtn/chromedriver_mac64
[18:22:52] [Chromedriver Install] Creating /Users/infotmt/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac...
[18:22:52] [Chromedriver Install] Copying unzipped binary, reading from /var/folders/ng/_2f_j78n1vg4gf8xnxvx9c780000gn/T/2019025-62054-1018qcf.8dtn/chromedriver_mac64/chromedriver...
[18:22:52] [Chromedriver Install] Writing to /Users/infotmt/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver...
[18:22:52] [Chromedriver Install] /Users/infotmt/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver successfully put in place
> appium-selendroid-driver#1.13.2 install /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver
> node ./bin/install.js
[18:22:54] Java version 1.8.0_202 found
[18:22:55] Ensuring /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download exists
[18:22:55] Downloading Selendroid standalone server version 0.17.0 from https://repo1.maven.org/maven2/io/selendroid/selendroid-standalone/0.17.0/selendroid-standalone-0.17.0-with-dependencies.jar --> /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server-7cf7163ac47f1c46eff95b62f78b58c1dabdec534acc6632da3784739f6e9d82.jar
[18:23:07] Writing binary content to /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server.jar.tmp
[18:23:07] Selendroid standalone server downloaded
[18:23:07] Determining AndroidManifest location
[18:23:07] Determining server apk location
[18:23:07] Extracting manifest and apk to /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download
[18:23:07] Copying manifest and apk to /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid
[18:23:07] Cleaning up temp files
[18:23:07] Fixing AndroidManifest icon bug
> appium-windows-driver#1.5.1 install /Users/infotmt/lib/node_modules/appium/node_modules/appium-windows-driver
> node install-npm.js
Not installing WinAppDriver since did not detect a Windows system
> fsevents#2.0.1 install /Users/infotmt/lib/node_modules/appium/node_modules/fsevents
> [ -f fsevents.node ] || npm run prepare
> heapdump#0.3.12 install /Users/infotmt/lib/node_modules/appium/node_modules/heapdump
> node-gyp rebuild
CXX(target) Release/obj.target/addon/src/heapdump.o
In file included from ../src/heapdump.cc:17:
../../nan/nan.h:1064:44: warning: 'ToString' is deprecated: Use maybe version
[-Wdeprecated-declarations]
v8::Local<v8::String> string = from->ToString(v8::Isolate::GetCurrent());
^
/Users/infotmt/.node-gyp/11.7.0/include/node/v8.h:2537:3: note: 'ToString' has
been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version",
^
/Users/infotmt/.node-gyp/11.7.0/include/node/v8config.h:326:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
1 warning generated.
SOLINK_MODULE(target) Release/addon.node
+ appium#1.10.1
added 493 packages from 406 contributors and updated 2 packages in 34.024s
My advice is as follows:
1. Do not use Homebrew to install Node.js.
The best way to do this is to use the nvm version manager. I had many conflicts with Node.js on MacOS, but nvm is a bulletproof solution.
https://yoember.com/nodejs/the-best-way-to-install-node-js/
2. It is also highly recommended to use version managers for
Ruby https://github.com/rbenv/rbenv
Python https://github.com/pyenv/pyenv
Java http://www.jenv.be/
Version managers take over Node/Ruby/Python/Java management from the system and allow you to install parallel versions and keep consistency of modules/packages/gems etc.
3. Then install the following packages:
npm install -g appium
npm install -g appium-doctor
After that you can check the list of all Appium dependencies:
appium-doctor --ios
appium-doctor --android
Follow the instructions and complete the list.
4. Never install modules/packages/gems... with sudo.
The problem is that i installed the node/npm in very old version of mac. Then i upgraded the mac version to mojave.
I solve the issue by factory resetting the mac and then updating it to latest version. After that i install node/npm and then appium. It works fine now.
Are you able to start appium server using desktop client?
https://github.com/appium/appium-desktop/releases/tag/v1.10.0
Also did you refer this https://github.com/appium/appium/issues/6738?
Check your $PATH environment variable for existence of /Users/infotmt/bin.
Try installing the desktop version from releases: https://github.com/appium/appium-desktop
Did you try to install appium-doctor?
Try running npm install -g appium-doctor as kubano tolds you. I'm currently using it in mojave, so feel free to ask me anything
try installing appium using brew brew install appium it will install the appium server on local under user
Thanks!

cant install detox-cli

-After installing detox-cli globally, I am trying to run detox -h and I got
detox is not installed in this directory.
Unfurtantlly I don't know what to do from here ):
I have been checked and detox-cli was installd.
thank you
You need to run the detox cli in a directory where detox is installed, so in the project you are planning on using detox in. Otherwise it won't do anything, not even show you a help page.
Please check if you are using the right version of node.
If you have more than one version of node installed, you can deduct the the version from the output when you install detox-cli (e.g. /Users/username/.nvm/versions/node/v10.17.0/bin/detox which is visible when executing npm i detox --save-dev) and compare it with the version of node that you are currently using (node -v).
You can change to a specific installed version (e.g. 10.17.0) with nvm use 10.17.0.

Apache Cordova VS Community 2015 - Run Dependency Checker Fails

Apache Cordova Dependency Checker fails in VS Community 2015. It was previously working on this computer until I ran several VS and 3rd party tools updates. Here's what I've done to try to resolve the issue:
Installed VS / Apache Cordova (no error messages displayed) following article https://taco.visualstudio.com/en-us/docs/install-vs-tools-apache-cordova/
Run Apache Cordova Dependency Checker but VS freezes with the error message - VS 2015 has stopped working, windows will try to restart the program.
I restarted VS and cleared Cordova cache, checked environment variables (all good), then tried Apache Cordova Dependency Checker with the same freeze result.
I tried to update Apache Cordova with the fix option (no error messages) but received the same freeze results.
I completely uninstalled Apache Cordova, 3rd party tools (following article https://support.microsoft.com/en-us/kb/3016536), and VS community and then reinstalled them (no error messages) but received the same freeze results.
I installed Apache Cordova on another computer and the dependency checker phonegap app... worked. Unfortunately that's not a computer that I have access to.
What else can I do to resolve the Apache Cordova installation issue?
Thanks for any help,
Mike
Since my original post, I've had to resolve Visual Studio, Ionic, Cordova, Phonegap, plugin... environment issue several times. I've found the below works best:
Ensure platform matches plugin requirements, see platform in config.xml e.g. 6.1.1
Uninstall, reinstall latest jdk (adobe)
Clear MEF Cache - download the tool and follow instructions
Download/install latest node.js
Run the following from the command line:
Clear cache: Npm cache clean
Install latest npm: npm install -g npm
Uninstall cordova: Npm uninstall -g cordova
Reinstall cordova: Npm install –g cordova (note, this took 5+ tries to complete without errors. No other changes were made between runs. Not sure
why. Found others complaining about the same issue.)
Remove Android platform: Cordova platform remove android
Install Cordova platform add android#6.X.X (Note, as of 4/20/17 cordova and android compatibility issue. Build error - unable to find installed version of gradle. resolved by running (npm install -g cordova#6.4.0) and (cordova platform add android#6.1.2). Addt'l build errors, resolved by updating components in Android SDK Manager)
Uninstall/Reinstall plugins from the command line. For example:
cordova plugin remove phonegap-plugin-push
cordova plugin add phonegap-plugin-push variable SENDER_ID="YourID#"
npm install bower -g
Restart Visual Studio - Verify plugins were installed via config.xml
Install Ionic:
npm uninstall -g ionic
npm install -g ionic (note: to install specific version, npm install -g ionic#2.2.3)
$ ionic platform add ios
$ ionic platform add android (note: redundant, already added above)
I recommend putting as much of this as possible in a batch file with a pause between commands. Verify each command was successful, if not press ctrl+break at the pause to term the batch file early. The batch file is an easy way to restore your environment when everything breaks again. Stuff happens!
I also started using a VM (oracle virtualbox) for my development environment. That way I can backup my environment before making changes and easily restore. Don't forget to upload to GIT on a daily basis. GIT and VMs are my lifesavers.
Cool NPM commands:
npm list (lists all installed packages)
npm prune (removes packages not depended on by your project according to your package.json)
npm outdated (tells you which installed packages are outdated with respect to what is current in the npm registry but allowable by the version definition in your package.json. Make sure all up-to-date)
Please feel free to add/make suggestions to the above list.
-Mike

no info and debug messages in Titanium console after updating Xcode

I'm using simple Ti.API.log() calls in several apps, and they worked fine - until I did the most recent XCode update. Since then, the Titanium console messages end with "focusing app simlatur" when I start an iOS App in the simulator, otherwise, no messages from my Ti.API.log() calls are displayed.
Run configuration -> log level is set to "info". Does anyone else have such problem or a solution?
It was a bug with the new version of the iOS simulator. See the issue tracker thread:
https://jira.appcelerator.org/browse/TIMOB-15569
Scrolling down in that thread will show the current workaround reproduced below. This will download and install the newest bleeding edge version of the sdk that contains the fix. They estimate that it will be merged into an official release by mid december. If you are working in titanium studio, you might have to update to the newest version of that as well. I had this issue last week and fixed it by performing the below command and updating titanium studio. (titanium studio can be updated through help->install software and then adding the site for the beta release [see - http://preview.appcelerator.com/studio/ ])
My new working setup is:
Studio version: 3.1.5.201311130103
CLI version 3.2.0
Titanium SDK version 3.2.0.v20131114123518
sudo npm install -g git://github.com/appcelerator/titanium.git
ti sdk install -b master -d
To get back to stable:
sudo npm install -g titanium#3.1.2
ti sdk select 3.1.3.GA
This is a known issue at the moment with 3.1.2.GA CLI. It has been fixed in the upcoming 3.2 CLI. Just hang in there while the AppC team works on this.
For the time being, you can uninstall the current cli via npm like so
npm remove titanium
Then install the "latest and greatest" version from github like so
npm install -g [sudo] npm install -g git://github.com/appcelerator/titanium.git
You can refer to the setup options here: https://github.com/appcelerator/titanium