Running android app in headless - android

Can I run android app in headless emulator. I tried with am command but it showed NullPointer Exception. I think as it is a gui application I can't. Is there any way around? The emulator is so slow. It takes like 5-7 mins sometimes. I'm running gingerbread by the way.
Environment: I'm running from qemu source code. From android image and kernel image. The arguments to qemu emulator are something like this:
-sysdir ../../android-image -kernel ../../android-kernel/zImage -no-window -qemu -monitor stdio

From ${android-sdk}/tools run this command:
emulator -avd NAME_OF_EMULATOR -no-skin -no-audio -no-window
In this blog it is nicely explained: http://paulemtz.blogspot.cz/2013/05/android-testing-in-headless-emulator.html

Related

android studio only starts the virtual machine

When I recently studied React Native, I needed to use an emulator to test (when I don’t need a mobile phone to run).But every time you have to start Android Studio and then start the emulator, it is very troublesome to operate twice,
You can start your emulator by using command line, by open your CMD in your sdk folder / emulator. Then try this command
emulator -list-avds
To list your virtual devices and then
emulator -avd <device_name>
You can find the detail here
https://developer.android.com/studio/run/emulator-commandline#starting
Hope that help. ^^
You can start emulators from the terminal/ CMD without opening Android Studio.
To get the list of AVDs (run from sdk/emultor folder)
emulator -list-avds
To run any avd
emulator -avd avd_name [ {-option [value]} … ]
or,
/Users/janedoe/Library/Android/sdk/emulator/emulator -avd Nexus_5X_API_23 -netdelay none -netspeed full
For more details refer - Official guide

What's the difference between avd from command line and from avd manager?

I am trying run appium test case on android emulator,but there is a confusing situation.
The test case will start a specified activity, is very fast on the android emulator from avd manager(5-6s).
avd manager:
avd manager
The android emulator from command line is also relatively smooth,but the test case start the specified activity very slow(20-30s).It can fast infrequently(1%-2%).
command line:
emulator -avd Nexus_5_API_27
The avd is same.So,is there any difference between the same avd from command line and from avd manager ?
I've tried a lot of acceleration options but they don't work.
When you open emulator from avd then it opens using commandline itself but with some startup options. Following command is executed when you run emulator from avd
emulator -avd Nexus_5X_API_21 -netdelay none -netspeed full
Try to include these options in your command line instead of normal run. You can run your command like this:
emulator -avd Nexus_5_API_27 -netdelay none -netspeed full
i hope it will help you.

qemu: could not open gdbserver on device 'tcp::1234'

I have a problem when I study Android kernel Stack-buffer-overflow vulnerability.
Firstly, I create a AVD named "kernel_challenges"
and then, run it using command
"emulator64-arm -show-kernel -kernel arch/arm/boot/zImage -avd kernel_challenges -no-boot-anim -no-skin -no-audio -no-window -qemu -monitor unix:/tmp/qemuSocket,server,nowait -s"
It work well, then I panic it
Panic
Then, I resart the emulator, but it can't start anymore
The emulator can't restart
After restart the Linux, the emulator can start.
How to solve it?
I have solved the problem, when the emulator panic, we should input q in the gdb debug terminal instead of closing emulator forcely

Emulator Failed to Start "OpenGLES emulation failed to initialized"

I've been struggling with trying to launch android emulator but no success yet. I've updated the graphic card driver and done every possible solution out there but to no avail. For some reason with the new update there is something wrong needs to be fixed.
Here is the screen of the errors
This looks like the renderer failed to initialize. The solution currently is to try another renderer. Can you also try from command line with -gpu host, -gpu angle_indirect and -gpu swiftshader_indirect?
I got this error using Android emulator version 30.2.5.0 (build_id 6953278) (CL:N/A) on Debian 9
when running Api 28 x86 in headless mode (kvm enabled) with emulator #a9 -wipe-data -no-window -no-audio -verbose -no-boot-anim -gpu off
installing libgl1-mesa-dev from here
apt install libgl1-mesa-dev

Launch Android emulator on console (without graphic desktop )

I'm trying to run android emulator on terminal I have downloaded android sdk on VM ubuntu server (Thus I dont have graphic desktop, only terminal console).
I want to run emulator on terminal as a service that I can use for install App and run some tests(battery consumption, install, others).
I want to create some AVD and run test scripts on it.
But, I cant launch emulator without graphic desktop. Is it possible?
I find that it's possible start Android Emulator without graphic with this command:
$emulator -avd <avd_name> -no-window
Also you can add other commands to clean data on emulator
$emulator -avd <avd_name> -no-window -wipe-data

Categories

Resources