Get current Activity name by adb shell

Here is the command:

adb shell "dumpsys window windows | grep -E 'mCurrentFocus'"

The output would be:

mCurrentFocus=Window{b6a99d1d0 u0}

My activity name is: LauncherActivity

Resolutions and Densities – List

To change without root density and resolution on Your phone You can call in batch:

adb shell wm size {X}x{Y}
adb shell wm density {Z}


Nexus 6 1440×2560 560
Samsung Galaxy S6 1440×2560 640
Samsung Galaxy Tab S2 8 1536×2048 320
Sony Xperia Tablet Z 1920×1200 240

To reset display call in batch:

adb shell wm size reset
adb shell wm density reset

I used information from application I’ve attachedĀ >>>HERE< <<

Connecting Nox with Android Studio

More info here:

However If You created emulator from nox multiplayer (You can create android 5.1), make sure You have created shortcut to this device and runned by this shortcut.

The rest info related with enabling usb debug and setting to be executed with root permissions is the same.

Change time in genymotion emulator – simple java app

I made app in executable jar java file for setting time in genymotion emulator.

Here is simple java code and compiled app for setting time in genymotion app. Below code I showed how the app looks like and also added ready jar app to download.


public class SetTimeInGenyMotion {
private JTextField textField1;
private JButton getTimeInProperButton;
private JButton setTimeInProperButton;
private JButton getTimeAndSetButton;
private JPanel panel1;
public static final String FORMAT = "YYYYMMDD.HHmmss";

public static void main(String[] args) {
new SetTimeInGenyMotion().doStuff();

private void doStuff() {

getTimeInProperButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

setTimeInProperButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String time = textField1.getText();

getTimeAndSetButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String time = getTime();


private void showWindow() {
JFrame frame = new JFrame("SetTimeInGenyMotion");
frame.setMinimumSize(new Dimension(680, 0));

private void setTime(String time) {
try {
String command = "adb shell date -s " + time;

Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(command);
BufferedReader br = new BufferedReader(new InputStreamReader(pr.getErrorStream(), "UTF-8"));
String l = "";

while ((l = br.readLine()) != null) {

} catch (IOException e1) {

private String getTime() {
//adb shell date -s YYYYMMDD.HHmmss

String format = "YYYYMMdd.HHmmss";
Calendar instance = Calendar.getInstance();
String time = getDate(instance.getTimeInMillis(), format);
return time;

public static String getDate(long milliSeconds, String dateFormat) {
// Create a DateFormatter object for displaying date in specified format.
SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
// Create a calendar object that will convert the date and time value in milliseconds to date.
Calendar calendar = Calendar.getInstance();
return formatter.format(calendar.getTime());

Zrzut ekranu 2015-06-03 11.58.59


How to run an android application using .apk file?

Here is the example how to run apk when you do not know what is the apk’s name.

First you need to call aapt to get info about AndroidManifest.xml from interesting apk. I will show you example on WifiKillDOwnloader.apk
In console you call:

aapt d xmltree WiFiKillDownloader.apk AndroidManifest.xml > manifest.txt

Console will output this:

Continue reading “How to run an android application using .apk file?”

adb command – reboot in specific device

First we need to know what devices we have by running command in console:
adb devices
[spoiler title=”Output”]

List of devices attached
01e010f522900141        device     device


Or we can use with param -l for additional description.
adb devices -l
[spoiler title=”Output”]

List of devices attached
01e010f522900141       device product:occam model:Nexus_4 device:mako    device product:vbox86tp model:Google_Nexus_7_2013___5_0_0___API_21___1200x1920 device:vbox86tp


And then when we know the specific address of our device, we can call to it our command for example:
adb -s reboot