Thursday, August 10, 2017

Run Android Apps in Chrome Browser in Windows, OS X and Linux




Unofficially, now it is possible to run any Android app in Chrome browser on Windows, Mac and Linux!!
Here is how you can make it work.
Step 1 - ARChon runtime setup.
  1. Create a folder in desktop ex: chrome app etc
  2. Download ARChon runtime vladikoff-archon runtime zip and extract it in chrome app folder
  3. Open Chrome browser and go to the extensions manager by chrome://extensions/ or Menu > More Tools > Extensions
  4. Enable the Developer mode at top right corner, if it is not already enabled
  5. Select "Load unpacked extension".
  6. Choose the folder containing the ARChon runtime you unzipped earlier, Select it and press "Ok"
The ARChon runtime will now be listed in extensions in Chrome. There may be couple of warnings like below image. However, these are normal and shouldn't affect your ability to run Android apps.




Step 2 - Convert .apk file to compatible with chrome


By chromeos-apk!! 

  1. Copy your .apk file where you can find it
  2. Install Node.js (via http://nodejs.org/) (Ubuntu might need sudo apt-get install lib32stdc++6)
  3. Install the tool (might need a sudo prefix):
  4. npm install chromeos-apk -g OR sudo npm install chromeos-apk -g
  5. Run chromeos-apk [path to apk file] 
  6. Example: For Phone: chromeos-apk com.yourapppackage.android.apkFor Tablet: chromeos-apk com.yourapppackage.android.apk --tablet
  7. This will generate a directory as com.yourapppackage.android
  8. Open the Extensions page in Chrome by chrome://extensions/ or Menu > More Tools > Extensions
  9. Select "Load unpacked extensions".
  10. Choose the folder com.yourapppackage.android from directory
  11. The app will now appear in Chrome extensions list with launch button
    Click on it and you are all set!!

Or

By Twerk!!

  1. Download and install Twerk from Chrome web apps
  2. Launch Twerk 
  3. Drag and drop an Android .apk file from your desktop into the main Twerk window.
  4. Set your preferences for how the app should run (portrait mode, tablet mode, etc.) using the sliders.
  5. Tap the pink Android button and a directory as com.yourapppackage.android is ready to be installed as an unpacked extension.

Settings:

  • Set custom name and icon
  • Package for ‘Archon’ or official runtime
  • Set tablet or mobile layout
  • Set landscape or portrait mode
  • Toggle scaling (may prevent some apps working)
  • Toggle SD Card support
  • Set offline functionality

Sources:

- https://github.com/vladikoff/chromeos-apk
- http://www.omgchrome.com/twerk-chrome-archon-apk-maker-desktop/


Sunday, July 30, 2017

Basic Use of Monkey Command


Before we proceed to the topic, what is Monkey and its commands?
The Monkey is a program that runs on emulator or device and generates random user events such as clicks, touches or gestures, as well as a number of system-level events.
We can use the Monkey to stress-test an applications, in a random yet repeatable manner.

Overview



Monkey is a command-line tool that that we can run on any emulator instance or on a device. It sends a pseudo-random stream of user events into the system, which acts as a stress test on the application software.
The Monkey includes a number of options, but they break down into four primary categories:
  • Basic configuration options, such as setting the number of events to attempt.
  • Operational constraints, such as restricting the test to a single package.
  • Event types and frequencies.
  • Debugging options.
When the Monkey runs, it generates events and sends them to the system. It also watches the system under test and looks for three conditions, which it treats specially:
  • If we have constrained the Monkey to run in one or more specific packages, it watches for attempts to navigate to any other packages, and blocks them.
  • If application crashes or receives any sort of unhandled exception, the Monkey will stop and report the error.
  • If application generates an application not responding error, the Monkey will stop and report the error.
Depending on the verbosity level we have selected, we will also see reports on the progress of the Monkey and the events being generated.

Basic Use of the Monkey



We can launch the Monkey using a command line on development machine or from a script. Because the Monkey runs in the emulator/device environment, we must launch it from a shell in that environment. we can do this by prefacing adb shell to each command, or by entering the shell and entering Monkey commands directly.
The basic syntax is:
$ adb shell monkey [options] <event-count>
With no options specified, the Monkey will launch in a quiet (non-verbose) mode, and will send events to any (and all) packages installed on target.
Here is a more typical command line, which will launch application and send 500 pseudo-random events to it:
$ adb shell monkey -p your.package.name -v 500



Source:
- https://developer.android.com/studio/test/monkey.html

Run Android Apps in Chrome Browser in Windows, OS X and Linux

Unofficially, now it is possible to run any Android app in Chrome browser on Windows, Mac and Linux!! Here is how you can make it w...