Datasets:
Download web/detox.github.io/reference/site/docs/guide/android-dev-env/index.html from Qwen/RecreationBench: direct link, hf CLI and curl.
- Browser
- Download file 83.3 kB
-
https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/detox.github.io/reference/site/docs/guide/android-dev-env/index.html
- Command line
-
hf download hf://datasets/Qwen/RecreationBench/web/detox.github.io/reference/site/docs/guide/android-dev-env/index.html
-
curl -L -o index.html https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/detox.github.io/reference/site/docs/guide/android-dev-env/index.html
83.3 kB
| <html class="docs-wrapper docs-doc-page docs-version-20.x plugin-docs plugin-id-default docs-doc-id-guide/android-dev-env show--consent" data-has-hydrated="true" data-rh="lang,dir,class,data-has-hydrated" data-theme="dark" dir="ltr" lang="en"><head> | |
| <meta charset="utf-8"/> | |
| <meta content="Docusaurus v2.4.3" name="generator"/> | |
| <title>Setting Up an Android Development & Testing Environment | Detox</title><meta content="summary_large_image" data-rh="true" name="twitter:card"/><meta content="en" data-rh="true" name="docusaurus_locale"/><meta content="en" data-rh="true" name="docsearch:language"/><meta content="20.x" data-rh="true" name="docusaurus_version"/><meta content="docs-default-20.x" data-rh="true" name="docusaurus_tag"/><meta content="20.x" data-rh="true" name="docsearch:version"/><meta content="docs-default-20.x" data-rh="true" name="docsearch:docusaurus_tag"/><meta content="Setting Up an Android Development & Testing Environment | Detox" data-rh="true" property="og:title"/><meta content="This guide provides some core practices to follow in setting up a stable, reliable environment for running automated UI tests using Android emulators (using Detox, in particular) – be it on a personal, local computer, or a powerful CI machine." data-rh="true" name="description"/><meta content="This guide provides some core practices to follow in setting up a stable, reliable environment for running automated UI tests using Android emulators (using Detox, in particular) – be it on a personal, local computer, or a powerful CI machine." data-rh="true" property="og:description"/><link data-rh="true" href="/img/favicon.ico" rel="icon"/><link crossorigin="anonymous" data-rh="true" href="/_404.html" rel="preconnect"/><link href="/blog/rss.xml" rel="alternate" title="Detox RSS Feed" type="application/rss+xml"/> | |
| <link href="/blog/atom.xml" rel="alternate" title="Detox Atom Feed" type="application/atom+xml"/> | |
| <link href="/_404.html" rel="preconnect"/> | |
| <link href="/_404.html" rel="preconnect"/> | |
| <link href="/_404.html" rel="preconnect"/> | |
| <script>window.dataLayer=window.dataLayer||[]</script> | |
| <link href="/opensearch.xml" rel="search" title="Detox" type="application/opensearchdescription+xml"/> | |
| <script async="" src="/_cdn/platform.twitter.com/widgets.js"></script><link href="/assets/css/styles.2561cce4.css" rel="stylesheet"/> | |
| <link as="script" href="/assets/js/runtime~main.12cb17c3.js" rel="preload"/> | |
| <link as="script" href="/assets/js/main.899efd46.js" rel="preload"/> | |
| <link data-rh="true" href="/docs/guide/android-dev-env/" rel="canonical"/><link data-rh="true" href="/docs/guide/android-dev-env/" hreflang="en" rel="alternate"/><link data-rh="true" href="/docs/guide/android-dev-env/" hreflang="x-default" rel="alternate"/><meta content="width=device-width, initial-scale=1.0" data-rh="true" name="viewport"/><meta content="/docs/guide/android-dev-env/" data-rh="true" property="og:url"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/656a21b7.a26779fc.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/f14c3b1d.750d68cc.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/79ac7843.08fb5e78.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/f97fefc4.29cab279.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/4898f926.0e96a759.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/c50db514.a97d11c5.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/dbe4f0b7.d3caf837.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/5b12c1a9.ead7646c.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/6af18994.4007fd2f.js" rel="prefetch"/><link href="/assets/js/c4f5d8e4.1d727c7d.js" rel="prefetch"/><link href="/assets/js/0ef19a76.b6a3804a.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/f431fa1f.7f13cf06.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/ae694851.b9d9a10d.js" rel="prefetch"/><link href="/assets/js/a6aa9e1f.f7d63002.js" rel="prefetch"/><link href="/assets/js/181d712d.f728104a.js" rel="prefetch"/><link href="/assets/js/814f3328.368bc5eb.js" rel="prefetch"/><link href="/assets/js/83eb08f7.4d5ec241.js" rel="prefetch"/><link href="/assets/js/9292650b.f26ac725.js" rel="prefetch"/><link href="/assets/js/933bed1e.d56d75f0.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/bab8a798.39e6da23.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/649c4fa3.32cb9131.js" rel="prefetch"/><link href="/assets/js/5fc994c2.0a3b56b5.js" rel="prefetch"/><link href="/assets/js/0ef19a76.b6a3804a.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/d9894068.9ef62e7b.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/a3ba877c.32533a8c.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/fc9f0a8f.1f41c3a1.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/935f2afb.d4cfcd14.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/0b851b4d.c0828607.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/435645a6.e680c3f3.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/f2f4b8a7.6cd9dbcb.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/74a579df.695a0440.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/3f859f05.9d44a484.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/7d2f6bd9.fa97c7d0.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/7dcc0419.4052de6f.js" rel="prefetch"/><link href="/_cdn/unpkg.com/@68publishers/cookie-consent/dist/cookie-consent.css" rel="stylesheet"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/45e366b7.00b7e983.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/a4761f6f.ea064397.js" rel="prefetch"/></head> | |
| <body class="navigation-with-keyboard" data-rh="class" style="overflow: visible;"> | |
| <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"><div class="banner_SLir"><a class="link_SNdm" href="/_404.html" rel="noopener noreferrer" target="_blank"><span class="uaFlag_wtbk"></span> This project is created with substantial contributions from our Ukrainian colleagues.<!-- --> <span class="hashtag_KSDo">#StandWithUkraine</span></a></div><div aria-label="Skip to main content" role="region"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-expanded="false" aria-label="Toggle navigation bar" class="navbar__toggle clean-btn" type="button"><svg aria-hidden="true" fill="currentColor" height="12" viewbox="0 0 19 12" width="19"><rect height="1" rx="0.5" stroke="currentColor" stroke-linecap="round" width="18" x="0.5" y="5.5"></rect><rect height="1" rx="0.5" stroke="currentColor" stroke-linecap="round" width="18" x="0.5" y="10.5"></rect><rect height="1" rx="0.5" stroke="currentColor" stroke-linecap="round" width="18" x="0.5" y="0.5"></rect></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img alt="Detox Logo" class="themedImage_ToTc themedImage--dark_i4oU" src="/img/logo.png"/></div><b class="navbar__title text--truncate">Detox</b></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/introduction/getting-started">Docs</a><a class="navbar__item navbar__link" href="/docs/config/overview">API</a><a class="navbar__item navbar__link" href="/docs/contributing">Contribute</a><a class="navbar__item navbar__link" href="/blog">Blog</a><a class="navbar__item navbar__link header-showcase-link" href="/showcase">Showcase</a></div><div class="navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a aria-expanded="false" aria-haspopup="true" class="navbar__link" href="/docs/introduction/getting-started" role="button">20.x</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/docs/next/guide/android-dev-env">Next</a></li><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/docs/guide/android-dev-env">20.x</a></li><li><a class="dropdown__link" href="/docs/19.x/">19.x</a></li></ul></div><a aria-label="GitHub repository" class="navbar__item navbar__link header-github-link" href="/_404.html" rel="noopener noreferrer" target="_blank"></a><div class="toggle_vylO colorModeToggle_DEke"><button aria-label="Switch between dark and light mode (currently dark mode)" aria-live="polite" class="clean-btn toggleButton_gllP" title="Switch between dark and light mode (currently dark mode)" type="button"><svg class="lightToggleIcon_pyhR" height="24" viewbox="0 0 24 24" width="24"><path d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z" fill="currentColor"></path></svg><svg class="darkToggleIcon_wfgR" height="24" viewbox="0 0 24 24" width="24"><path d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z" fill="currentColor"></path></svg></button></div><div class="searchWrapper_jYdA searchBox_ZlJk"><button aria-label="Search (Ctrl+K)" class="DocSearch DocSearch-Button" type="button"><span class="DocSearch-Button-Container"><svg aria-hidden="true" class="DocSearch-Search-Icon" height="20" viewbox="0 0 20 20" width="20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"><svg class="DocSearch-Control-Key-Icon" height="15" width="15"><path d="M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953" fill="none" stroke="currentColor" stroke-linecap="square" stroke-width="1.2"></path></svg></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div></div></div><div class="navbar-sidebar__backdrop" role="presentation"></div></nav><div class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX" id="__docusaurus_skipToContent_fallback"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a aria-expanded="false" class="menu__link menu__link--sublist menu__link--sublist-caret" href="#">Introduction</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a aria-expanded="true" class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" href="#">Guides</a></div><ul class="menu__list" style="display:block;overflow:visible;height:auto"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/test-id" tabindex="0">Adding test ID's to your components</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/parallel-test-execution" tabindex="0">Parallel Test Execution</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/detox-repl" tabindex="0">Debugging with Detox REPL</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/typescript" tabindex="0">Using TypeScript</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/testing-webviews" tabindex="0">Testing WebViews</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/genymotion-saas" tabindex="0">Using Genymotion SaaS</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/taking-screenshots" tabindex="0">Taking Screenshots</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/mocking" tabindex="0">Mocking</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/launch-args" tabindex="0">Using Launch Arguments</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/mocking-open-with-url" tabindex="0">Mocking Open With URL (Deep Links)</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/mocking-user-notifications" tabindex="0">Mocking User Notifications</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/mocking-user-activity" tabindex="0">Mocking User Activity</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/developing-while-writing-tests" tabindex="0">Developing Your App While Writing Tests</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a aria-current="page" class="menu__link menu__link--active" href="/docs/guide/android-dev-env" tabindex="0">Setting Up an Android Development & Testing Environment</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/proguard-configuration" tabindex="0">ProGuard configuration</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/cucumber-js-integration" tabindex="0">Cucumber.js Integration</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/guide/uninstalling" tabindex="0">Uninstalling Detox</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a aria-expanded="false" class="menu__link menu__link--sublist menu__link--sublist-caret" href="#">Pilot-Powered Detox Testing</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a aria-expanded="false" class="menu__link menu__link--sublist menu__link--sublist-caret" href="#">Troubleshooting</a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/guide/migration">Migration Guide</a></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav aria-label="Breadcrumbs" class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg class="breadcrumbHomeIcon_YNFT" viewbox="0 0 24 24"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Guides</span><meta content="1" itemprop="position"/></li><li class="breadcrumbs__item breadcrumbs__item--active" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"><span class="breadcrumbs__link" itemprop="name">Setting Up an Android Development & Testing Environment</span><meta content="2" itemprop="position"/></li></ul></nav><span class="theme-doc-version-badge badge badge--secondary">Version: 20.x</span><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button class="clean-btn tocCollapsibleButton_TO0P" type="button">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Setting Up an Android Development & Testing Environment</h1></header><p>This guide provides some core practices to follow in setting up a stable, reliable environment for running automated UI tests using Android emulators (using Detox, in particular) – be it on a personal, <em>local</em> computer, or a powerful CI machine.</p><p>Note that running automated UI tests is <em>not the same</em> as developing Android apps. Hence, you may find yourself not 100% aligned with the recommendations here, and should consider being so.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="java-setup">Java Setup<a aria-label="Direct link to Java Setup" class="hash-link" href="#java-setup" title="Direct link to Java Setup"></a></h2><p>This is the most basic step in the process, as without a proper Java SDK installed, nothing Android-ish works – at least not from command-line, which is mandatory for executing <code>Detox</code>.</p><p><em>The bottom line is that <strong>Android needs Java installed</strong>. If you want to run with React Native 73 and Android 14 then it needs to be at least Java 17, otherwise you should have Java 11.</em></p><p>To check for your real java-executable’s version, in a command-line console, run:</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-bash codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">java -version</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>What needs to be verified is that <code>java</code> is in-path and that the output contains something like this:</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-bash codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">java version </span><span class="token string" style="color: rgb(255, 121, 198);">"17.x.x"</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token punctuation" style="color: rgb(248, 248, 242);">..</span><span class="token plain">.</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><blockquote><p>Note: Do not be confused by the Java version potentially used by your browsers, etc. For <code>Detox</code>, what the command-line sees is what matters.</p></blockquote><hr/><p>If <code>java -version</code> yields an error, it is likely that <code>java</code> is either not in your path or not even installed at all. To try to understand which of the two is true, use <a href="https://www.java.com/en/download/help/path.xml" rel="noopener noreferrer" target="_blank">this guide</a>.</p><p>If otherwise the version is simply wrong, try these course of actions:</p><ul><li>On MacOS, in particular, Java comes from both the OS <em>and</em> possibly other installers such as <code>homebrew</code>. That can really get things tangled up. To mitigate:<ul><li>Use one of the options suggested in this <a href="/_404.html" rel="noopener noreferrer" target="_blank">Stack Overflow post</a>.</li><li>Install OpenJDK 17 on top of the existing versions (<a href="/_404.html" rel="noopener noreferrer" target="_blank">how to check?</a>): <a href="/_404.html" rel="noopener noreferrer" target="_blank">https://java.tutorials24x7.com/blog/how-to-install-openjdk-17-on-mac</a>. Consider employing the <code>JAVA_HOME</code> variable to get things to work right. <em>Note: This is more suitable if your environment is fairly clean, and does not contain versions from 3rd-party installers (e.g. <code>homebrew</code>).</em></li></ul></li><li>Use these refs, which might be useful:<ul><li><a href="https://java.com/en/download/faq/java_mac.xml#version" rel="noopener noreferrer" target="_blank">https://java.com/en/download/faq/java_mac.xml#version</a></li><li><a href="https://www.java.com/en/download/help/version_manual.xml" rel="noopener noreferrer" target="_blank">https://www.java.com/en/download/help/version_manual.xml</a></li></ul></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="android-sdk">Android SDK<a aria-label="Direct link to Android SDK" class="hash-link" href="#android-sdk" title="Direct link to Android SDK"></a></h2><p>If you have Android Studio installed - as most of us do, then the SDK should be available for you somewhere on your machine<sup>*</sup>. However, for CI agents – possibly running with no GUI, or if you simply don’t want the somewhat bloated piece of software on your computer, it is possible to simply download the SDK and tool-set, purely. Both cases are covered in Google’s <a href="/_404.html" rel="noopener noreferrer" target="_blank">Android guide about Android Studio</a>. For the pure-tools option, refer to the <code>Command line tools only</code> section at the bottom.</p><p>For more help on setting the SDK up, <a href="/_404.html" rel="noopener noreferrer" target="_blank">this guide might be helpful</a>.</p><p>Whatever option you choose, and whichever platform you’re running on (Mac, Linux, Windows), we strongly recommend that eventually you would have 2 additional things set up:</p><ul><li>The path to the SDK’s root directory is set into the <code>ANDROID_SDK_ROOT</code> <a href="/_404.html" rel="noopener noreferrer" target="_blank">environment variable</a>.</li><li>The path to the SDK’s root directory is bundled into the global <a href="/_404.html" rel="noopener noreferrer" target="_blank"><code>PATH</code></a> on your computer.</li></ul><p><em><sup>*<!-- --> Inspect the content of your <code>ANDROID_SDK_ROOT</code> and <code>ANDROID_HOME</code> environment variables.</sup></em></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="android-aosp-emulators">Android (AOSP) Emulators<a aria-label="Direct link to Android (AOSP) Emulators" class="hash-link" href="#android-aosp-emulators" title="Direct link to Android (AOSP) Emulators"></a></h2><p>Mobile-apps’ automation needs an Android device to run on. If you haven’t already done so, you should <a href="/_404.html" rel="noopener noreferrer" target="_blank">set up an Emulator</a>. But, wait - don’t go and install the default one: read through, first.</p><p>We’ve long proven that for automation - which requires a stable and deterministic environment, Google’s emulators running with Google APIs simply don’t deliver what’s needed. Be it the preinstalled Google play-services - which tend to take up a lot of CPU, or even Google’s <code>gboard</code> Keyboard - which is full-featured but overly bloated: These encourage flakiness in tests, which we are desperate to avoid in automation.</p><p>Fortunately, the Android team at Google offers a pretty decent alternative: <strong>AOSP emulators</strong> (Android Open-Source Project). While possibly lacking some of the extended Google services, and a bit less fancy overall, <strong>we strongly recommend</strong> to strictly use this flavor of emulators for running automation/Detox tests. They can be installed alongside regular emulators.</p><p><em>Here’s a visual comparison between the two - an SDK 28 (Android 9) AOSP emulator (left) vs. an emulator with Google APIs installed (right):</em></p><p><img alt="AOSP vs Google-API" class="img_ev3q" height="747" loading="eager" src="/assets/images/aosp-vs-googleapi-852e709646c53864192b23bb47aedcd5.png" width="844"/></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="heres-how-to-install-them-using-the-command-line">Here’s how to install them using the command line<a aria-label="Direct link to Here’s how to install them using the command line" class="hash-link" href="#heres-how-to-install-them-using-the-command-line" title="Direct link to Here’s how to install them using the command line"></a></h3><p>While it’s possible to do this using Android Studio, we’ll focus on the command line, as it is also good for <em>headless</em> CI machines.</p><ol><li><p>Locate your 'Android home' folder - typically set in the <code>ANDROID_HOME</code> environment variable, or in its predecessor - <code>ANDROID_SDK_ROOT</code>. If <code>ANDROID_HOME</code> isn’t set, either set it yourself or run the following commands after <code>cd</code>-ing into the home folder.</p></li><li><p>Preliminary: Upgrade your <code>emulator</code> executable to the latest version. | |
| <em>Note: It is OK if the emulator’s version is not aligned with the SDK or platform-tools’ version you currently have installed (e.g. 30.x.x vs. SDK 29)</em></p><div class="language-sh codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-sh codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install emulator</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>In previous Android Studio versions, the SDK-Manager path was located at <code>$ANDROID_HOME/tools/bin/sdkmanager</code>. | |
| We highly recommend working with the latest version, however, in case you are working with an old version, and this command fails, try this path instead.</p><p>The command might also fail if the command-line tools aren’t installed. To install the tools using Android Studio, click <code>Tools > SDK Manager</code> and select the <code>SDK Tools</code> tab. Ensure that <code>Android SDK Command-line Tools (latest)</code> is checked and applied.</p></div></div></li><li><p>Install an emulator image without Google APIs:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-shell codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token variable" style="color: rgb(189, 147, 249); font-style: italic;">$ANDROID_HOME</span><span class="token plain">/cmdline-tools/latest/bin/sdkmanager </span><span class="token string" style="color: rgb(255, 121, 198);">"system-images;android-28;default;x86_64"</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token variable" style="color: rgb(189, 147, 249); font-style: italic;">$ANDROID_HOME</span><span class="token plain">/cmdline-tools/latest/bin/sdkmanager --licenses</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Toggle word wrap" class="clean-btn" title="Toggle word wrap" type="button"><svg aria-hidden="true" class="wordWrapButtonIcon_Bwma" viewbox="0 0 24 24"><path d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z" fill="currentColor"></path></svg></button><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><blockquote><ul><li>With <code>;android-28;</code>, we assumed SDK 28 here, but other APIs are supported just the same.</li><li>The <code>;default;</code> part replaces <code>;google_apis;</code>, which is the default, and is what matters here.</li><li>If you are running on a M1 you must install an arm64 architecture i.e. <code>system-images;android-28;default;arm64-v8a</code></li><li>To get a list of available images, run <code>$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --list</code></li></ul></blockquote></li><li><p>Create an emulator (i.e. AVD - Android Virtual Device):</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-shell codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token variable" style="color: rgb(189, 147, 249); font-style: italic;">$ANDROID_HOME</span><span class="token plain">/cmdline-tools/latest/bin/avdmanager create avd -n Pixel_API_28_AOSP -d pixel --package </span><span class="token string" style="color: rgb(255, 121, 198);">"system-images;android-28;default;x86_64"</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Toggle word wrap" class="clean-btn" title="Toggle word wrap" type="button"><svg aria-hidden="true" class="wordWrapButtonIcon_Bwma" viewbox="0 0 24 24"><path d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z" fill="currentColor"></path></svg></button><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><blockquote><ul><li><code>Pixel_API_28_AOSP</code> is just a suggestion for a name. Any name can work here, even <code>Pixel_API_28</code> - but you might have to delete an existing non-AOSP emulator, first. In any case, the name used in Detox configuration (typically in <code>package.json</code>) should be identical to this one.</li><li><code>-d pixel</code> will install an emulator with the specs of a Pixel-1 device. Other specs can be used. Running <code>$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager list devices</code> will list all available device specs.</li><li><code>--package</code> is the most important argument: be sure to use the same value as you did in part 2, above, with <code>;default;</code>.</li></ul><p>Run <code>avdmanager create --help</code> for the full list of options.</p></blockquote></li><li><p>Launch the emulator:</p></li></ol><p>This isn’t mandatory, of course, but it’s always good to launch the emulator at least once before running automated tests. The section below will discuss optimizing emulators bootstrapping.</p><p>At this point, you should be able to launch the emulator from Android Studio, but that can also be done from a command line console, as explained in the <a href="#locating-the-avds-home-directory">cheatsheet below</a>.</p><blockquote><p>See <a href="/_404.html" rel="noopener noreferrer" target="_blank">this guide</a> for full details on the <code>emulator</code> executable.</p></blockquote><h3 class="anchor anchorWithStickyNavbar_LWe7" id="installing-from-android-studio">Installing from Android Studio<a aria-label="Direct link to Installing from Android Studio" class="hash-link" href="#installing-from-android-studio" title="Direct link to Installing from Android Studio"></a></h3><p>We won’t go into all the details but once the proper image is installed using the <code>sdkmanager</code>, the option becomes available in the AVD creation dialog (see <code>Target</code> column of the Virtual Device Configuration screen below):</p><p><img alt="SDK manager in AS" class="img_ev3q" height="929" loading="eager" src="/assets/images/aosp-image-as-37ababd9a7fb486a0bde4055e29cee14.png" width="1109"/></p><p><img alt="Install AOSP in AS" class="img_ev3q" height="791" loading="eager" src="/assets/images/install-aosp-as-487bc180542ec85812f0b6042f1ee67a.png" width="1131"/></p><p>Also, be sure to upgrade your emulator executable to the latest version: If it isn’t up-to-date, you will get an "Update Available" message under the <em>status</em> column, instead of "Installed":</p><p><img alt="Upgrade emulator in AS" class="img_ev3q" height="834" loading="eager" src="/assets/images/upgrade-emulator-as-6b05bdb7dd36d8c4ddb3f37bef9fbe1f.png" width="1094"/></p><p><strong>Note:</strong> <em>It is OK if the emulator’s version is not aligned with the SDK or platform-tools’ version you currently have installed (e.g. 30.x.x vs. SDK 29)</em></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="emulator-quick-boot">Emulator Quick-Boot<a aria-label="Direct link to Emulator Quick-Boot" class="hash-link" href="#emulator-quick-boot" title="Direct link to Emulator Quick-Boot"></a></h2><p>If the system allows saving a state (for example, in personal computers or a CI system that can start from prebaked images you can configure), we highly and strongly recommend setting up quick-boot snapshots for any emulator that is used for testing automation.</p><p>Quick-boot saves significant time otherwise wasted when emulators cold-boot from scratch. The concept becomes more prominent in environments capable of parallel-executing tests in multiple, concurrently running emulators (as when <a href="/docs/config/testRunner">Detox is run with multiple Jest workers</a>).</p><p>This is something that we actually recommend applying in the emulator itself rather than using command-line, but we’ll include both options.</p><p>In any case, the general principle we’re going to instruct is as follows:</p><ol><li>Enable auto-save for an installed / running emulator.</li><li>Launch it, and, when stable, terminate – a snapshot is saved as a result.</li><li>Disable auto-save, so that future, test-tainted snapshots won’t be saved.</li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="setting-up-a-quick-boot-snapshot-from-the-emulator">Setting up a quick-boot snapshot from the Emulator<a aria-label="Direct link to Setting up a quick-boot snapshot from the Emulator" class="hash-link" href="#setting-up-a-quick-boot-snapshot-from-the-emulator" title="Direct link to Setting up a quick-boot snapshot from the Emulator"></a></h3><p>Start by launching a freshly baked emulator. Wait for it to go stable.</p><p>When running, go to settings (3 dots in the sidebar) > <code>Snapshots</code> > <code>Settings</code> tab. If not already set, select <code>Yes</code> in the <code>auto-save</code> option. This should prompt for a restart – choose <code>Yes</code>. The emulator should restart <strong>and save a snapshot.</strong></p><p><img alt="Emulator auto-save menu" class="img_ev3q" height="788" loading="eager" src="/assets/images/snapshot-autosave-65e6601712863fa450ed54fc79d010c5.png" width="1102"/></p><p>Do this again after the emulator is back up, but set <code>No</code> in the <code>auto-save</code> option. Allow it to restart yet again: it will immediately boot into the state saved as a snapshot earlier.</p><p>You can also try these as alternative sources for this:</p><ul><li><a href="/_404.html" rel="noopener noreferrer" target="_blank">Snapshots in Google Developers page</a> for full details on snapshots.</li><li><a href="/_404.html" rel="noopener noreferrer" target="_blank">Highly detailed blog post</a></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="setting-up-a-quick-boot-snapshot-from-command-line">Setting up a quick-boot snapshot from command-line<a aria-label="Direct link to Setting up a quick-boot snapshot from command-line" class="hash-link" href="#setting-up-a-quick-boot-snapshot-from-command-line" title="Direct link to Setting up a quick-boot snapshot from command-line"></a></h3><p>This is a bit more difficult, but is also applicable even for UI-less machines.</p><ol><li><p><a href="#locating-the-avds-home-directory">Locate the AVD’s <code>config.ini</code></a></p></li><li><p>Using your favorite text editor, either change or add these key-value sets:</p><div class="language-ini codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-ini codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token key attr-name" style="color: rgb(241, 250, 140);">fastboot.chosenSnapshotFile</span><span class="token punctuation" style="color: rgb(248, 248, 242);">=</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token key attr-name" style="color: rgb(241, 250, 140);">fastboot.forceChosenSnapshotBoot</span><span class="token punctuation" style="color: rgb(248, 248, 242);">=</span><span class="token value attr-value">no</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token key attr-name" style="color: rgb(241, 250, 140);">fastboot.forceColdBoot</span><span class="token punctuation" style="color: rgb(248, 248, 242);">=</span><span class="token value attr-value">no</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token key attr-name" style="color: rgb(241, 250, 140);">fastboot.forceFastBoot</span><span class="token punctuation" style="color: rgb(248, 248, 242);">=</span><span class="token value attr-value">yes</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div></li></ol><blockquote><p>Empirically, <code>forceFastBoot=yes</code> and <code>forceColdBoot=no</code> should be enough.</p></blockquote><ol><li><p>Under the AVD’s home directory, either create or edit yet another <code>ini</code> file called <code>quickbootChoice.ini</code> with the following content:</p><div class="language-ini codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-ini codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token key attr-name" style="color: rgb(241, 250, 140);">saveOnExit</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">=</span><span class="token plain"> </span><span class="token value attr-value">true</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div></li><li><p>Now that everything is in place, <a href="#booting-an-emulator-via-command-line">launch your emulator</a> once (in verbose mode) and wait for it to fully load. Then, shut it down, and make sure the <a href="#verifying-the-emulators-quick-boot-snapshot-has-been-saved">state has been saved</a>.</p></li><li><p>Last but not least, go back to <code>quickbootChoice.ini</code> and now switch to:</p><div class="language-ini codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-ini codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token key attr-name" style="color: rgb(241, 250, 140);">saveOnExit</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">=</span><span class="token plain"> </span><span class="token value attr-value">false</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div></li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="test-butler-support-optional">Test Butler Support (Optional)<a aria-label="Direct link to Test Butler Support (Optional)" class="hash-link" href="#test-butler-support-optional" title="Direct link to Test Butler Support (Optional)"></a></h3><p>If, when setting up your work environment, you’ve selected Google emulators with an AOSP image as the test target - as recommended, | |
| <strong>we strongly encourage</strong> you would also integrate <a href="/_404.html" rel="noopener noreferrer" target="_blank">Test Butler</a>: in the very least - in order to suppress crash and ANR dialogs. | |
| They are a soft spot in UI testing on Android, all around, as - when displayed,they make the UI entirely inaccessible (and thus cause tests to fail in bulks).</p><p>Setting Test Butler up for working with Detox is a bit different than explained in their guides. The process, as a whole, is twofold:</p><ol><li>Preinstalling the test-butler-app APK onto the test device.</li><li>Integrating the test-butler-lib into your own test APK, and initializing it in a custom test runner (as explained).</li></ol><p>The library part can be easily achieved as explained there (i.e. by using Gradle’s <code>androidTestImplementation</code>). Same goes for initialization. As for the APK, the suggested usage of Gradle’s <code>androidTestUtil</code> is scarce when running with Detox (i.e. non-native instrumentation tests). Here’s what to do instead.</p><blockquote><p><em>For a complete and thorough coverage of the Test Butler integration with Detox, consider going over our <a href="/_404.html" rel="noopener noreferrer" target="_blank">blogpost on CI execution</a> on medium</em>.</p></blockquote><h4 class="anchor anchorWithStickyNavbar_LWe7" id="solution-1-prebaked-images">Solution 1: Prebaked Images<a aria-label="Direct link to Solution 1: Prebaked Images" class="hash-link" href="#solution-1-prebaked-images" title="Direct link to Solution 1: Prebaked Images"></a></h4><p>If you have control over the emulators’ snapshots, simply download (see test-butler’s guide) and install the test-butler APK once (e.g. use <code>adb install -r -t path/to/test-butler-app.apk</code>), and save an updated version of the snapshot. This is the best solution.</p><blockquote><p>Note: you will have to reiterate this if you upgrade to a newer version of Test-Butler, in the future.</p></blockquote><h4 class="anchor anchorWithStickyNavbar_LWe7" id="solution-2-dynamic-installation">Solution 2: Dynamic Installation<a aria-label="Direct link to Solution 2: Dynamic Installation" class="hash-link" href="#solution-2-dynamic-installation" title="Direct link to Solution 2: Dynamic Installation"></a></h4><p>Assuming you have the APK available in the system, you can dynamically have Detox automatically install it in all of the running target-emulators by utilizing <code>utilBinaryPaths</code> in your Detox configuration. Example:</p><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-json codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"> </span><span class="token property">"devices"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"> </span><span class="token property">"emulator.oss"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"android.emulator"</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"> </span><span class="token property">"device"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"..."</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"> </span><span class="token property">"utilBinaryPaths"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">[</span><span class="token string" style="color: rgb(255, 121, 198);">"relative/path/to/test-butler-app-2.2.1.apk"</span><span class="token punctuation" style="color: rgb(248, 248, 242);">]</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><blockquote><p>Refer to our <a href="/docs/config/apps">configuration guide</a> for further details on <code>utilBinaryPaths</code>.</p></blockquote><p>As per <em>making</em> the APK available - for that, we have no really good solution, for the time being (but it’s in the works). A few options might be:</p><p>a. In a custom script, have it predownloaded from Maven directly, as suggested in the Test Butler guide. For example (on a Mac / Linux):</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-bash codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token function" style="color: rgb(80, 250, 123);">curl</span><span class="token plain"> -f -o ./temp/test-butler-app.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Toggle word wrap" class="clean-btn" title="Toggle word wrap" type="button"><svg aria-hidden="true" class="wordWrapButtonIcon_Bwma" viewbox="0 0 24 24"><path d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z" fill="currentColor"></path></svg></button><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><blockquote><p>Should you decide to go this path, we recommend you add <code>./temp/test-butler-app.apk</code> to the relevant <code>.gitignore</code>.</p></blockquote><p>b. (Discouraged) Add it to your source control (e.g. git), as part of the repository.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="disclaimer">Disclaimer<a aria-label="Direct link to Disclaimer" class="hash-link" href="#disclaimer" title="Direct link to Disclaimer"></a></h3><p>After upgrading the emulator’s binary to a newer version, it usually considers all existing snapshots invalid.</p><p>This can be addressed by deleting and recreating the snapshots as explained, or by recreating the AVD’s altogether.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="cheatsheet">Cheatsheet<a aria-label="Direct link to Cheatsheet" class="hash-link" href="#cheatsheet" title="Direct link to Cheatsheet"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="locating-the-avds-home-directory">Locating the AVD’s home directory<a aria-label="Direct link to Locating the AVD’s home directory" class="hash-link" href="#locating-the-avds-home-directory" title="Direct link to Locating the AVD’s home directory"></a></h3><p>Each AVD generated by the Android tools gets its own directory where associated content is stored:</p><ul><li><strong>Configuration file (i.e. <code>config.ini</code>)</strong></li><li>Snapshot images</li><li>SD-card content</li></ul><p>to name a few.</p><p>On Mac machines, the AVD directory typically maps to:</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-bash codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token environment constant" style="color: rgb(189, 147, 249);">$HOME</span><span class="token plain">/.android/avd/</span><span class="token operator"><</span><span class="token plain">AVD Name</span><span class="token operator">></span><span class="token plain">.avd/</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p><em>(for example: <code>/Users/root/.android/avd/Pixel_API_28_AOSP.avd/</code>)</em></p><p>The path should be similar on Linux machines, even though <code>$HOME</code> isn’t <code>/Users/root</code> but typically <code>/home/root</code> <em>(for example: <code>/home/root/.android/avd/Pixel_API_28_AOSP.avd/</code>).</em></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="booting-an-emulator-via-command-line">Booting an emulator via command-line<a aria-label="Direct link to Booting an emulator via command-line" class="hash-link" href="#booting-an-emulator-via-command-line" title="Direct link to Booting an emulator via command-line"></a></h3><blockquote><ul><li>The following examples apply for both Mac and Linux, and should be similar on Windows.</li><li>They assume the emulator’s name is <code>Pixel_API_28_AOSP</code>. If it isn’t, adjust the names accordingly:</li></ul></blockquote><h4 class="anchor anchorWithStickyNavbar_LWe7" id="shortcut-for-booting-a-verbose-visible-emulator-in-a-gui-supporting-system">Shortcut for booting a verbose, visible emulator in a GUI supporting system<a aria-label="Direct link to Shortcut for booting a verbose, visible emulator in a GUI supporting system" class="hash-link" href="#shortcut-for-booting-a-verbose-visible-emulator-in-a-gui-supporting-system" title="Direct link to Shortcut for booting a verbose, visible emulator in a GUI supporting system"></a></h4><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-bash codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token variable" style="color: rgb(189, 147, 249); font-style: italic;">$ANDROID_HOME</span><span class="token plain">/emulator/emulator -verbose @Pixel_API_28_AOSP </span><span class="token operator">&</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p><strong>Shortcut for booting a verbose, <em>headless</em> emulator in a UI-less Linux system</strong></p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-bash codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token variable" style="color: rgb(189, 147, 249); font-style: italic;">$ANDROID_HOME</span><span class="token plain">/emulator/emulator -verbose -no-window -no-audio -gpu swiftshader_indirect @Pixel_API_28_AOSP </span><span class="token operator">&</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Toggle word wrap" class="clean-btn" title="Toggle word wrap" type="button"><svg aria-hidden="true" class="wordWrapButtonIcon_Bwma" viewbox="0 0 24 24"><path d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z" fill="currentColor"></path></svg></button><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="verifying-the-emulators-quick-boot-snapshot-has-been-saved">Verifying the emulator’s quick-boot snapshot has been saved<a aria-label="Direct link to Verifying the emulator’s quick-boot snapshot has been saved" class="hash-link" href="#verifying-the-emulators-quick-boot-snapshot-has-been-saved" title="Direct link to Verifying the emulator’s quick-boot snapshot has been saved"></a></h3><p>If you’ve run your emulator in verbose mode from a shell, it’s easy to verify the state has been saved by following the logs. In particular, when shutting the emulator down, this log asserts the state has been saved:</p><div class="language-plain codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-plain codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">emulator: Saving state on exit with session uptime 9423 ms</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><blockquote><p>as a reference, when the state is <em>not</em> saved, the typical output is:</p><div class="language-plain codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-plain codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">emulator: WARNING: Not saving state: RAM not mapped as shared</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>It can be a result of an improper configuration, or an emulator launch where the <code>-read-only</code> argument was provided.</p></blockquote></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a class="theme-edit-this-page" href="/_404.html" rel="noreferrer noopener" target="_blank"><svg aria-hidden="true" class="iconEdit_Z9Sw" fill="currentColor" height="20" viewbox="0 0 40 40" width="20"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav aria-label="Docs pages" class="pagination-nav docusaurus-mt-lg"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/guide/developing-while-writing-tests"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Developing Your App While Writing Tests</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/guide/proguard-configuration"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">ProGuard configuration</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a class="table-of-contents__link toc-highlight" href="#java-setup">Java Setup</a></li><li><a class="table-of-contents__link toc-highlight" href="#android-sdk">Android SDK</a></li><li><a class="table-of-contents__link toc-highlight" href="#android-aosp-emulators">Android (AOSP) Emulators</a><ul><li><a class="table-of-contents__link toc-highlight" href="#heres-how-to-install-them-using-the-command-line">Here’s how to install them using the command line</a></li><li><a class="table-of-contents__link toc-highlight" href="#installing-from-android-studio">Installing from Android Studio</a></li></ul></li><li><a class="table-of-contents__link toc-highlight" href="#emulator-quick-boot">Emulator Quick-Boot</a><ul><li><a class="table-of-contents__link toc-highlight" href="#setting-up-a-quick-boot-snapshot-from-the-emulator">Setting up a quick-boot snapshot from the Emulator</a></li><li><a class="table-of-contents__link toc-highlight" href="#setting-up-a-quick-boot-snapshot-from-command-line">Setting up a quick-boot snapshot from command-line</a></li><li><a class="table-of-contents__link toc-highlight" href="#test-butler-support-optional">Test Butler Support (Optional)</a></li><li><a class="table-of-contents__link toc-highlight" href="#disclaimer">Disclaimer</a></li></ul></li><li><a class="table-of-contents__link toc-highlight" href="#cheatsheet">Cheatsheet</a><ul><li><a class="table-of-contents__link toc-highlight" href="#locating-the-avds-home-directory">Locating the AVD’s home directory</a></li><li><a class="table-of-contents__link toc-highlight" href="#booting-an-emulator-via-command-line">Booting an emulator via command-line</a></li><li><a class="table-of-contents__link toc-highlight" href="#verifying-the-emulators-quick-boot-snapshot-has-been-saved">Verifying the emulator’s quick-boot snapshot has been saved</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col footer__col_docs"><div class="footer__title">Docs</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/introduction/getting-started">Getting Started</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/contributing">Contributing to Detox</a></li></ul></div><div class="col footer__col footer__col_support"><div class="footer__title">Support</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item footer__link-item_ask-a-question-on-stack-overflow" href="/_404.html" rel="noopener noreferrer" target="_blank">Ask a question on Stack Overflow</a></li><li class="footer__item"><a class="footer__link-item footer__link-item_create-new-issue-on-github" href="/_404.html" rel="noopener noreferrer" target="_blank">Create new issue on Github</a></li></ul></div><div class="col footer__col footer__col_more"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item footer__link-item_git-hub" href="/_404.html" rel="noopener noreferrer" target="_blank">GitHub</a></li><li class="footer__item"><a class="footer__link-item footer__link-item_twitter" href="/_404.html" rel="noopener noreferrer" target="_blank">Twitter</a></li><li class="footer__item"><a class="footer__link-item footer__link-item_discord" href="/_404.html" rel="noopener noreferrer" target="_blank">Discord</a></li></ul></div></div></div></footer></div> | |
| <script src="/assets/js/runtime~main.12cb17c3.js"></script> | |
| <script src="/assets/js/main.899efd46.js"></script> | |
| <iframe allowtransparency="true" frameborder="0" scrolling="no" src="/_cdn/platform.twitter.com/widgets/widget_iframe.1227a5674072e080ffb1ba14ac0c1079.html?origin=https%3A%2F%2Fwix.github.io" style="display: none;" title="Twitter settings iframe"></iframe><div class="c--anim" id="cc--main" style="position: fixed;"><div class="cc_div" id="cc_div"><div aria-describedby="c-txt" aria-labelledby="c-ttl" aria-modal="true" class="box bottom center zoom" id="cm" role="dialog" style="visibility: hidden;" tabindex="-1"><div id="c-inr"><div id="c-inr-i"><h2 id="c-ttl">We use cookies!</h2><div id="c-txt">This website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent.</div></div><div id="c-bns"><button class="c-bn" id="c-p-bn" type="button"><span tabindex="-1">I agree</span></button><button class="c-bn c_link" id="c-s-bn" type="button"><span tabindex="-1">Customize</span></button></div></div></div><div id="cm-ov" style="visibility: hidden; opacity: 0;"></div><div aria-hidden="true" aria-labelledby="s-ttl" aria-modal="true" class="zoom" id="s-cnt" role="dialog" style="visibility: hidden;" tabindex="-1"><div id="c-vln"><div id="cs"><div id="c-s-in"><div class="bns-t" id="s-inr"><div id="s-hdr"><h2 id="s-ttl">Cookie settings</h2><div id="s-c-bnc"><button aria-label="Close" class="c-bn" id="s-c-bn" type="button"><span tabindex="-1"></span></button></div></div><div id="s-bl"><div class="c-bl"><div class="title"><div aria-level="3" class="b-tl" role="heading">Cookie usage</div></div><div class="desc"><div class="p">We use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want.</div></div></div><div class="c-bl b-ex"><div class="title b-bn"><button aria-controls="c-ac-1" aria-expanded="false" class="b-tl exp" type="button">Functionality cookies</button><label class="b-tg"><input class="c-tgl" disabled="" type="checkbox" value="functionality_storage"/><span aria-hidden="true" class="c-tg c-ro"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Functionality cookies</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-1"><div class="p">These cookies are necessary for the proper functioning of our website. Without these cookies, the website might not be working properly.</div></div></div><div class="c-bl b-ex"><div class="title b-bn"><button aria-controls="c-ac-2" aria-expanded="false" class="b-tl exp" type="button">Security cookies</button><label class="b-tg"><input class="c-tgl" type="checkbox" value="security_storage"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Security cookies</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-2"><div class="p">Security cookies allows storage of security-related information, such as authentication, fraud protection, and other means to protect the user.</div></div></div><div class="c-bl b-ex"><div class="title b-bn"><button aria-controls="c-ac-3" aria-expanded="false" class="b-tl exp" type="button">Personalization cookies</button><label class="b-tg"><input class="c-tgl" type="checkbox" value="personalization_storage"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Personalization cookies</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-3"><div class="p">Personalisation cookies may use third party cookies to help them personalise content and track users across different websites and devices.</div></div></div><div class="c-bl b-ex"><div class="title b-bn"><button aria-controls="c-ac-4" aria-expanded="false" class="b-tl exp" type="button">Ad cookies</button><label class="b-tg"><input class="c-tgl" type="checkbox" value="ad_storage"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Ad cookies</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-4"><div class="p">Advertising cookies are used by us or our partners to show you relevant content or advertisements both on our site and on third party sites. This enables us to create profiles based on your interests, so-called pseudonymised profiles. Based on this information, it is generally not possible to directly identify you as a person, as only pseudonymised data is used. Unless you express your consent, you will not receive content and advertisements tailored to your interests.</div></div></div><div class="c-bl b-ex"><div class="title b-bn"><div class="b-tl">Ad user data</div><label class="b-tg"><input class="c-tgl" type="checkbox" value="ad_user_data"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Ad user data</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-5"></div></div><div class="c-bl b-ex"><div class="title b-bn"><div class="b-tl">Ad personalization</div><label class="b-tg"><input class="c-tgl" type="checkbox" value="ad_personalization"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Ad personalization</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-6"></div></div><div class="c-bl b-ex"><div class="title b-bn"><button aria-controls="c-ac-7" aria-expanded="false" class="b-tl exp" type="button">Analytics cookies</button><label class="b-tg"><input class="c-tgl" type="checkbox" value="analytics_storage"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Analytics cookies</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-7"><div class="p">Analytics cookies allow us to measure the performance of our website and our advertising campaigns. We use them to determine the number of visits and sources of visits to our website. We process the data obtained through these cookies in aggregate, without using identifiers that point to specific users of our website. If you disable the use of analytics cookies in relation to your visit, we lose the ability to analyse performance and optimise our measures.</div></div></div><div class="c-bl"><div class="title"><div aria-level="3" class="b-tl" role="heading">More information</div></div><div class="desc"><div class="p">For any queries in relation to our policy on cookies and your choices, please contact us.</div></div></div></div><div id="s-bns"><button class="c-bn" id="s-all-bn" type="button">Accept all</button><button class="c-bn" id="s-rall-bn" type="button">Accept necessary</button><button class="c-bn" id="s-sv-bn" type="button">Save settings</button></div></div></div></div></div></div><div id="cs-ov" style="visibility: hidden; opacity: 0;"></div></div></div><iframe allowfullscreen="true" allowtransparency="true" frameborder="0" id="rufous-sandbox" scrolling="no" style="position: absolute; visibility: hidden; display: none; width: 0px; height: 0px; padding: 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial;" title="Twitter analytics iframe"></iframe></body></html> |