A Comprehensive and Friendly Guide on Device Cloud for Beginners
Tags: devicecloud, testgrid
Published: 2024-05-17 06:28:42


Testing on a wide range of real-world devices, operating systems, and OS versions can be difficult. You already know it’s true and so, device cloud is becoming essential more than ever.
Furthermore, we can find mobile devices with varying screen sizes, memory, CPU power, and so on in the wild, which complicates matters. However, to provide great apps to your customers, you must conduct tests on real devices.
In this blog, let us learn how a real device cloud can help you overcome testing challenges and everything related to a device cloud.

## What Is A Device Cloud?

A device cloud is a testing environment for devices that allows developers to assess the performance of their apps’ performance and websites on a variety of smart devices.
These devices are stored on cloud-based servers, allowing them to be accessed at any time. A device cloud is a type of testing infrastructure.
The capabilities of the device clouds vary, with some consisting of virtual or emulated devices and others providing access to physical devices.

Unfortunately, there is no way to distinguish one from the other because emulated device clouds allow you to test for scalability while handling multiple simultaneous requests in one go. 
In contrast, physical device clouds provide additional insights into how factors such as battery charge affect app performance.
Today, there are a variety of device emulators available for single-device manual testing, including the Android Virtual Device (AVD) built into Android Studio and third-party options for Android.
Testing has become much more manageable with the recent rise of cloud computing. This phenomenon enables access to large device clouds or farms containing hundreds or even thousands of real devices, as well as emulators and simulators. 
In addition, mobile developers don’t have to worry about the impracticality of bringing their own devices around to conduct testing when it comes to cloud testing.

## Why Do You Want A Device Cloud?

It isn’t easy to find and connect to your devices over the internet! Dynamic IP addresses, NAT, firewalls, and other security measures make accessing your home network and devices difficult. 
When you host your device cloud on the internet, devices can connect and communicate without opening connectivity to your home network.
Not all devices can be constantly connected online. For example, a device cloud allows devices to communicate asynchronously. A sensor or actuator, for example, can connect to your device cloud continuously to record data or receive new instructions; because the device isn’t secured all of the time, it can save a lot of power. 
A sensor or actuator, for example, can connect to your device cloud continuously to record data or receive new instructions; because the device isn’t secured all of the time, it can save a lot of power.
You have complete control over the data and services your devices have access to. You’re not restricted by what a third party offers, nor are you concerned about what they might do with your information. Instead, you own the entire infrastructure and have complete control over its use.

## Test Your App In The Cloud On Mobile Devices

app testing provides faster testing times, more thorough bug detection and eliminates the need for your developers to spend time running individual tests. 
If you don’t test your app on real devices, you won’t know if it will work properly. You’ll also be oblivious to a slew of other issues, including heat and battery drain.
When it comes to mobile app testing, nothing beats using an actual device. So while the Dev Tools provided by most browsers are sufficient for a quick “look and layout” test, they fall short when it comes to mobile testing.

## Use a Device Cloud for Mobile App Testing

### 1 Get Flexible and Customise the Testing Environment to Your Needs
Businesses frequently face one issue when using cloud services is their one-size-fits-all functionality. In particular, SaaS (Software as a Service) often provides predefined features with no customisation options. 
While the ability to customise the service may not be required, it’s nice to change the environment to meet your needs. This means that instead of using SaaS, you should use IaaS.
Who knows what the future holds? To adapt to changing business needs, you must maintain flexibility and keep tools flexible. No one wants to switch to a new system, so selecting a flexible actual device cloud can be a game-changer.
Furthermore, the people working on and testing your application will have their preferred technology stack. As a result, forcing them to use different cloud test frameworks and configurations would be counterproductive. You can make your team feel right at home with a cloud-based and flexible infrastructure.

### 2 Advantage of Unlimited Concurrency and Reduce Time-To-Market
Testing is a time-consuming process. Even if you’ve already automated the majority of your test cases, you’ll need to run them on a variety of devices with varying specifications. 
For example, you can’t test your product as intended if you run your tests on one device at a time, which is known as sequential testing. So you do not have enough time!
You can run tests on multiple devices simultaneously to speed up testing. With more efficient testing, you can ensure your customers receive stable and responsive products. The time saved can be used by your QA team and developers elsewhere.
Most online testing services already allow you to run tests on a limited number of devices at once, such as 20. So, for example, consider running your tests on an infinite number of mobile devices simultaneously. The amount of time saved varies greatly! 
Testgrid has developed a technology that allows teams to run tests on any number of devices while maintaining speed and efficiency, allowing you to realise your wildest testing dreams. 
In addition, you can maximise your testing efforts, be more productive, and make more useful applications available to your users more frequently this way.

### 3 Reliable Testing Results from Real Devices
There are two methods for testing your mobile apps: real devices or emulators. While emulators behave like real devices, you can’t expect them to be “the real deal.” That is why it is critical to focus a significant portion of your testing efforts on actual devices!
Your developers can use emulators to test as they add features or fix bugs, resulting in more robust apps throughout the development lifecycle.
They don’t need to be maintained, are often open-source, and are simple to manage and configure. 
On the other hand, emulators aren’t ideal for testing your app in real-world conditions because they don’t overheat or drain the battery.
Furthermore, a misplaced or incorrectly set parameter in your emulator can sabotage and falsify your test results. You can imagine that testing on actual devices is far more reliable and efficient.

### 4 No Need To Worry About Setting Up And Maintaining Your In-House Device Lab
To test real devices, you’ll need a device lab. It could be set up and maintained in-house (also called on-premise).
However, this method may be costly – consider how many devices you will need to purchase and maintain. In theory, it is not impossible to set up a dependable and efficient device lab on your own.
A viable solution is to use a cloud service that provides real-world devices for testing. As a result, you save money and human resources while allowing your team to use cutting-edge testing techniques such as continuous testing.
You don’t have to be concerned about the costs of maintaining and updating your devices.
A true device cloud includes all of the features you require right out of the box. It also allows you to optimise your release cycles and confidently implement modern testing practices. 
As a result, when we say that using a cloud-based service is a “work more, worry less” solution for you and your team, we’re not exaggerating!
Read also: [Creating a Strong Mobile App Hybrid Architecture](https://testgrid.io/blog/device-cloud-complete-beginner-friendly-guide/)

## How to Build Your Device Cloud?
To build your very own device cloud, here are some hardware and software that you will need in the process:

### 01 Software Requirement
Let’s begin with the software that manages Android devices. 
The software is known as openstf, and the acronym STF stands for Smartphone Test Farm. Simo Kinnunen and Günther Brunner maintain the open source software. STF has a plethora of really cool features, such as

- Input via Keyboard and Mouse
- Copying and pasting to and from the device
- Capture Screenshots
- APK files can be dragged and dropped.
- Open URLs in any browser you have installed.
- Logs are displayed.
- Execute Shell Commands
- Remote debugging with Android Studio, among other things
- The only software you need to install for device management is OpenSTF. However, you must also install the Android SDK, Java SDK, and XCode
.

### 02 Hardware Requirement
Now, let’s discuss the hardware. 
To build the device cloud, I used the following hardware. A Mac mini is an excellent choice for installing the required software.
It is slim, powerful, and perfectly fits into the server rack. In my case, I used a Mac mini with an Intel Core i5@2.6GHz processor, 8GB of RAM, and a 256GB SSD drive.
The next piece of hardware required is a server rack to secure the devices and the Mac mini. The advantage of a real server rack over any other locker is the ventilation system, which helps to cool down both the mac mini and the devices. 
We used two USB hubs with additional power support to charge the devices and send commands to them (60€ each) to connect many devices to the openSTF system. 
One power cord extension and some velcro fasteners were used to secure the USB hubs beneath the server rack’s shelves. In addition, the openSTF team provided additional hardware recommendations for setting up the device cloud.
Device holders are another piece of hardware we’ve added to our device cloud. We can add even more devices next to each other on a single shelf with the holder’s help.

## How To Create A Mobile Device Cloud On Android?
Now that the hardware is in place, you can install the necessary software. First, install the latest Java SDK on the Mac mini.
If the SDK is not available, you can get it here and install it by following the instructions. 
The next piece of software you must download and install is Android Studio, as well as the necessary API levels. Download the most recent version of Android Studio from http://developer.android.com/sdk/index.html and install it according to the instructions on the Android Studio page. 
Then, once Android Studio is available in your system, launch the SDK Manager to install the API levels your app needs.
When you install Java and Android Studio, make sure to include both in the command line’s PATH variable.
Code snippet that shows an excerpt of the bash_profile file
<!-- wp:paragraph -->
<p># Android Home</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>export ANDROID_HOME="/Users/YOUR_USER/Library/Android/sdk"</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p># Java Home</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home"</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p># User configuration</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>export PATH="${PATH}:/Users/YOUR_USER/Library/Android/sdk/platform-tools"</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>export PATH="${PATH}:/Users/YOUR_USER/Library/Android/sdk/tools"</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>export PATH="${PATH}:$ANDROID_HOME"</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>export PATH="${PATH}:$JAVA_HOME"</p>
<!-- /wp:paragraph -->
You are now ready to install openSTF. You can find the most recent installation instructions for openSTF on the project’s GitHub page.
The installation of openSTF is straightforward and straightforward. Ensure you have admin privileges on the Mac mini before installing the open STL software.
**Start the Device Farm**
After installing openSTF, you are almost at the end of the Android device cloud setup phase. To start openSTF, open two terminal windows and execute the first one.
rethinkdb
and then execute in the second window
Stf local
The openSTF system is up and running in a matter of seconds. You can get there by typing http://localhost:7100 into your browser.
Start openSTF with the following parameter if you want to make the Android device cloud available to other colleagues:
stf local –public-ip <IP_ADDRESS>
The system is now also accessible via the specified IP address.
Add Devices
The openSTF interface currently displays no devices. The next step is to connect real Android devices to the USB hubs to see them openSTF and other colleagues.

## How To Add A New Device? 

To add devices to the system, you must enable the developer options and USB debugging on each device. To enable developer options:
Go to Settings -> About phone and tap seven times on the build number.
Return to the settings overview and look for the developer options.
With a tap, open the developer options and enable USB debugging.
Connect the device to the USB hubs now. When you connect the device, you will see a dialogue asking you to grant the device via ADB.
If access is granted, openstf will automatically install the STF services on the phone. After a few seconds, the device will appear in the test farm’s device list and be ready to use. 
Connect a Device to Android Studio
The device is now connected to your computer and can be accessed via the IDE or the command line. Carry out the command
adb devices 
To determine whether or not the device is connected and available. Now that the device is connected, you can begin a build, for example, in Android Studio, by selecting the actual Android device from the device chooser dialogue.
When the build is complete, the system will install the apk file on the Android device in your device cloud.

## Device Farm in Action
To give you an idea of how openSTF works, I made the YouTube video below, which shows the Android device cloud in action after the initial setup and without the rack:).
That’s it; you now have a working Android device cloud in your office, ready for manual testing, automated checking, and debugging.
Tools For Cloud-Based Mobile Testing

### 01 AWS Device Farm
Amazon Web Services Inc. has made a name for itself in the cloud computing industry.
They have launched a cloud testing service that allows testers to simultaneously run their apps on multiple devices. As a result, even before the app is public, the testers can view videos, logs, screenshots of errors, performance data and reproduce real-time issues.
There are two types of testing permitted: automated and remote. It is possible to test both hybrid and native apps.
It also includes a fuzz test so that developers who do not have their tests can benefit from it. The tests in this section run on real, non-rooted devices with both ‘branded carrier’ and ‘OEM offerings’.
There are approximately 152 iOS devices available and 206 FireOS and Android devices.
Three pricing models are available: pay as you go, unlimited testing, and private devices. Testers can select anyone based on their needs.

### 2 Firebase Test Lab
This Android tool for cloud testing services only supports Android apps.
On the other hand, you can start testing across a wide range of devices and configurations with a single operation. As a result, it is simple to use, with test results such as videos, screenshots, and logs available on the Firebase console. 
This tool is also helpful for testers who do not write their test codes. For example, the automatic testing feature allows for automated testing while also looking for signs of potential app crashes.
Pricing models include three plans: Spark, a free plan with limitations, Flame, which requires monthly payments, and Blaze, which is pay-as-you-go.
Numerous Android devices are available for testing, and it also includes a ROBO test that can:

- Analyse the app’s user interface and enable automatic UI exploration by simulating user activities.
- It includes a Firebase console, a gcloud command line, and Android Studio.
- It can also be used in conjunction with CI systems.
You can also test the apps can a variety of real-world devices and configurations.

### 03 Xamarin Test Cloud
This cloud testing services tool employs the programming language C# for cross-platform mobile app development.
Simulating real-time user actions such as pinching, swiping, scrolling, and double-tapping allows for a wide range of testing. You can easily identify and track the performance issues on various operating systems by going over their memory and performance step-by-step.
There are numerous plans available to cater to a wide range of testers, such as the newbie, small start-up, growing business, and enterprise. This cloud testing tool also includes a 30-day trial period.
Over 2500 devices are already available, including iOS 8 and 10 and Android versions ranging from Honeycomb to Jelly Bean.
It is capable of integrating with NUnit standard test runners.
Other features include changing the GPS location, pressing physical buttons, activating the device camera, rotating the landscape and portrait modes, and so on.

 

## Conclusion

Device cloud testing is a great solution, and it helps you to test your software application on multiple devices; as a result, you can optimize the application properly for every device.
Today, there are hundreds and thousands of devices, and hundreds of smartphones are coming out every year. Device cloud enables you to test your application on maximum devices optimize for the maximum smartphone.
Device cloud saves your time, increases speed, and increases test coverage as now you can test on multiple devices at the same time without any waiting time.
This blog is originally published at [TestGrid](https://testgrid.io/blog/device-cloud-complete-beginner-friendly-guide/)