Can't launch AVD on macOS 10.13 - macos

I created some AVDs in Android studio 3.0, but I can't launch them. I used the following command to launch them:
./emulator #Nexus_5X_API_17
logs:
emulator: WARNING: encryption is off
Hax is enabled
Hax ram_size 0x60000000
Failed to open vm 3
Failed to create HAX VM
No accelerator found.
failed to initialize HAX: Invalid argument
And when I reinstalled "Intel x86 Emulator Accelerator(HAXM installer)", the logs:
HAXM silent installation only supports macOS from 10.8 to 10.12 !
I don't know if it is related with this.
After that, I tried to install virtualBox to install genymotion, but I found when I clicks the virturalBox.dmg, the installer crashed.
Could you help me? thanks.

Use the new Hypervisor.Framework support instead of HAXM on macOS, as described in the comments of the issue filed for this:
Try running the emulator on Canary channel 26.1.x (API 25/26
recommended) with Hypervisor.Framework; put the text "HVF = on" in
~/.android/advancedFeatures.ini (create this file if it doesn't exist
already).

You can download and install the latest version haxm
https://github.com/intel/haxm/releases/latest

Following steps worked for me:
Uninstall HAXM from android studio SDK manager (Tools->Android->SDK Manager->SDK Tools then uninstall 'Intel x86 Emulator Accelerator (HAXM)' by unchecking it.
Download the HAXM version 6.2.1 zip file from Intel site https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement-macosx
Install the .dmg file
Restart your computer
Open your AVD having x86_64 image and it should work.

Go to your SDK installation directory, and manually run the HAXM installer. See step 4 on the page: https://developer.android.com/studio/run/emulator-acceleration.html#vm-mac
Technically HAXM is only officially supported up until MacOS 10.12 (Sierra) . Since MacOS 10.13 is still in beta, there may be a bug or incompatible API. If the wizard does no work, please file a bug here for the Android Emulator dev team to investigate further: https://source.android.com/source/report-bugs

Go to Tools->Android->SDK Manager, then in the SDK tools search for Intel x86 Emulator Accelerator (HAXM installer) and update to the latest version, restart and thats all!

On install/reinstall of HAXM you get:
HAXM silent installation only supports macOS from 10.8 to 10.12 !
From https://issuetracker.google.com/issues/62395878#comment44
in System Preferences > Security & Privacy > General, there was a message “System software from developer xxx was blocked from loading.” with an Allow button. Clicking the allow button enabled HAXM again

I just redownloaded the simulator and it worked.

Related

How can I launch Android Emulator without android studio on Mac M1

I'm trying to start the emulator with this command emulator -avd Pixel_4_API_30 but it gives me an error:
[8633370112]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '/Users/primulax/../emulator/qemu/darwin-x86_64/qemu-system-aarch64': No such file or directory
Android Studio specs:
Build #AI-203.7717.56.2031.7935034, built on November 21, 2021
Runtime version: 11.0.10+0-b96-7249189 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.2
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin
✅ I was able to run with ~/Library/Android/sdk/emulator/emulator -avd Pixel_4_API_30 with this command
Use ~/Library/Android/sdk/emulator/emulator instead of ~/Library/Android/sdk/tools/emulator on MacOS, for Ubuntu use ~/Android/Sdk/emulator/emulator.
I just experienced the same issue on a freshly setup machine, emulator installed through SDK manager and all.
The error message says it all actually: If you go to /Users/primulax/../emulator/qemu/ on your machine, you'll notice that of course there is no darwin-x86_64 directory, but darwin_aarch64, since you are on an M1 machine. Whatever the reason is the emulator looks in the wrong directory, if you just duplicate the darwin_aarch64 folder and name your copy darwin-x86_64, it works as intended. Not ideal, but it's a workaround until this path-problem is fixed.
Edit: Please take a look at #Andrew Stromme's comment. Of course symlinking is a much more elegant solution to this problem!
If you have Android Studio installed, you can run the emulator from terminal without having started Android Studio first.
First of all, run
cd ~/Android/Sdk/tools && ./emulator -list-avds
to get a list of all the available Android virtual devices that you have installed.
Then, copy the name of the virtual device you want to use and run
cd ~/Android/Sdk/tools && ./emulator -avd YOUR_DEVICE_NAME
where you replace "YOUR_DEVICE_NAME" with the name of a virtual device that was listed in the installed virtual devices list.
This info and more that you may find useful can be found in the official documentation.
Now for the error you get it's most possibly due to a wrong file path. It seems that others have also faced this issue and a bug has been opened before here. The most common solution proposed is to launch emulator from the
/path/to/android-sdk/tools
directory in command line.
Also, before trying this or any other solution listed in this issue tracker, firstly make sure that you have installed from the SDK Manager the Android Emulator in SDK Tools.

Failed to initiate service connection to simulator xcode 11.4.1 and 11.3 and 11.4-beta

When I build and run any project on Xcode, I face this error:
On the other hand, when I using command-line and install and launch the app by commands, I can see logs and everything is ok.
I did see other similar questions and I did try solutions like the clean project, build and reset and restart simulator and reinstall various versions of Xcode, but didn't fix.
My OS:
Mac Os Catalina 10.15.4
I removed some additional kexts from EFI partition, this problem solved!.
Thanks to Jeremy Huddleston Sequoia

NativeScript Installation Issues

I was just trying to install NavtiveScript, for this I followed the official installation guide available at
http://docs.nativescript.org/angular/start/quick-setup but I am stuck at "Step 3: Install iOS and Android requirements"
When I run the below command in Command Prompt (with administrative privileges)
#powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://www.nativescript.org/setup/win'))"
Everything seems to be installed without any issue. But when I try to verify the installation through command, "tns doctor" I returns below warnings:
D:\>tns doctor
WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to install the Android SDK and its dependencies.
WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to build your projects for Android and run them in the native emulator.
To be able to build for Android and run apps in the native emulator, verify that you have
installed the latest Android SDK and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to install the Android SDK and its dependencies.
NOTE: You can develop for iOS only on Mac OS X systems.
To be able to work with iOS devices and projects, you need Mac OS X Mavericks or later.
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.
Run $ android to manage your Android SDK versions.
You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=24'.
Run android from your command-line to install required Android Build Tools.
You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.
Run $ android to manage the Android Support Repository.
Can anyone please guide?
I am using Windows 10, and have Visual Studio 2015 (update 3) and Visual Studio Code installed on my machine.
The command line of installing Android also didn't work for me and gave me the same errors as you. I figured out this by downloading and installing Android Studio. After your installation, you should be able to find the location of the android sdk, which is /Users/myMacUserName/Library/Android/sdk in my situation. And you could select all the needed things through SDK Manager. In the terminal, you then do 'export ANDROID_HOME=/Users/myMacUserName/Library/Android/sdk' instead of the command from NativeScript installtion instruction 'export ANDROID_HOME=/usr/local/opt/android-sdk'. After all these, you should be okay with the Android SDK errors.
https://developer.android.com/studio/index.html
Install the android studio from the above link and then after that run the studio and install the desired android sdk packages from within the studio.

/dev/kvm not found on mac

So I've been working with android studio 2.0 beta on my Mac and AVD was working fine.
But then I notice that android studio can't launch AVD now. It says /dev/kvm not found. enable VT-x in your bios security settings, ensure that your linux distro has working kvm module.
The thing is: I didn't touch bios settings at all. Possible causes :
VMWare - I was playing with virtual machines and configuring new networks for vm's just before I noticed the error.
CleanMyMac - I also used this app to clean the system
other causes are possible, but I never entered BIOS or touched system settings
The solutions on resolving this issue I found all refer to Linux, rather than Mac. How would I fix this?
EDIT:
I reinstalled OS X (without formatting hard drive). That didn't work.
Here is the solution that worked me.
Well, Android Studio need HAXM to run emulator.
The issue is that the HAXM drivers doesn’t support the beta version of Mac Os High Serria yet.
The driver works but with a little bit of additional command.
First, you will need to disable the Security Protection on kext. The drivers is not sign for this version.
From https://apple.stackexchange.com/a/269777:
Get into Recovery Mode by restarting and holding down ⌘+R until Apple logo appears.
In the top menu click Utilities > Terminal.
In the Terminal window type and press Enter:
csrutil enable --without kext
Then restart the Mac.
Then you can install HAXM from:
Download the driver from here https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager/ and unzip it.
Open a terminal and go to the directory of the driver :
cd Downloads/haxm-macosx_v6_2_0
# edit the file and look for 10.12
nano silent_install.sh
CTRL + W
10.12
Add 10.13 after 10.12, and save the file ( CTRL+X, Y, ENTER)
Run it:
./silent_install.sh
To be sure it works:
sudo kextload -bundle-id com.intel.kext.intelhaxm
Now your emulator should work !
Just remove the previous HAXM and install IntelHAXM_6.0.3.dmg in haxm-macosx_v6_0_3.zip
here is download link haxm-macosx_v6_0_3.zip
its work for me!
/dev/kvm not found on mac.
Follow the steps. You can solve your problem.
Step1: Download Intel HAXM from software.intel.com.
Step2: Extract and Open the file name like “IntelHAXM_6.2.1.dmg”.
Step3: Double click on “IntelHAXM_6.2.1.mpkg” to Install manually.
Step4: Read and Install carefully.
Step5: When you receive Security warning for new extension goto system preferences and Click “Allow” button.
Step6: That’s it. Now you can run the emulator.
(Note : Incase you get same error again. Please Re-Install the
“IntelHAXM_6.2.1.mpkg” Once again. That’s really fix your problem.)
Happy coding... :-)
Enter your VM settings and then search for virtualization engine :
Check the virtualize Intel VT-x/EPT or AMD-RVI option.
This should resolve the problem.
Your MacOS need to enable Intel VT-x
Reference:
enable Intel VT-x

Attempt to install Qt on OS X gives 'You need to install Xcode 5.0.0', but this version is so old it's not available

I am a Windows/Linux developer who occasionally builds for OS X - particularly in Qt.
I have a simple Qt project that I have been developing on Windows. I now wish to build it on OS X.
I am running Yosemite. I have installed Xcode 7 and am attempting to install Qt 5.5.
When I run the Qt installer, immediately after the prompt to log in to Qt (which is successful), I receive the following error:
You need to install Xcode version 5.0.0.
I have attempted to locate Xcode 5.0.0 on the Apple Developer site, but this is 2 major versions behind the most recent version, and I cannot even find an installer for it.
More to the point, I do wonder why the most recent version of Qt requires a version of Xcode that is considered so old by Apple that it's not even available.
How do I overcome this problem so that I can get Qt installed on OS X?
I ran into the same problem and solved it by following the instructions here. This link describes a similar, but slightly different installer issue.
To summarize, you need to ensure that the Xcode command line tools are installed and set up correctly. I already had them installed, but had to go into Preferences -> Locations in Xcode and set the dropdown to the currently installed version.
The link shows an earlier version of Xcode where the path is actually Preferences -> Downloads -> Components.
Once I'd made this change, the installer continued successfully.
The solution that worked for me (on OSX Sierra XCode 8.2.1) is to open XCode Preferences -> Locations.
There is a drop-down menu named Command Line Tools. Select the available XCode version here. Then restart the Qt Creator installation.
taken from the link above, this resolved my issue:
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer
For me closing the prompt and smashing keys (alt F4, I know that its not windows) before the next prompt opened worked... qt is running fine now, as it doesn't need the old version.
you can find the old version of XCode on the the Apple offical site here and download .dmg of xcode 5 or 6.1 for example :
I do this and it's ok for me.

Resources