iOS Simulator doesn't launch with Calabash - calabash

I have Calabash installed as a pod in my project. The gem itself is installed using bundler. When I try to run cucumber for my Calabash target, the first features starts but just hangs and the simulator never launches:
$ bundle exec cucumber
Feature: Ensure Login and Oauth Screen Functionality
Scenario: Verify Welcome Page # features/Sign_in.feature:3
More details from my install:
# xcode installation location
$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
# xcode version
$ xcodebuild -version
Xcode 5.1.1
Build version 5B1008
# calabash version
$ bundle exec calabash-ios version
0.9.168
# calabash < 0.9.169 or Xamarin IDE users
# start your app manually in the simulator or from Xcode and then launch a console
$ bundle exec calabash-ios console
> server_version
{
"outcome" => "SUCCESS",
"app_id" => "[REDACTED]",
"simulator_device" => "iPhone",
"version" => "0.9.168",
"app_name" => "[REDACTED]",
"iphone_app_emulated_on_ipad" => false,
"4inch" => true,
"git" => {
"remote_origin" => "git#github.com:jmoody/calabash-ios-server.git",
"branch" => "master",
"revision" => "adde106"
},
"app_version" => "2.0.1",
"iOS_version" => "7.1",
"system" => "x86_64",
"simulator" => "iPhone Simulator 463.9.41, iPhone OS 7.1 (iPhone Retina (4-inch)/11D167)"
}

Ok,that means calabash cannot locate the your app.
Try this first,
Comment out the APP_BUNDLE_PATH definition on
YourProject/features/support/01_launch.rb like #APP_BUNDLE_PATH =
"~/..../../myApp-cal.app" so The calabash gem can locate the app
automatically.
Open a console go to the project folder from it. Then enter gem install calabash-cucumber this will install the calabash gem its ok to run again even if you installed it previously there's no harm. Then enter calabash-ios setup in that terminal, this will create a calabash target and add the calabash framework to your iOS project. more details about the setup process is mentioned in here.
Now open the project file in xcode editor (You can see the calabash.framework added to your project's framework group successfully.) select the yourApp-cal target and the simulator you want clean, build and run the yourApp-cal target on your simulator.
Then stop it and come back to that console enter calabash-ios console console will start a ruby console that you can work with the app. now (while simulator is on your screen but your app is backbround on that simulator) type start_test_server_in_background your app must come to foreground. If that works the calabash can find and run your app on simulator.
Remember only if you create an app build on a separate folder using a xcodebuild command or script or something, thats the time to set the APP_BUNDLE_PATH variable.

Chathura's answer worked for one of my colleagues, but a couple of us had to find another solution.
The issue for us occurred after introducing CocoaPods. In Xcode, I opened Organizer and noticed we had a derived data folder for the BP (before Pods) project and another for the workspace with Pods. I deleted the derived data folder for the BP project and then everything worked.
I had re-setup calabash before doing this, so the solution in my case may have been a combination of Chathura's answer and mine.

Related

Degugging a react native / expo app with webstorm

I can't debug my react native / expo app in WebStorm, but I can in Visual Studio Code.
I have a react native app that I can successfully run using expo. I set up the configuration according to the info on this site:
https://blog.jetbrains.com/webstorm/2018/02/webstorm-2018-1-eap-181-3263/#debugging-expo
When I click "run" or "debug" and "Debug JS Remotely" is turned off, the bundler builds a JS bundle and the app starts on my devices.
But once I turn on "Debug JS Remotely", the bundler only says:
Starting custom debugger by executing: : [my working directory] [my working directory again]
and never goes on to build the JS bundle.
After a short while, a red screen appears on the device, and it says:
Unable to connect with remote debugger
Timeout while connecting to remote debugger
onFailure
DevSupportManagerImpl.java:851
onFailure
WebsocketJavaScriptExecutor.java:83
run
WebsocketJavaScriptExecutor.java:142
handleCallback
Handler.java:790
dispatchMessage
Handler.java:99
...
The bundler doesn't say anything more than the message above.
As soon as I turn off remote debugging, the the bundler starts building again and finishes with
"Building JavaScript bundle: finished in ...ms"
as usual, but the device, again, shows the red screen with aforementioned messages, or doesn't show anything but the regular white screen with a message at the bottom saying "Downlading JavaScript bundle 100,00%". I either have to stop and restart within WebStorm or I have to close the expo app and re-open it. Either way will make the app start again on my device.
This is my first time working with javascript, react native, expo, so I am not sure, but it should be possible to debug in WebStorm directly, right? As mentioned, in Visual Studio Code everything including debugging works fine, so I don't think it's anything in the code. Maybe someone here has an idea where the problem lies?
node -v: v11.6.0
react-native -v: react-native-cli: 2.0.1, react-native: 0.57.1
Any help will be greatly appreciated! Thanks in advance!
PROOF
HOWTO
Looks like there's been an update to how you can setup Configurations since you tried.
Try changing the Bundler host to 127.0.0.1 and try again.
I just setup Webstorm v2020.2 yesterday to debug my Expo application and it is working as expected.
These instructions were all that I required: https://www.jetbrains.com/help/webstorm/react-native.html#ws_react_native_create_run_config
On the main menu, go to Run | Edit Configurations, click icons.general.add.svg and select React Native from the list. The Run/Debug Configuration: React Native opens.
Choose whether you want WebStorm to build and launch the application for you:
Select the Build and launch checkbox if you are launching your application for the first time or if you have updated its native code since the last run.
If your application uses Expo, clear the checkbox because this bundler takes care of the process itself.
If you selected the Build and launch checkbox, choose the target platform, Android or iOS. Depending on your choice, WebStorm will run the bundler with react-native run-ios or with react-native run-android.
Optionally, type the arguments to be passed to React Native, for example, specify the simulator type through the ‑‑simulator flag: ‑‑simulator="iPhone 4s".
In the Bundler host field, specify the host where the React Native bundler runs, the default value is localhost.
If you are using Expo, change the default bundler host to ensure successful connection with the debugger. This connection may fail because WebStorm by default uses localhost to start debugging while Expo expects 127.0.0.1 or an external IP address depending on what is selected in Connection field of the Metro bundler configuration. See Debugging a React Native application that uses Expo for details.
In the Bundler port field, specify the port on which the React Native bundler runs, by default 8081 is chosen, learn more from the React Native official website.
Choose the Node.js interpreter to use. This can be a local Node.js interpreter or a Node.js on Windows Subsystem for Linux.
Specify the path to react-native-cli and the working directory of the application. Optionally, type the environment variables for react-native run-android or react-native run-ios.
By default, WebStorm starts the React Native bundler automatically when you invoke the run/debug configuration. If you have already started the bundler from outside WebStorm, for example, from the command line, you can re-use it without stopping and restarting. Select your bundler in the Before Launch area and click Remove.
The issue is tracked at WEB-35719, please follow it for updates

Environment variable issue in build an apk in ionic project

I am trying to build an apk in ionic 2 but while building is getting following error.
Error:
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
After that, I set the environment variable and path. Even though still am getting that error again can anyone please help me how to solve this issue
Instruction 1:
After adding your ANDROID_HOME, make sure you do the below:
Restart your System or run source ~/.bash_profile
Remove Android platform from your project ionic cordova platform rm android or ionic platform rm android
Add Android platform ionic cordova platform add android
Then ionic cordova run android or ionic run android
Instruction 2:
To set your ANDROID_HOME and JAVA_HOME, follow the below steps:
Run command open ~/.bash_profile
Paste the below in the file that opens on your Text editor
export ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Save - "Command S" or "Ctrl S"
Then Follow the "Instruction 1:" above
NOTE: Make sure you have 24.4.1_1 SDK
Hope this helps.

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.

redmine : due date remainder not migrating

I am currently developing a project management system using Bitnami Redmine. I am using Redmine 1.4.7.
I found a plugin on https://github.com/f0y/due_date_reminder/tree/redmine-1.4 which I want use on my project. I copied the plugin to C:\BitNami\redmine-1.4.7-2\apps\redmine\htdocs\vendor\plugins. I followed the instructions provided but when I try to install the plugin it does not get migrated.
I'm running this command in C:\BitNami\redmine-1.4.7-2\apps\redmine\htdocs:
bundle exec rake db:migrate_plugins rails_env=production
and receive the following error:
Expected C:/BitNami/redmine-1.4.7-2/apps/redmine/htdocs/app/models/user.rb to define User
Tasks: TOP => db:migrate_plugins => environment
See full trace by running task with --trace
I don't get what is the problem with the user.rb file. Please help.

Calabash-Android on WIndows 8 issues

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.