This document describes how to get started with emulator development under windows.
This section is only relevant if you work at Google.
In order to develop the android emulator in gWindows you will need to meet the following requirements.
Note: The gWindows machines are locked down very well and you will experience some performance penalties due to this. You are highly encouraged to develop in GCE
Install the following:
If you are using Chocolatey, you can install all the dependencies with the following command in an elevated terminal window (i.e. type Win-R key then type “cmd”):
C:\> @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" C:> choco install -y python2 visualstudio2017community visualstudio2017-workload-vctools visualstudio2017-workload-nativedesktop cmake
You must run visual studio at least once to accept a license and do some initial configuration.
Make sure your account has SeCreateSymbolicLinkPrivilege. The easiest way to make sure you have this is to open every terminal window with administrator privileges.
Once you have installed everything you can validate that you have what you need on the path by executing:
C:\> where git && where python C:\Program Files\Git\cmd\git.exe C:\python_27_amd64\files\python.exe
Git might not be configured properly to handle symlinks well on windows. Make sure you have the following settings set:
C:\> git config --system core.symlink true C:\> git config --global core.symlink true
Note: The instructions in this section are for using the native Windows version of the repo
tool, where “native” is used to mean without “cygwin”.
There are 2 advantages running with Windows native tools:
From a PowerShell window (i.e. type Win-R key then type “Powershell”):
PS C:\Users\hacker> md "$env:USERPROFILE\bin\" PS C:\Users\hacker> $wc = New-Object Net.WebClient PS C:\Users\hacker> $wc.DownloadFile('http://storage.googleapis.com/git-repo-downloads/repo', "$env:USERPROFILE\bin\repo") PS C:\Users\hacker> '@call python %~dp0repo %*' | Out-File -FilePath "$env:USERPROFILE\bin\repo.cmd"
Make sure to add "$env:USERPROFILE\bin"
to the PATH
, otherwise you will not be able to use repo. For the example above this would be: C:\Users\hacker\bin"
.
Note: If the output of “repo” commands produce escaped ANSI codes (e.g. “ESC[m”), try the following:
C:> set LESS=-r
You can initialize repo as follows:
C:> cd %USERPROFILE%\src && mkdir emu-master-dev && cd emu-master-dev C:> repo init -u https://android.googlesource.com/platform/manifest -b emu-master-dev
Note: we are not using persistent-https to initialize the repo, this means performance will not be as good as it could be.
Sync the repo (and get some coffee, or a have a good nap.)
C:> cd %USERPROFILE%\src\emu-master-dev && repo sync -f --no-tags --optimized-fetch --prune
Congratulations! You have all the sources you need. Now run:
C:> cd %USERPROFILE%\src\emu-master-dev\external\qemu && android\rebuild
Setup git cookies so you can repo upload by following this link: https://www.googlesource.com/new-password.
Make sure you have configured the proper user name and email address:
C:\>git config --global user.name "I just copy pasted this without looking" C:\>git config --global user.email wrong-do-it-again@badrobot.com
Here you can find more details on submitting patches.
Our cmake files rely on the visual studio environment variables to be set as they are used to properly configure the compiler toolchain. The easiest workaround is to start visual studio code from the command line after loading the visual studio variables. Look for the line: Accepted, setting env with
in the output from rebuild.cmd
.