pCloudy Plugin for Cordova

Prashanth M Nair
By Prashanth M Nair
April 25, 2018
4 min Read
Share This Article
pCloudy Plugin for Cordova

Cordova

Cordova is an open source mobile app development framework which helps build cross-platform mobile applications that are highly scalable and agile. The use of common scripting languages such as CSS, HTML and JavaScript assists in developing a simple and organized Cordova framework, which makes it a popular framework among app developers.

Cordova Archtecture

Advantages

Let’s have a look at some of the advantages of creating apps on Cordova :

  • It is a hybrid script framework which uses standard web API’s for all well known operating platforms.
  • The Cordova application developers only need to know web development using HTML5, CSS3 and JavaScript.Cordova takes over the rest of the work to be done.
  • Using Cordova, a developer can create applications for operating systems like iOS, Android, BlackBerry and Windows Phone. The Cordova developer need not be an expert of either of the above mentioned operating system.
  • Cordova has edge over the others simply due to the coverage of the framework.

The Cordova project consists of three main things—a command line tool, access to hardware features, and the ability to support future features.

Need for Cordova plugin in pCloudy

pCloudy being a unified mobile app testing platform is used both by developers and testers. pCloudy offers DeviceTunnel feature for developers to connect to a real device on cloud and use the device as if it’s connected to their local USB. Currently the DeviceTunnel is possible through Android Studio/Eclipse and XCode plugins. Although developers could create builds perfectly using any of the IDEs on the platform, Cordova developers looked for a seamless way of creating apps on a command line tool.

As mentioned earlier, Cordova is a popular open source app development framework among developers and there was a need of command line DeviceTunnel Interface to pCloudy so that developers could build their Android or iOS apps and put it to test on a real device on pCloudy. Now, pCloudy real devices on cloud can be accessed by running few commands on the command line interface.

Let’s see how this works with Cordova.

Note: pCloudy command Line DeviceTunnel Interface is only available for Android devices on Public cloud. It is available for both Android and iOS on private and on-premise cloud.

Pre-requisites

  • JDK 8 and above.
  • android-sdk latest version.

Jar download path

http://pcloudy-content-distribution.s3.amazonaws.com/index.html?prefix=Android%20Device%20Tunnel/

This will be a one-time activity and need not be repeated again.

Steps to Run the Jar

Step 1: Run the DeviceTunnel jar by passing the cloud url, user name and api key

Example: java –jar pCloudy_DeviceTunnel.jar https://device.pcloudy.com test@pcloudy.com skdflj4tlko46lsa

Note: Mention the device tunnel jar path where you store the downloaded pCloudyDeviceTunnel.jar

Example: Here, the jar is saved in desktop so the path would be like

java –jar /Desktop/pCloudy_DeviceTunnel.jar https://device.pcloudy.com test@pcloudy.com skdflj4tlko46lsa

Cordova Plugins

Step 2: It will display a list of available devices in that cloud. Select any one device by mentioning the device number and press enter.

selct-any-device-press-enter

samsung grand quattro

Step 3: Enter the duration (in minutes) for which you want to book the device, then press enter.

enter id

Step 4: Selected device gets connected to your system.

get connected to your system

Step 5: Open another terminal and check if the device is connected or not

open another terminal

If the device list shows as unauthorized then copy the url displayed by the jar and paste it in the browser.

Device List

connect to a device

Step 6: Click on ok option on the device and check device list again in terminal.

Ok Option

Ok Option

Now device is connected to your system. You can use this device like a local device.

Now use the connected device in Cordova app Debugging. Build the cordova app for android.

run cordova android

Step 7: Cordova build process

cordova build process

Deploying to device

Step 8: After the successful build, check if the app gets installed on pcloudy device which you had connected to your system.

After Successful Build

Cordova app is installed on pcloudy device.

Step 9: You can debug this through chrome debugger.

Chrome Debugger

DevTools

pcloudy-devtools

Note: If you want to exit from the device tunnel jar, please type ‘EXIT/exit’.

exit

Conclusion

No matter if you are a developer or a tester, just sign up on pCloudy to make the most of your app testing.

Prashanth M Nair
Prashanth M Nair

Prashanth is an avid technologist. He has in the past worked in companies like Nokia, Accenture, and Harman. Devops is his latest passion. When he is not working, you would find him reading Tolkien or Martin. He now heads Engineering at pCloudy.

Related Articles

December 3, 2020
Functional Testing Vs Non-Functional Testing

According to a report, app crashes cause 71% of uninstalls. Other reasons that compel users to uninstall apps are page response time, confusing UI, and battery consumption. This indicates the importance of functional testing as well as non-functional testing in…

Learn More Arrow

October 23, 2020
Understanding Bamboo integration for CI/CD Pipeline

There are nearly 23.9 million software developers who code and build programs for businesses and enterprises that look to providing solutions for a better living. This means that there are millions of lines of program code being written this very…

Learn More Arrow

October 19, 2020
Hustler's Mantra: Adopt an experimental Mindset

"The very basis of creative work is irreverence. The very basis of creative work is bold experimentation. There has never been a creator of lasting importance who has not also been an innovator"– Eric Temple Bell Most of us are…

Learn More Arrow

App Testing during your Dev Cycle – Developer Tool to Access Real Devices on Cloud

Avinash
By Avinash
June 7, 2017
3 min Read
Share This Article
App Testing during your Dev Cycle – Developer Tool to Access Real Devices on Cloud

App Testing

If recent past has been any indication, then it is a certainty there are growing expectations from Testers and Developers alike, to take quality head on, as a joint feature. More so in the Mobile App Testing projects where changes are required faster than ever.

As part of DevOps practices, it’s has become imperative for developers to run as many tests as possible with every code check-in. These tests could be automated functional, API or Unit Tests. Some of the popular tools to used by Developers to create their tests are Espresso, XCTest and Appium.

Following are some the Challenges faced by developers:

  • Developers need access of right set of devices across different versions to be able to run their tests.
  • Debugging capability on those devices so that they can fix issues quickly.
  • Access to a specific model of devices to debug production issues.

Try taking a look at a typical developer’s cubicle and you will see a series of mobile devices connected with several long USB cables running into computers. It does get frustrating to see others furiously plugging USB cables in and out of the mobile devices for App Testing on various devices.

Many of the organizations are shifting to device cloud to provide their teams access of right Mobile Devices. Device cloud are solving the need of test teams but provide limited debugging capabilities and hence not preferred by Developers.

To directly address need of Developers, pCloudy recently introduced DeviceTunnel, which fully allows developers to take complete control of the device in cloud. This unique solution provides access of cloud devices through the Android Studio or Eclipse IDE and the command line tool installed in your computer.

It works as if Device is connected directly to your computer through a USB cable. From the point of view of tools like Android Studio or Eclipse, a cloud-based device appears physically attached. In reality, the Device Tunnel communicates with pCloudy’s servers over Internet.

App Testing

Access devices directly from your terminal

Once a connection is established, the developers can perform the following actions on these devices:

  • Issuing a range of ADB commands for debugging, shell creations, port forwarding, and viewing general information about any cloud-based Android device
  • Copying and pushing files to connected cloud-based devices
  • Installing and uninstalling applications
  • Debugging apps during development or testing by adding breakpoints, inspecting variables, analyzing run-time metrics to optimize your app and more
  • Run their tests on the device directly from their IDE

To know more on how to connect any device on pCloudy using Device Tunnel Click Here.

It is undeniable that developers and testers need quicker access to diverse devices for the brisk evaluation of app and debugging. Device Tunnel enables both sets of engineers to instantly connect to any device hosted on cloud and run faster debug sessions and thereby, maximize the quality of their build cycles.

Avinash
Avinash

Avinash Tiwari is a thought leader, a recognized keynote speaker, and the co-founder of pCloudy.com. He has 15+ experience in Product development and Testing. He brings with him a passion for emerging technology and quick adoption, both of which have solidified his reputation as a leader in the mobile app testing field.

Related Articles

December 3, 2020
Functional Testing Vs Non-Functional Testing

According to a report, app crashes cause 71% of uninstalls. Other reasons that compel users to uninstall apps are page response time, confusing UI, and battery consumption. This indicates the importance of functional testing as well as non-functional testing in…

Learn More Arrow

October 23, 2020
Understanding Bamboo integration for CI/CD Pipeline

There are nearly 23.9 million software developers who code and build programs for businesses and enterprises that look to providing solutions for a better living. This means that there are millions of lines of program code being written this very…

Learn More Arrow

May 6, 2019
The Role of Artificial Intelligence in Transforming DevOps

DevOps helps enterprises to build software at a fast pace and with minimal issues. The time to market is accelerated and the bugs are fixed faster in continuous deployment with the help of automated tools. AI is much in line…

Learn More Arrow

Device Tunnel

Avinash
By Avinash
February 9, 2017
5 min Read
Share This Article
Device Tunnel

Device Tunnel

In the age of mobile apps, a typical developer’s cubicle can be imagined as place where a series of mobile devices are connected with several long USB cables that run into computers. While some developers furiously keep debugging their apps on their computers, there will be others who frequently keep plugging USB cables in and out of the mobile devices to test their apps on various devices.

That makes some of us wonder, doesn’t it? What’s the connection between mobile app developers and USB cables?

Well, when a developer connects a device to a computer, he will instinctively enable the ‘USB Debugging mode’. When the ‘USB Debugging Mode’ is enabled on an Android device, it opens up a bridge between the Android device and the computer. This bridge grants him a level of access from your computer to your device. What kind of access? This level of access that USB Debugging Mode grants is important when he needs system-level clearance, such as when coding or debugging an app. This mode, also called the Developer Mode, allows newly programmed apps to be copied via USB to the device for testing. Depending on the OS version and the installed utilities, the mode must be turned on to let developers gain access of the device. One such common utility is ADB.

What is ADB?

One of the most commonly used abbreviations in Android blogs and forums is “adb”. So, what is “adb”?

ADB, Android Debug Bridge, is a command-line utility included with Google’s Android SDK. It provides a wide variety of functions for managing your device. As stated in the Android developer site — “Android Debug Bridge (adb) is a versatile tool that lets you manage the state of an emulator instance or Android-powered device.” In simple words, ‘adb’ is a “bridge” through which developers can connect to an Android emulator or a device from a computer to resolve bugs in their applications. The bridge can be accessed via a command line interface from a computer, where the Android SDK is installed. This is done by connecting a device that runs the software through a PC, and feeding it terminal commands. ADB lets you modify your device (or device’s software) via a PC command line.

Using ADB with A locally connected devices

A simple client-server setup using your USB cable will help you establish an adb connection from a computer to an android device. Once this connection is established, you can send adb commands from your computer via USB to control your android device. Using ADB commands you can move content to and from your phone, install an uninstall apps, back-up and restore your software, run shell commands, run automation scripts and more.

But, it certainly raises questions like these:

  • We are moving to cloud-based devices, how will we be able to use adb connection with the devices on cloud?
  • Do I have to switch to local devices to if I have to debug my app?
  • Does this mean I cannot use adb bridge when I’m using devices on cloud?

Well, the answer is you can establish adb connection with cloud-based devices as well, and it is a much easier process compared to connecting your devices locally.

Using ADB with A Remotely connected device

Accessing ADB through pCloudy platform – Device Tunnel

pCloudy has introduced Device Tunnel, a new add-on to our real mobile device cloud. With Device Tunnel, you can connect and take full control of any Android device using Android Debug Bridge. It provides access to the cloud-based devices through the Android Studio or Eclipse IDE and the command-line tool that’s installed on your computer. What’s more? Many test automation frameworks and developer tools used for evaluation of the app and debugging can hold on to cloud-based devices as if locally connected by USB. For such tools, Device Tunnel acts as a “USB cable” connecting cloud-based device(s) to a local laptop or server. From the point of view of such tools, a cloud-based device appears physically attached. In reality, the Device Tunnel communicates with pCloudy’s servers over Ethernet (LAN or WAN) to reach the cloud-based device.

The Device Tunnel allows developers to gain more control over any cloud-based android device. Once a connection is established, the developers can perform the following actions:

  • Issue a number of adb commands for debugging, shell creations, port forwarding, and viewing general information about any cloud-based Android device
  • Copying and pushing files to connected cloud-based devices
  • Installing and uninstalling applications on cloud-based devices
  • Debugging apps during development or testing by adding breakpoints, inspecting variables, analyzing runtime metrics to optimize your app and more

This comes with the added advantage of accessing and performing these actions on any Android device among of hundreds that are hosted on our Cloud. This ability will also help developers to debug apps and determine the causes behind issues or bugs that are device specific.

On the whole, the Device Tunnel will aid developers and testers who need quick access to diverse devices for brisk evaluation of app and debugging. It enables developers and testers to instantly connect to any device hosted on cloud and easily identify problems by running interactive debug sessions.

To know more on how to connect any device on pCloudy using Device Tunnel click here

Avinash
Avinash

Avinash Tiwari is a thought leader, a recognized keynote speaker, and the co-founder of pCloudy.com. He has 15+ experience in Product development and Testing. He brings with him a passion for emerging technology and quick adoption, both of which have solidified his reputation as a leader in the mobile app testing field.

Related Articles

February 25, 2019
Executing ADB Shell Commands

You can fix the issues in your Android phone by connecting it with your computer and writing some easy commands. For this, you will need some command line tools which you can download from the Android developer's site. If you…

Learn More Arrow

October 13, 2017
Problems With Online Android Emulators and How to Solve it?

Online Android Emulator to Test Apps Android now occupies the number one place in the world Smartphone arena with a market share of 87% at the end of 2016 that means 9 out of 10 Smartphones in the world run…

Learn More Arrow

September 20, 2017
Explore Full Power of pCloudy Platform – Improve Quality, Speed and Efficiency

Explore Full Power of pCloudy   pCloudy understands that businesses need their apps to be rolled out faster than before, without bugs, crashes, functionality issues, UI glitches, memory drainage and well, everything wrong with every app you uninstalled on your…

Learn More Arrow

Experience pCloudy Today

Tickmark No Credit Card Required
Tickmark Exceptional Security

Copyright All Rights Reserved © 2020