6 ms·
I think that emulator is vastly superior option as it uses real Android running exactly the same code as your phone. I never had any issues with performance (wi
by vbezhenar 6y ago
I think that emulator is vastly superior option as it uses real Android running exactly the same code as your phone. I never had any issues with performance (with hardware acceleration). May be on extremely weak laptops it might cause issues, but Android Studio probably will be unusable there at all.
- benibela 6y agoI also need an emulator, because I have native binaries Unfortunately, there is only an aarch64 emulator for Android 7, which does not start on my system
- heavyset_go 6y agoAnbox with libhoudini might work for you.
- lfy_google 6y agoHi, Android 9 and 11 Google APIs/Play system images should have userspace ARM translation available (with ARM64 translation available in Android 11).
- benibela 6y ago> userspace ARM translation What does that mean? The x86 system image can run arm code? I will try that (might get confusing if there is an arm and x86 lib in the apk). I have been using the image without google apis to save space, because my sdd is almost full Does it reject invalid arm? I wrote my app in Pascal, and the FreePascal compiler often generates invalid assembly. Especially because I need to use the nightly build, because the last stable release does not support aarch64
- lfy_google 6y agoYes, the x86 system image can run ARM code. Note that the speed will be much faster than running a full ARM emulated system image because only the guest userspace bits need to be translated from ARM to x86. System calls are still marshalled to x86 calls, so memory accesses are many many times faster because (there's no need to drop into emulating the MMU). (Also AFAIK illegal instructions are still validated and trapped as SIGILL or SIGSEGV)
- clumsysmurf 6y agoA word of caution, a few times I've gone to bed with Android Studio and the emulator up; and woken up with my machine's fans running full speed and the thing about to melt down; the emulator can do funky things like take 600% of your cpu for no apparent reason after sitting there idle for hours.
- lfy_google 6y agoHi, what host OS are you running? I'd like to be able to send over a build with symbols so we can profile it (or on macos use the process sampler). Let's also try `adb shell top` next time this happens; we found that when networking state changes, sometimes, the virtual radio gets in a bad state and starts spinning.
- kaixi 6y agoI need to add hw.audioInput=no hw.audioOutput=no to every AVD I create. Otherwise, the Android Emulator uses 100% CPU all the time, even when it's been idle for minutes. I'm far from the only one having the problem, see https://stackoverflow.com/questions/37063267/high-cpu-usage-with-android-emulator-qemu-system-i386-exe https://stackoverflow.com/questions/37063267/high-cpu-usage-... I'm on a Macbook Air 2014, Intel i5, 8GB of RAM, 500GB SSD. Hardware acceleration, etc. all enabled.
- lfy_google 6y agoInteresting, sounds like a live loop in some audio thread somewhere. What's your audio setup and AVD config.ini? I might be able to reproduce on my Mac.
- lfy_google 6y agoAnd here's the promised emulator build (from aemubins gmail account that we use to distribute debug binaries like this): https://drive.google.com/open?id=1sXEQcoiNpe3Lj8yeaKLasTjqlGQwy4Oi If you still don't get symbols from that it should be possible to build the emulator itself on macos: install repo from depot_tools https://www.chromium.org/developers/how-tos/install-depot-tools https://www.chromium.org/developers/how-tos/install-depot-to... pip install absl-py pip install urlfetch mkdir emu cd emu repo init -u https://android.googlesource.com/platform/manifest -b emu-master-dev --depth=1 repo sync -qcj 4 cd external/qemu python android/build/python/cmake.py # run objs/emulator -avd avdName -no-snapshot Debugging: # when it spins: # method 1: go to activity monitor -> sample process, send over the result # method 2: lldb lldb process attach --pid <pid-of-qemu-system-<arch>> bt all #send it over # method 3: guest process taking CPU adb shell top
- distances 6y ago> I never had any issues with performance (with hardware acceleration). May be on extremely weak laptops it might cause issues, but Android Studio probably will be unusable there at all. I have to use MacBook 13 (2019) in my current project, and it's having troubles with the emulator. Not sure if it's about the hardware or macOS inefficiencies, but I can't wait to get back to my Linux desktop where the emulator is buttery smooth, almost feels like a part of the system itself.
- dahfizz 6y agoDo you know if you have KVM set up? Or whatever the macos equivalent is? The difference in emulating in software vs hardware is massive.
- qwerty456127 6y agoAndroid emulation (I've tried both the bundled emulator and VirtualBox+RemixOS) is the most insanely slow piece of software I've ever seen in my life. It feels like if I were running Windows10 on an original 80386. My laptop is Core2Duo with 4GB RAM, IntelliJ IDEs and everything work great (especially after I've upgraded my HDD to an SSD), desktop and server OSes work great in VirtualBox but Android feels like playing chess via mail. Why does it have to be heavier than desktop Linux&Java? I don't want to upgrade the PC as I love it the way it is and it's enough for everything else. I feel like I'd like to make a simple app for my phone occasionally (just for fun and to make something in my life easier) but emulation seems impossible.
- fomine3 6y agoCore2Duo laptop for Android dev is almost same thing like using 80386.
- qwerty456127 6y agoWhy does Android dev has to be this much heavier than any other task? I'm ok doing .Net, Scala and Python dev (always using the most powerful IDEs), some lo-fi machine learning, running Windows and Linux and heavy Windows apps in VirtualBox, but Android - can't emulate. What I have resorted to is writing single-page JavaScript apps and running them in the browser so I can debug them in the host browser instead of an emulator.
- RussianCow 6y agoHow are you doing all of those things with only 4GB of memory? My wife's old laptop had 3GB, and with about 10 Chrome tabs open, the computer would start swapping and quickly grind to a halt—with no other programs running in the foreground. I just checked memory usage on my own machine and Firefox alone is using over 3GB for me, and IntelliJ another 4GB. Granted, I know many programs tend to use more memory if it's available (for caching, etc), and I also hardly ever restart my machine, but still... Running a full dev environment with 4GB doesn't seem like it should be possible, so I'm curious how yours is so functional.