News for hackers. Stuff that matters.
Re:Android Studio 4.0 by clumsysmurf on Thursday May 28, 2020 @06:37PM (#23343772)
A 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.
Re:Android Studio 4.0 by lfy_google on Thursday May 28, 2020 @08:19PM (#23344808)
Hi, 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.
Re:Android Studio 4.0 by kaixi on Friday May 29, 2020 @11:43AM (#23351331)
I 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-...

I'm on a Macbook Air 2014, Intel i5, 8GB of RAM, 500GB SSD. Hardware acceleration, etc. all enabled.

Re:Android Studio 4.0 by lfy_google on Friday May 29, 2020 @12:59PM (#23352463)
And 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-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
Re:Android Studio 4.0 by kaixi on Friday May 29, 2020 @02:01PM (#23353348)
Sorry, I'm not an expert. What am I supposed to do with the emulator-symbols.zip?
Re:Android Studio 4.0 by lfy_google on Friday May 29, 2020 @02:53PM (#23354018)
Replace your current emulator install; delete $ANDROID_SDK_ROOT/emulator then unzip it there so theres $ANDROID_SDK_ROOT/emulator again.

$ANDROID_SDK_ROOT, if not set, should be set to the SDK location in Android Studio > Preferences > Android SDK (SDK path will show up there).

Set it in your ~/.bash_profile too so it's there next time for running the emulator from the command line.

The AVD config.ini can be found in ~/.android/avd/nameofAvd.avd/config.ini .

Re:Android Studio 4.0 by lfy_google on Friday May 29, 2020 @12:35PM (#23352131)
Interesting, 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.