Calabash-Android on WIndows 8 issues - calabash

We need a quick help. We were trying to automate our Andriod mobile app using calabash. We have grown through all your related tutorials but can't succed in real scenario.
We did following for our app:
Installed Ruby, Android SDK, JDK, Calabash on Windows 8.
jdk - jdk-7u51-windows-x64
RUBY - rubyinstaller-1.9.3-p545
sdk - fOR 64 BIT
Set Environment variables:
ANDROID_HOME - C:\Users\Dinesh\Desktop\Calabash\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk
JAVA_HOME - C:\Program Files\Java\jdk1.7.0_51
Connected Samsung S3 Andriod device to USB (USB Debugging = Checked)
Open eclipse and run Emulator
I can see my connected device by running ADB DEVICES command.
ISSUES:
A. Though we have JDK installed, we always get "JAVA DEVELOPMENT KIT Could not" error message while resigning apk file. How to get rid of this message?
B. Real android device (connected to the USB) is not showing up in the emulator and also in the Android Virtual Device Manager list?

HOW TO INSTALL CALABASH FOR ANDROID IN WINDOWS
Steps to follow:
Download Ruby.exe with version less than 2.0 (In this tutorial I am going to use rubyinstaller-1.9.3-p545.exe)
Download Ruby Development Kit (For use with Ruby 1.8.7 and 1.9.3)
Create a folder called DevKit in C:\DevKit
Extract Ruby Development Kit (DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe) to C:\DevKit
Open command.exe or cmd.exe and type ruby -v to check ruby version(ruby 1.9.3p545 (2014-02-24) [i386-mingw32])
Now type: cd C:\DevKit and press enter
Then type: ruby dk.rb init
Then type: ruby dk.rb install
Then change to Ruby193 directory by typing: cd C:\Ruby193 on cmd
Type: gem install calabash-android
Type: gem install calabash-cucumber
check by typing: calabash-android version
In order to test you *.apk file in calabash you need to re-sign it
So to make it work you can use two options
Option 1:
Type: calabash-android resign *.apk and press enter
Type: calabash-android build *.apk and press enter
or
Option 2:
Use a .jar file called re-sign.jar
Then create a folder called sample in your desktop and place *_debug.apk. Open cmd then change directory where the *_debug.apk file is found and type: calabash-android gen , to generate the feature files and other associated resources.
Last you need to type: calabash-android run *_debug.apk to run the application
Note: To run the application you can use emulator, android device, android screen cast or any related software or devices that allows you to view the process.

Related

Unable to run Dart2 w/ Angular for web along side Flutter for mobile project - plan to share code

I have made good progress with Flutter on mobile apps. Currently using:
[✓] Flutter (Channel master, v0.3.1-pre.13, on Mac OS X 10.13.4 17E199, locale en-US)
• Flutter version 0.3.1-pre.13 at /Users/golftocs/PhpstormProjects/flutter
• Framework revision 85be28d36b (32 hours ago), 2018-04-16 14:02:07 -0700
• Engine revision 76cb311d9c
• Dart version 2.0.0-dev.47.0.flutter-f76dad0adc
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.1)
• Android SDK at /Users/golftocs/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.1
• ANDROID_HOME = /Users/golftocs/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.3, Build version 9E145
• ios-deploy 1.9.2
• CocoaPods version 1.5.0
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 23.1.2
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[!] Connected devices
! No devices available
Now I want to begin a project that uses this Flutter set-up for mobile and share code with a Dart2/Angular web app. I am unable to get a web app working successfully. I've cloned https://github.com/angular-examples/toh-5 and based on running 'pub get' this is returned:
Overriding the upper bound Dart SDK constraint to <=2.0.0-
edge.0d5cf900b021bf5c9fa593ffa12b15bcd1cc5fe0 for the following packages:
archive, args, barback, bazel_worker, boolean_selector, build_barback,
build_config, build_modules, charcode, cli_util, code_transformers,
convert, crypto, csslib, dart_style, fixnum, front_end, glob, graphs,
html, http, http_multi_server, http_parser, intl, io, isolate, js,
json_annotation, kernel, logging, matcher, meta, multi_server_socket,
node_preamble, package_config, package_resolver, path, plugin, pool,
protobuf, pub_semver, quiver, quiver_hashcode, shelf,
shelf_packages_handler, shelf_static, shelf_web_socket,
source_map_stack_trace, source_maps, source_span, stack_trace,
stream_channel, string_scanner, term_glyph, test, tuple, typed_data, yaml
Then, when I run 'pub run build_runner serve' from my terminal I get:
[INFO] Generating build script completed, took 446ms
[INFO] Setting up file watchers completed, took 25ms
[INFO] Waiting for all file watchers to be ready completed, took 199ms
[INFO] Building new asset graph completed, took 921ms
[INFO] Checking for unexpected pre-existing outputs. completed, took 2ms
[SEVERE] build_web_compilers|ddc on package:angular_router/src/url.module:
ProcessException: No such file or directory
Command: /Users/golftocs/PhpstormProjects/flutter/bin/cache/dart-sdk/bin/dartdevc --persistent_worker
[WARNING] build_web_compilers|entrypoint on web/main.dart:
Unable to read angular_router|lib/src/url.ddc.js, check your console or the `.dart_tool/build/generated/angular_router/lib/src/url.ddc.js.errors` log file.
[SEVERE] build_web_compilers|ddc on package:angular_router/src/location/platform_location.module:
ProcessException: No such file or directory
Command: /Users/golftocs/PhpstormProjects/flutter/bin/cache/dart-sdk/bin/dartdevc --persistent_worker
[WARNING] build_web_compilers|entrypoint on web/main.dart:
Unable to read angular_router|lib/src/location/platform_location.ddc.js, check your console or the `.dart_tool/build/generated/angular_router/lib/src/location/platform_location.ddc.js.errors` log file.
...
Additionally, I am using WebStorm, actually PHPStorm, and the Pub actions links to 'Get Dependencies, Upgrade...' do not work. I can only execute from terminal.
My desire is to get to:
1) share code between mobile & web similar to https://github.com/apptreesoftware/letsvote/blob/master/README.md
2) run latest Dart2 with Angular5.0.0-alpha and current Flutter master channel
3) WebStorm IDE work seamlessly with either from a combined project
Thanks.
shared_code
|- flutter_project
|- angular_project
where both flutter_project and angular_project have shared-code as a dependency in pubspec.yaml
dependencies:
shared_code:
path: ../shared_code
assuming a directory structure like
my_project/shared_code
my_project/flutter_project
my_project/angular_project
The code in shared_code must not depend in any way on dart:io or flutter:ui otherwise it won't work with either flutter_project or angular_project
If you want to open all 3 at the same time in IntelliJ in the same window, adding them all as module to a single project worked for me.
When I work on the Angular project I need to switch the Dart SDK in the Dart plugin to the Dart SDK, when I work on the Flutter project to the Flutter Dart SDK, otherwise running the app and tests doesn't work.
You can also open each project in its own IntelliJ window which keeps the setting for each window individually and doesn't need to switch depending on what code you're currently working.

Cordova can't create app package for windows Store

I'm creating an app with cordova and I need to release it on the windows store (is already in the App store and in the process to be released on the play store so the app itself is working) so I've cloned my cordova app on a windows machine downloaded the Microsoft Visual Studio 2017 community edition and created a new project from existing code selecting apache cordova in the wizard.
And I can run the app on emulator and a real device but when I try to "Project" -> "Store" -> "Create App Packages..." I always fail the verification but the strange thing is that it looks that all the test are passed but at the end I got an error suggesting to check in the folder: "C:\Users[$user]\AppData\Local\Microsoft\AppCertKit" for the log but the AppcertKit folder dosen't even exist and even if I create a new one is always empty.
If I try to upload the .appxupload file created in "\platforms\windows\AppPackages" I get always two errors about:
Invalid package family name
Invalid package publisher name: CN=Apache Cordova Team (expected
even if I select the remote app in the wizard for the creation of the packages.
I'm using:
Visual Studio 2017 15.2
Cordova (6.3.1 / 6.5 / 7.0.1) I've tried all of them.
Windows 10 Pro
If I try to upload the .appxupload file created in
"\platforms\windows\AppPackages" I get always two errors about:
Invalid package family name Invalid package publisher name: CN=Apache
Cordova Team (expected even if I select the remote app in the wizard
for the creation of the packages.
According to the submission error, the identity info of your package cannot be recognized by Dev Center.
To upload your package, you need to associate your project with the app name you reserved in Dev Center to match the identity info:
For more details, you can refer to Package your Windows version Cordova app.

Running Sencha Touch app on Java Eclipse & Android Emulator on Windows 8 (without phonegap)

I am getting trouble in running sencha touch 2 app on android emulator (without using cordova/phonegap) on windows 8 using .
Below is the list of packages installed on DEV machine:
1. JRE v1.7
2. Sencha Touch v2.4.1 SDK
3. Sencha SDK Tools 2.0.0 beta
4. Sencha Cmd 5.1.2
5. Ruby 2.0.0
6. Chrome (Browser)
7. Web Server - Both IIS 8 & XAMPP
8. Android SDK 23.0.6
9. Eclipse IDE (integrated with VJET Library & ExtJSTL 4.2)
10. Android ADT Manager (installed emulator snapshots targeting os2.2 & 5.1)
"MyApp" project runs perfectly on chrome browser when hosted on IIS 8 & XAMPP (apache). But not able to figure out steps to run the same on android emulator. So far followed below mentioned steps, leading to unsuccessful attempts:
sencha app build native [Command Successful]
sencha app build -run native [Command Successful]
sencha app build package [Command Successful]
Started emulator instance from eclipse (avd) and executed command sencha app build -run native, but the app doesn't execute on emulator instance.
Followed steps mentioned in post (http://www.sencha.com/forum/showthread.php?215210-how-to-run-sencha-touch-app-on-android-emulator-on-windows) but still facing issues.
Please help!!
do u want to run it as website for mobile?
as u are saying, you don't want to use cordoav/phonegap.
If u just want to run on Mobile Browser U can use Netbeans. It has a very simple feature to allow a html5 application to be run on Mobile browser
all U have to do is
1. Create HTML5 Project in netbeans
2. Run command "sencha app build native"
3. copy all files & folders form directory cordova->www which exist in your sencha app directory
4. Paste it into your HTML5 Project directory
5. Choose The Browser option in netbeans and run
Thanks Nitish for your suggestions. But this is not what my query was all about. I was trying to figure out a way of running sencha touch app on emulator without compiling it to native app following steps mentioned in post: http://www.sencha.com/forum/showthread.php?215210-how-to-run-sencha-touch-app-on-android-emulator-on-windows.
Anyways, to run sencha touch app on emulator I had to create native android app using cordova/phonegap wrapper. To run sencha touch app (which is mobile web portal equivalent), it is required to be wrapped inside native app (android, ios, etc) followed by app signing and APK / IPA file generation.

How to build and install the latest nightly Firefox OS on Alcatel One Touch Fire?

I want to upgrade Firefox OS 1.1 on my Alcatel One Touch Fire to the master branch (the latest revision). After having read the Mozilla Wiki, I cloned the B2G repository, built it for the hamachi target by typing:
./config.sh hamachi && ./build.sh
(There are even prebuilt images)
Now is the hardest part, since Alcatel phones are not rooted and seems to have a locked bootloader.
The docs say that I should flash the device by typing:
./flash.sh
But all I get are these errors:
adbd cannot run as root in production builds
remount failed: Operation not permitted
push: /home/user/B2G/objdir-gecko/dist/b2g/dictionaries/en-US.aff -> /system/b2g/dictionaries/en-US.aff
failed to copy '/home/user/B2G/objdir-gecko/dist/b2g/dictionaries/en-US.aff' to '/system/b2g/dictionaries/en-US.aff': Read-only file system
Could anybody write an simple step-by-step tutorial (easier than this) on how to install the latest Firefox OS to a stock Alcatel One Touch Fire?
I guess first we can check if the phone itself is rooted.
You could try,
$ adb shell
And if shows,
root#android:/ #
Then I think the phone is rooted, and you can flash your phone with ./flash.sh.
If it is not rooted, I think the link you mentioned has provided the steps to create a new boot.img so that you could root the phone.
Here is an excerpt from Mozilla guide on flashing phones related to Hamachi (Alcatel One Touch Fire):
Best build for Hamachi: moz-central Use your LDAP to go here: https://pvtbuilds.mozilla.org/pvt/mozilla.org/b2g_ril/latest-hamachi-mozilla-central/
And then run this script command line: fullflash_gecko_ril_gaia.sh You
may need to preface this with ./ but it should just run upon your
hitting enter. DON'T run ./flash.sh. THIS CAN BRICK YOUR HAMACHI :( -
GB
What is my order of operations from the beginning?
FOR ALL DEVICES... AFTER you have installed ADB, Git, and Xcode, you should:
Connect your device to your machine via USB. You're SURE it's plugged in? OK then...
Get your build with your LDAP credentials (from moz-central): Buri: Need from Naoki Hamachi:
https://pvtbuilds.mozilla.org/pvt/mozilla.org/b2g_ril/latest-hamachi-mozilla-central/
Run this script: fullflash_gecko_ril_gaia.sh
Download gaia from github (it's easier than the command line as you avoid a pull request) at: https://github.com/mozilla-b2g/gaia Along
the right hand side there is an option to "Download ZIP." Unpack that
into a folder, open Terminal and "cd" (ask Stephany or Francis if you
need help with this) into the folder (i.e. wherever you unpacked your
zip file). Run "make reset-gaia".
You should see... a whole bunch of stuff scrolling by on the command line and your device should reboot. If your device does NOT
reboot, try ADB reboot.

Cakephp Code Generation with bake

I have just downloaded cakephp latest version 2.3.0 and trying to create skeleton application
using bake command.
Problem is when I execute the command cake bake at /app>cake bake. Following message I am getting:
Welcome to CakePHP v1.3.2 Console
App : app
Path: /var/www/cake-acl/app
Your database configuration was not found. Take a moment to create one.
Database Configuration:
You can see, console is showing Cakephp version 1.3.2, even I have downloaded 2.3.0, thats why console is trying to create 1.3 version scripts for e.g. app/config folder instead app/Config (2.0 convention).
Why this is happening, Am I missing something?
If you were using v1.3.2 before downloading 2.3.0 version then it is possible that you might have set path for v.1.3.2 in your environment settings. So you need to change that to your latest version.