I created my android virtual device using command as folow:
android create avd --target 1 --name emu --abi x86
then I tried to run emulator:
emulator -avd emu &
during the emulator starting I was trying to make command as follow:
adb shell
but I had an error:
error: device offline
and when i made command:
echo $?
I had output "1" until emulator get started.
Is it any possibility to check current emulator state using the terminal command?
You can use another terminal window and type adb logcat commnad.
Related
I am having issue with android emulator and it is not starting the device. i am using linux mint. this error is shown
5:49 PM Emulator: emulator: ERROR: Unknown AVD name [Pixel_2_API_29], use -list-avds to see valid list.
5:49 PM Emulator: Process finished with exit code 1
i dont know how to list avds .
i was able to run it from the command by using
sudo ./emulator -avd Nexus_5X_API_29_x86 -use-system-libs
BUT not working in avd managers window.
Please run following commands step by step..
1.adb kill-server (To kil adb server)
2.adb start-server (To start adb server)
3.adb devices (To list avds)
I created the avd by doing the following:
./avdmanager create avd -c 100M -n test -d 9 -k 'system-images;android-26;google_apis_playstore;x86'
I get the following output after running avdmanager list avd
Name: test
Device: Nexus 5X (Google)
Path: /home/me/.android/avd/test.avd
Target: Google Play (Google Inc.)
Based on: Android 7.1.1 (Nougat) Tag/ABI: google_apis_playstore/x86
Sdcard: 100M
Then I booted up the emulator by running
emulator -avd test -no-audio -no-boot-anim -no-window -skip-adb-auth & adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82'
Then finally I try to run the tests with
./gradlew connectedDebugAndroidTest
However, the process hangs and I assume will do so indefinitely, but I will kill the process after 10 minutes. I am not even sure how to debug this let one resolve it so any help would be greatly appreciated!
Which process hangs? The test process? In that case you should know which gradle task hangs at least.
However, if it is the emulator process hanging (not finishing booting) then I was able to resolve that in headless environment with these extra params for kvm:
-qemu -enable-kvm -snapshot
Obviously, you need kvm set up and enabled. (KVM installation for ubuntu)
I'm trying to run the Hello-World app of Phonegap on Ubuntu 16.
"/my-app# phonegap --verbose run android"
But no matter what it always takes very long and finishes with an error:
"Running adb shell command "getprop dev.bootcomplete" on target emulator-5584..."
"Running command: adb -s emulator-5584 shell getprop dev.bootcomplete"
"Command finished with error code 1: adb -s,emulator-5584,shell,getprop,dev.bootcomplete"
I've creating different avds and running everything as root user but no change.
Any suggestion what this "error code 1" means would be highly appreciated - I could only find other error codes with the search.
Try running adb kill-server and restart doing all the process again.
EDIT:
Try starting emulator with ubuntu cmd:
LD_PRELOAD='/usr/lib/x8stdc++.so.6' ~/Android/Sdk/tools/emulator -netdelay none -netspeed full -avd Nexus_5X_API_21
where Nexus_5X_API_21 is your emulator name
~/Android/Sdk/tools/emulator is your path where emulator is stored
Do this after adb kill-server, then on another cmd tab, try running
phonegap emulate android --verbose
I have created an emulator on my mac machine. When I try to launch the emulator manually from avd manager, I am successful. Also, if I launch the emulator on the command line by
emulator -avd nexus5_api21
the emulator starts. But when I write a small shell script to do the same, like
#!/bin/bash
echo "hello"
emulator -avd nexus5_api21
my emulator doesn't start. It complains, that it couldn't find the .ini file. But the same command works, when I do it separately by opening a terminal. I don't have to go to a specific location for running this command successfully.
I don't understand, what the difference between the command line and the shell script is.
You have an error in "shebang line" of your script. It should look like
#!/bin/bash
emulator -avd nexus5_api21
voila!
I would like to advice you to get familiar with shell scripting.
First I have installed novnc and sdk in linux, each of them runs correctly, however, I don't know how to connect emulator with novnc. The following commands are used in my experience.
android list targets
android create avd -n myAVD -t 1
emulator -avd myAVD -qemu -vnc 2
vncserver
vncserver -geometry 1024x768 :1
./utils/launch.sh --vnc 127.0.0.1:5901