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

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

Related

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

Emulator failed to start

When i try to launch an emulator based on system image Android 4.4 armeabi-v7a (because my system does not support virtualization) in Android Studio, it starts and fades away within 2-3 seconds and the status bar shows "Starting device".
When i try to start it through cmd by going to the path "C:\Users\USER_NAME\AppData\Local\Android\sdk\tools" and using the command "emulator -avd AVD_NAME -memory 768 -no-accel -gpu on" the following error comes: Error while starting emulator
Please help.
Have you try to open your bios setting and enable virtualization there?
If virtualization is not in pc then you can install zenymotion in the system

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

Android/Eclipse emulator how to wipe-data?

I got below errors while trying the above question . does anyone know what's going wrong?
$ adb devices
List of devices attached
emulator-5554 device
$ emulator -avd -wipe-data
PANIC: Could not open: -wipe-data
$ emulator -avd emulator-5554 -wipe-data
PANIC: Could not open: emulator-5554
Open command prompt,
android-sdk-windows\tools>emulator -avd -wipe-data
example-
emulator -avd androidavd2 -wipe-data
You can wipe data while starting emulator in ADT plugin, just mark checkbox:
So I know this question is a few years old. But I'm going to answer anyways because no answer has been accepted.
FIRST, make sure that (your-android-sdk-location)/tools is on your $PATH. It wouldn't hurt to verify this by using which emulator from the terminal. For example when I do this it outputs:
/Users/chris.w.newman/Library/Android/sdk/tools/emulator
SECOND, find where your AVDs are located. By default it is located in the .android/avd directory in your User account folder. So for me it is here:
/Users/chris.w.newman/.android/avd
THIRD, cd to the above directory and get the list of devices you have created by listing them with ls
chriswnewmans-MacBook-Pro:~ chris.w.newman$ cd /Users/chris.w.newman/.android/avd
chriswnewmans-MacBook-Pro:avd chris.w.newman$ ls
Nexus_5_API_19.avd Nexus_5_API_19.ini
Note that every device has a pair of results, an .avd folder and an .ini file. You can see that I have one device whose name is Nexus_5_API_19.
FOURTH, to wipe the data of the device from the terminal you use the emulator -wipe-data command. Some people might find this annoying because it will ALSO launch the emulator after it finishes wiping the data. Anyways here's how you do it:
emulator -avd Your_Device_Name -wipe-data
The main reason I find this approach to wiping data annoying is that now the emulator is running from the terminal. That means if I wanted to do more work in the terminal, I would either need to open another terminal (I hate having multiple terminals open), or close my emulator to free up the terminal.
For completeness sake, I will mention that you can wipe the data of an emulator from the AVD manager (at least the one that is built into Android Studio). Open the AVD manager and in the list of devices, all the way on the right hand side you click the dropdown arrow and select Wipe Data. This wipes the data without launching the emulator.
I have Windows10 and using Android Studio 3.4
Follow the steps:
Tools -> AVD Manager -> Right Most Button under Actions(Down triangle Icon) -> Wipe Data
This image shows the steps in a screenshot.
Try:
emulator -list-avds
EMULATOR_NAME will be displayed
emulator -avd EMULATOR_NAME -wipe-data
Example:
emulator -list-avds
Pixel_XL_API_29
emulator -avd Pixel_XL_API_29 -wipe-data

Running android app in headless

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

Categories

Resources