Datasets:
Download web/detox.github.io/reference/site/docs/api/device/index.html from Qwen/RecreationBench: direct link, hf CLI and curl.
- Browser
- Download file 199 kB
-
https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/detox.github.io/reference/site/docs/api/device/index.html
- Command line
-
hf download hf://datasets/Qwen/RecreationBench/web/detox.github.io/reference/site/docs/api/device/index.html
-
curl -L -o index.html https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/detox.github.io/reference/site/docs/api/device/index.html
199 kB
| <html class="docs-wrapper docs-doc-page docs-version-20.x plugin-docs plugin-id-default docs-doc-id-api/device 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>Device | 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="Device | Detox" data-rh="true" property="og:title"/><meta content="The device object is globally available in every test file, unless you use exposeGlobals: false in the behavior config," data-rh="true" name="description"/><meta content="The device object is globally available in every test file, unless you use exposeGlobals: false in the behavior config," 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/api/device/" rel="canonical"/><link data-rh="true" href="/docs/api/device/" hreflang="en" rel="alternate"/><link data-rh="true" href="/docs/api/device/" hreflang="x-default" rel="alternate"/><meta content="width=device-width, initial-scale=1.0" data-rh="true" name="viewport"/><meta content="/docs/api/device/" 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/329947da.92af671e.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/9a34b858.98ca0ede.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/71949878.06587ec8.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/7accbb75.e3d53ef1.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/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/7358fe14.7552c7a7.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/a622d695.ad67fb36.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/398b3246.9d70f6f5.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/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/96997528.38ed49ad.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/373c35af.5d2e051c.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/20110cf9.78831dd9.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/1ee22d16.fe2b756b.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/85addd09.f2a5fda6.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/a4761f6f.ea064397.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/2cf03b61.a8da21dc.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/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/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/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/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/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/beec6c9a.aa5fe25a.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 class="navbar__item navbar__link" href="/docs/introduction/getting-started">Docs</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" 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/api/device">Next</a></li><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/docs/api/device">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="#">Config file</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="#">Command Line Interface</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="#">Client API</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 aria-current="page" class="menu__link menu__link--active" href="/docs/api/device" tabindex="0">Device</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/api/matchers" tabindex="0">Matchers</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/api/actions" tabindex="0">Actions</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/api/expect" tabindex="0">Expect</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/api/webviews" tabindex="0">Web Views</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/api/system" tabindex="0">System</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/api/logger" tabindex="0">Logger</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/api/pilot" tabindex="0">Wix Pilot</a></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/api/internals">Internals API</a></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="#">Tech Articles</a></div></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">Client API</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">Device</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"><h1>Device</h1><p>The <code>device</code> object is globally available in every test file, unless you use <code>exposeGlobals: false</code> in the behavior config, | |
| and even then you can import it from Detox package:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"> device </span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">require</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'detox'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><p>It enables control over the current attached device.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="public-properties">Public Properties<a aria-label="Direct link to Public Properties" class="hash-link" href="#public-properties" title="Direct link to Public Properties"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceid"><code>device.id</code><a aria-label="Direct link to deviceid" class="hash-link" href="#deviceid" title="Direct link to deviceid"></a></h3><p>Holds the environment-unique ID of the device - namely, the <code>adb</code> ID on Android (e.g. <code>emulator-5554</code>) and the Mac-global simulator UDID on iOS, as used by <code>simctl</code> (e.g. <code>AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE</code>).</p><p>The value will be <code>undefined</code> until the device is properly <em>prepared</em> (i.e. in <code>detox.init()</code>).</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicename"><code>device.name</code><a aria-label="Direct link to devicename" class="hash-link" href="#devicename" title="Direct link to devicename"></a></h3><p>Holds a descriptive name of the device. Example: <code>emulator-5554 (Pixel_API_26)</code></p><p>The value will be <code>undefined</code> until the device is properly <em>prepared</em> (i.e. in <code>detox.init()</code>).</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceapplaunchargs"><code>device.appLaunchArgs</code><a aria-label="Direct link to deviceapplaunchargs" class="hash-link" href="#deviceapplaunchargs" title="Direct link to deviceapplaunchargs"></a></h3><p>Access the launch-arguments predefined by the user in preliminary, static scopes such as the Detox <a href="/docs/config/apps">configuration file</a> | |
| and <a href="/docs/cli/test">command-line arguments</a>. This access allows, through dedicated methods, for both value-querying and modification:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token comment" style="color: rgb(98, 114, 164);">// Modify some of the predefined arguments:</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">modify</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</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 literal-property property">mockServerPort</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">1234</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 punctuation" style="color: rgb(248, 248, 242);">)</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 comment" style="color: rgb(98, 114, 164);">// Retrieve the arguments:</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">get</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">// ==> { mockServerPort: 1234 }</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 comment" style="color: rgb(98, 114, 164);">// Reset (i.e. remove all arguments):</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">reset</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><p>In multi-app environments, you might want to persist your values between <code>device.selectApp(name)</code> calls:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">modify</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"> </span><span class="token literal-property property">transientArg</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">'value'</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">shared</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">modify</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</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 literal-property property">permanentMockServerPort</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">1234</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 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" style="display: inline-block;"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">get</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">// ==> { permanentMockServerPort: 1234, transientArg: 'value' }</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">shared</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">get</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">// ==> { permanentMockServerPort: 1234 }</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain" style="display: inline-block;"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">selectApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'anotherApp'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">get</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">// ==> { permanentMockServerPort: 1234 }</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">reset</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">get</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">// ==> { permanentMockServerPort: 1234 }</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">shared</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">reset</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">appLaunchArgs</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">get</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">// ==> {}</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><p>This is the most flexible way of editing the launch arguments. Refer to the <a href="/docs/guide/launch-args">launch arguments guide</a> for complete details.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="methods">Methods<a aria-label="Direct link to Methods" class="hash-link" href="#methods" title="Direct link to Methods"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceselectappname"><code>device.selectApp(name)</code><a aria-label="Direct link to deviceselectappname" class="hash-link" href="#deviceselectappname" title="Direct link to deviceselectappname"></a></h3><p>Use <strong>only for advanced multi-app configs</strong> when you need to switch between your apps | |
| within the same test scenario. Refer to the <a href="/docs/config/apps">configuration doc</a> | |
| to discover how to define multiple apps with different <code>name</code>s.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">selectApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'myAppName'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><p>As a side effect (due to the current architectural limitation) running <code>device.selectApp</code> terminates the previous | |
| app that had been running before.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicelaunchappparams"><code>device.launchApp(params)</code><a aria-label="Direct link to devicelaunchappparams" class="hash-link" href="#devicelaunchappparams" title="Direct link to devicelaunchappparams"></a></h3><p>Launch the app defined in the current <a href="/docs/config/overview"><code>configuration</code></a>.</p><p><code>params</code>—object, containing one of more of the following keys and values:</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="1-newinstancelaunching-a-new-instance-of-the-app">1. <code>newInstance</code>—Launching a New Instance of the App<a aria-label="Direct link to 1-newinstancelaunching-a-new-instance-of-the-app" class="hash-link" href="#1-newinstancelaunching-a-new-instance-of-the-app" title="Direct link to 1-newinstancelaunching-a-new-instance-of-the-app"></a></h4><p>Terminate the app and launch it again.</p><p>If set to <code>false</code>, the device will try to resume the app (e.g. bring from foreground to background). If the app isn’t running, <strong>it will launch a new instance</strong> nonetheless. <strong>Default is <code>false</code>.</strong></p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token literal-property property">newInstance</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h4 class="anchor anchorWithStickyNavbar_LWe7" id="2-permissionsset-runtime-permissions-ios-only">2. <code>permissions</code>—Set Runtime Permissions (iOS Only)<a aria-label="Direct link to 2-permissionsset-runtime-permissions-ios-only" class="hash-link" href="#2-permissionsset-runtime-permissions-ios-only" title="Direct link to 2-permissionsset-runtime-permissions-ios-only"></a></h4><p>Grants or denies runtime permissions to your application. This will cause the app to terminate before permissions are applied.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token literal-property property">permissions</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 literal-property property">calendar</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">'YES'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><p>Detox uses <a href="/_404.html" rel="noopener noreferrer" target="_blank">AppleSimUtils</a> and <a href="/_404.html" rel="noopener noreferrer" target="_blank"><code>xcrun simctl</code></a> to implement this functionality for iOS simulators. | |
| Please make sure you have the most recent version of both tools installed, since we rely on their latest versions.</p><h5 class="anchor anchorWithStickyNavbar_LWe7" id="supported-permissions">Supported Permissions<a aria-label="Direct link to Supported Permissions" class="hash-link" href="#supported-permissions" title="Direct link to Supported Permissions"></a></h5><table><thead><tr><th>Permission</th><th>Values</th><th>Notes</th></tr></thead><tbody><tr><td>location</td><td>always / inuse / never / unset</td><td>inuse - provides location access only when the app is in use</td></tr><tr><td>contacts</td><td>YES / NO / unset / limited</td><td>limited - grants limited access to contacts</td></tr><tr><td>photos</td><td>YES / NO / unset / limited</td><td>limited - grants limited access to photos</td></tr><tr><td>calendar</td><td>YES / NO / unset</td><td></td></tr><tr><td>camera</td><td>YES / NO / unset</td><td></td></tr><tr><td>medialibrary</td><td>YES / NO / unset</td><td></td></tr><tr><td>microphone</td><td>YES / NO / unset</td><td></td></tr><tr><td>motion</td><td>YES / NO / unset</td><td></td></tr><tr><td>reminders</td><td>YES / NO / unset</td><td></td></tr><tr><td>siri</td><td>YES / NO / unset</td><td></td></tr><tr><td>notifications</td><td>YES / NO / unset</td><td>Requires AppleSimUtils; unsupported by simctl</td></tr><tr><td>health</td><td>YES / NO / unset</td><td>Requires AppleSimUtils; unsupported by simctl</td></tr><tr><td>homekit</td><td>YES / NO / unset</td><td>Requires AppleSimUtils; unsupported by simctl</td></tr><tr><td>speech</td><td>YES / NO / unset</td><td>Requires AppleSimUtils; unsupported by simctl</td></tr><tr><td>faceid</td><td>YES / NO / unset</td><td>Requires AppleSimUtils; unsupported by simctl</td></tr><tr><td>userTracking</td><td>YES / NO / unset</td><td>Requires AppleSimUtils; unsupported by simctl</td></tr></tbody></table><p>Check Detox's <a href="https://github.com/wix/Detox/blob/master/detox/test/e2e/13.permissions.test.js" rel="noopener noreferrer" target="_blank">own test suite</a> for usage examples.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="3-urllaunching-with-url">3. <code>url</code>—Launching with URL<a aria-label="Direct link to 3-urllaunching-with-url" class="hash-link" href="#3-urllaunching-with-url" title="Direct link to 3-urllaunching-with-url"></a></h4><p>Launches the app with the specified URL to test your app’s deep link handling mechanism.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain">url</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain">url</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">newInstance</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">// Launch a new instance of the app</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain">url</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">newInstance</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">// Reuse existing instance</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>Read more <a href="/docs/guide/mocking-open-with-url">here</a>. Go back to subsection 1 to read about the full effect of the <code>newInstance</code> argument.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="4-usernotificationlaunching-with-user-notifications">4. <code>userNotification</code>—Launching with User Notifications<a aria-label="Direct link to 4-usernotificationlaunching-with-user-notifications" class="hash-link" href="#4-usernotificationlaunching-with-user-notifications" title="Direct link to 4-usernotificationlaunching-with-user-notifications"></a></h4><p>Launches with the specified user notification.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain">userNotification</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain">userNotification</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">newInstance</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">// Launch a new instance of the app</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain">userNotification</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">newInstance</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">// Reuse existing instance</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><p>Read more <a href="/docs/guide/mocking-user-notifications">here</a>. Go back to subsection 1 to read about the full effect of the <code>newInstance</code> argument.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="5-useractivitylaunch-with-user-activity-ios-only">5. <code>userActivity</code>—Launch with User Activity (iOS Only)<a aria-label="Direct link to 5-useractivitylaunch-with-user-activity-ios-only" class="hash-link" href="#5-useractivitylaunch-with-user-activity-ios-only" title="Direct link to 5-useractivitylaunch-with-user-activity-ios-only"></a></h4><p>Launches the app with the specified user activity.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token literal-property property">userActivity</span><span class="token operator">:</span><span class="token plain"> activity</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token literal-property property">userActivity</span><span class="token operator">:</span><span class="token plain"> activity</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">newInstance</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">//Launch a new instance of the app</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token literal-property property">userActivity</span><span class="token operator">:</span><span class="token plain"> activity</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">newInstance</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">//Reuse existing instance</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><p>Read more in <a href="/docs/guide/mocking-user-activity">here</a>. Go back to subsection 1 to read about the full effect of the <code>newInstance</code> argument.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="6-resetappstatereset-app-state-before-launching">6. <code>resetAppState</code>—Reset App State Before Launching<a aria-label="Direct link to 6-resetappstatereset-app-state-before-launching" class="hash-link" href="#6-resetappstatereset-app-state-before-launching" title="Direct link to 6-resetappstatereset-app-state-before-launching"></a></h4><p>Resets the app’s state and launches without necessarily performing a full uninstall/reinstall cycle.</p><ul><li>Android: clears app data using <code>pm clear</code>, which is typically faster than reinstalling.</li><li>iOS: uninstalls and reinstalls the app to restore a clean state.</li></ul><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token literal-property property">resetAppState</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h4 class="anchor anchorWithStickyNavbar_LWe7" id="7-deletedelete-and-reinstall-application-before-launching">7. <code>delete</code>—Delete and Reinstall Application Before Launching<a aria-label="Direct link to 7-deletedelete-and-reinstall-application-before-launching" class="hash-link" href="#7-deletedelete-and-reinstall-application-before-launching" title="Direct link to 7-deletedelete-and-reinstall-application-before-launching"></a></h4><p>Uninstalls the app and then reinstalls it before launching. Slower than <code>resetAppState</code>, | |
| but guarantees a completely fresh install of the app and all its data.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">delete</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h4 class="anchor anchorWithStickyNavbar_LWe7" id="8-launchargsadditional-process-launch-arguments">8. <code>launchArgs</code>—Additional Process Launch Arguments<a aria-label="Direct link to 8-launchargsadditional-process-launch-arguments" class="hash-link" href="#8-launchargsadditional-process-launch-arguments" title="Direct link to 8-launchargsadditional-process-launch-arguments"></a></h4><p>Launches the app on the device with on-site, user-specified launch arguments:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</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 literal-property property">launchArgs</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 literal-property property">arg1</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">1</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 literal-property property">arg2</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"2"</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 punctuation" style="color: rgb(248, 248, 242);">)</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><p>This is the most explicit and straightforward way of setting launch arguments. Refer to the <a href="/docs/guide/launch-args">launch arguments guide</a> for a complete overview on app launch arguments.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="9-disabletouchindicatorsdisable-touch-indicators-ios-only">9. <code>disableTouchIndicators</code>—Disable Touch Indicators (iOS Only)<a aria-label="Direct link to 9-disabletouchindicatorsdisable-touch-indicators-ios-only" class="hash-link" href="#9-disabletouchindicatorsdisable-touch-indicators-ios-only" title="Direct link to 9-disabletouchindicatorsdisable-touch-indicators-ios-only"></a></h4><p>Disables touch indicators on iOS. Default is <code>false</code>.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token literal-property property">disableTouchIndicators</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h4 class="anchor anchorWithStickyNavbar_LWe7" id="10-languageandlocalelaunch-with-a-specific-language-andor-local-ios-only">10. <code>languageAndLocale</code>—Launch with a Specific Language and/or Local (iOS Only)<a aria-label="Direct link to 10-languageandlocalelaunch-with-a-specific-language-andor-local-ios-only" class="hash-link" href="#10-languageandlocalelaunch-with-a-specific-language-andor-local-ios-only" title="Direct link to 10-languageandlocalelaunch-with-a-specific-language-andor-local-ios-only"></a></h4><p>Launch the app with a specific system language</p><p>Information about accepted values can be found <a href="/_404.html" rel="noopener noreferrer" target="_blank">here</a>.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</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 literal-property property">languageAndLocale</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 literal-property property">language</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"es-MX"</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 literal-property property">locale</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"es-MX"</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 punctuation" style="color: rgb(248, 248, 242);">)</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><p>With this API, you can run sets of E2E tests per language. For example:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">describe</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">each</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</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 string" style="color: rgb(255, 121, 198);">'es-MX'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">]</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</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);">'fr-FR'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">]</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</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);">'pt-BR'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">]</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 punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token template-string template-punctuation string" style="color: rgb(255, 121, 198);">`</span><span class="token template-string string" style="color: rgb(255, 121, 198);">Test suite (locale: %s)</span><span class="token template-string template-punctuation string" style="color: rgb(255, 121, 198);">`</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token parameter">locale</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token plain"> </span><span class="token arrow 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 function" style="color: rgb(80, 250, 123);">beforeAll</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">async</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token plain"> </span><span class="token arrow 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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</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 literal-property property">newInstance</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</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 literal-property property">languageAndLocale</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 literal-property property">language</span><span class="token operator">:</span><span class="token plain"> locale</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"> locale</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 punctuation" style="color: rgb(248, 248, 242);">)</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 punctuation" style="color: rgb(248, 248, 242);">)</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" style="display: inline-block;"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">test</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'some description'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">async</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token plain"> </span><span class="token arrow 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 comment" style="color: rgb(98, 114, 164);">// …</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 punctuation" style="color: rgb(248, 248, 242);">)</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 punctuation" style="color: rgb(248, 248, 242);">)</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><h4 class="anchor anchorWithStickyNavbar_LWe7" id="11-detoxenablesynchronizationinitialize-detox-with-synchronization-enabled-or-disabled-at-app-launch">11. <code>detoxEnableSynchronization</code>—Initialize Detox with synchronization enabled or disabled at app launch<a aria-label="Direct link to 11-detoxenablesynchronizationinitialize-detox-with-synchronization-enabled-or-disabled-at-app-launch" class="hash-link" href="#11-detoxenablesynchronizationinitialize-detox-with-synchronization-enabled-or-disabled-at-app-launch" title="Direct link to 11-detoxenablesynchronizationinitialize-detox-with-synchronization-enabled-or-disabled-at-app-launch"></a></h4><p>Launches the app with the synchronization mechanism enabled or disabled. Useful if the app cannot be synchronized during the launch process. Synchronization can later be enabled using <code>device.enableSynchronization()</code>.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</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 literal-property property">newInstance</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</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 literal-property property">launchArgs</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><span class="token literal-property property">detoxEnableSynchronization</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">0</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 punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h4 class="anchor anchorWithStickyNavbar_LWe7" id="12-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch">12. <code>detoxURLBlacklistRegex</code>—Initialize the URL Blacklist at app launch<a aria-label="Direct link to 12-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch" class="hash-link" href="#12-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch" title="Direct link to 12-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch"></a></h4><p>Launches the app with a URL blacklist to disable network synchronization on certain endpoints. | |
| Useful if the app makes frequent network calls to blacklisted endpoints upon startup.</p><blockquote><p>Note that due to the complexity of reg-exps and interoperability concerns, the implementation is fairly sensitive to the format of the string of urls. | |
| Please do your best to follow the example below:</p></blockquote><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</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 literal-property property">newInstance</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</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 literal-property property">launchArgs</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><span class="token literal-property property">detoxURLBlacklistRegex</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">'\\("^http://192\.168\.1\.253:\\d{4}/.*","https://e\.crashlytics\.com/spi/v2/events"\\)'</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</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 punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</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><h4 class="anchor anchorWithStickyNavbar_LWe7" id="13-detoxdisablewebkitsecuritydisable-webkit-security-ios-only">13. <code>detoxDisableWebKitSecurity</code>—Disable WebKit Security (iOS Only)<a aria-label="Direct link to 13-detoxdisablewebkitsecuritydisable-webkit-security-ios-only" class="hash-link" href="#13-detoxdisablewebkitsecuritydisable-webkit-security-ios-only" title="Direct link to 13-detoxdisablewebkitsecuritydisable-webkit-security-ios-only"></a></h4><p>Disables WebKit security on iOS. Default is <code>false</code>.</p><p>This is useful for testing web views with iframes that loads CORS-protected content.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 16 16"><path d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z" fill-rule="evenodd"></path></svg></span>Important</div><div class="admonitionContent_S0QG"><p>Some pages may not load correctly when WebKit security is disabled (for example, PCI DSS-compliant pages). | |
| Disabling WebKit security may cause errors when loading pages that have strict security policies.</p></div></div><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</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 literal-property property">launchArgs</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><span class="token literal-property property">detoxDisableWebKitSecurity</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</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 punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceterminateapp"><code>device.terminateApp()</code><a aria-label="Direct link to deviceterminateapp" class="hash-link" href="#deviceterminateapp" title="Direct link to deviceterminateapp"></a></h3><p>By default, <code>terminateApp()</code> with no params will terminate the app file defined in the current <a href="/docs/config/overview"><code>configuration</code></a>.</p><p>To terminate another app, specify its bundle id</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">terminateApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'other.bundle.id'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicesendtohome"><code>device.sendToHome()</code><a aria-label="Direct link to devicesendtohome" class="hash-link" href="#devicesendtohome" title="Direct link to devicesendtohome"></a></h3><p>Send application to background by bringing <code>com.apple.springboard</code> to the foreground. | |
| Combining <code>sendToHome()</code> with <code>launchApp({newInstance: false})</code> will simulate app coming back from background. | |
| Check out Detox’s <a href="https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js" rel="noopener noreferrer" target="_blank">own test suite</a></p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">sendToHome</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">launchApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token literal-property property">newInstance</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 comment" style="color: rgb(98, 114, 164);">// app returned from background, do stuff</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>Check out Detox’s <a href="https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js" rel="noopener noreferrer" target="_blank">own test suite</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicereloadreactnative"><code>device.reloadReactNative()</code><a aria-label="Direct link to devicereloadreactnative" class="hash-link" href="#devicereloadreactnative" title="Direct link to devicereloadreactnative"></a></h3><p>If this is a React Native app, reload the React Native JS bundle. This action is much faster than <code>device.launchApp()</code>, and can be used if you just need to reset your React Native logic.</p><i>**Note:** This functionality does not work without faults. Under certain conditions, the system may not behave as expected and/or even crash. In these cases, use `device.launchApp()` to launch the app cleanly instead of only reloading the JS bundle.</i><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceinstallapp"><code>device.installApp()</code><a aria-label="Direct link to deviceinstallapp" class="hash-link" href="#deviceinstallapp" title="Direct link to deviceinstallapp"></a></h3><p>By default, <code>installApp()</code> with no params will install the app file defined in the current <a href="/docs/config/overview"><code>configuration</code></a>.</p><p>To install another app, specify its path</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">installApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'path/to/other/app'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceuninstallapp"><code>device.uninstallApp()</code><a aria-label="Direct link to deviceuninstallapp" class="hash-link" href="#deviceuninstallapp" title="Direct link to deviceuninstallapp"></a></h3><p>By default, <code>uninstallApp()</code> with no params will uninstall the app defined in the current <a href="/docs/config/overview"><code>configuration</code></a>.</p><p>To uninstall another app, specify its bundle id</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">uninstallApp</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'other.bundle.id'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><p><strong>Note:</strong> For app state reset operations, consider using <a href="#deviceresetappstatebundleids"><code>device.resetAppState()</code></a> which is more efficient than uninstall/install cycles.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceopenurlurl-sourceappoptional"><code>device.openURL({url, sourceApp[optional]})</code><a aria-label="Direct link to deviceopenurlurl-sourceappoptional" class="hash-link" href="#deviceopenurlurl-sourceappoptional" title="Direct link to deviceopenurlurl-sourceappoptional"></a></h3><p>Mock opening the app from URL. <code>sourceApp</code> is an optional <strong>iOS-only</strong> parameter to specify source application bundle id.</p><p>Read more in <a href="/docs/guide/mocking-open-with-url">Mocking Open with URL</a> section. | |
| Check out Detox’s <a href="https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/15.urls.test.js" rel="noopener noreferrer" target="_blank">own test suite</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicesendusernotificationparams"><code>device.sendUserNotification(params)</code><a aria-label="Direct link to devicesendusernotificationparams" class="hash-link" href="#devicesendusernotificationparams" title="Direct link to devicesendusernotificationparams"></a></h3><p>Mock handling of a user notification previously received in the system, while the app is already running.</p><p>Read more in <a href="/docs/guide/mocking-user-notifications">Mocking User Notifications</a> section. | |
| Check out Detox’s <a href="https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/11.user-notifications.test.js" rel="noopener noreferrer" target="_blank">own test suite</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicesenduseractivityparams-ios-only"><code>device.sendUserActivity(params)</code> <strong>iOS Only</strong><a aria-label="Direct link to devicesenduseractivityparams-ios-only" class="hash-link" href="#devicesenduseractivityparams-ios-only" title="Direct link to devicesenduseractivityparams-ios-only"></a></h3><p>Mock handling of received user activity when app is in foreground. | |
| Read more in <a href="/docs/guide/mocking-user-activity">Mocking User Activity</a> section. | |
| Check out Detox’s <a href="https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/18.user-activities.test.js" rel="noopener noreferrer" target="_blank">own test suite</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicesetorientationorientation"><code>device.setOrientation(orientation)</code><a aria-label="Direct link to devicesetorientationorientation" class="hash-link" href="#devicesetorientationorientation" title="Direct link to devicesetorientationorientation"></a></h3><p>Takes <code>"portrait"</code> or <code>"landscape"</code> and rotates the device to the given orientation.</p><p><strong>Note:</strong> Setting device orientation is only supported for iPhone devices, or for apps declared as requiring full screen on iPad. For all other cases, the current test will be failed.</p><p>Check out Detox’s <a href="https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device-orientation.test.js" rel="noopener noreferrer" target="_blank">own test suite.</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicesetlocationlat-lon"><code>device.setLocation(lat, lon)</code><a aria-label="Direct link to devicesetlocationlat-lon" class="hash-link" href="#devicesetlocationlat-lon" title="Direct link to devicesetlocationlat-lon"></a></h3><p>Sets the simulator/emulator location to the given latitude and longitude.</p><blockquote><p>On iOS <code>setLocation</code> depends on <code>xcrun simctl</code>, and we recommend using its latest version.</p><p>On Android <code>setLocation</code> will work with both Android Emulator (bundled with Android development tools) and Genymotion. The correct permissions must be set in your app manifest.</p></blockquote><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">setLocation</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token number">32.0853</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token number">34.7818</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicedisablesynchronization"><code>device.disableSynchronization()</code><a aria-label="Direct link to devicedisablesynchronization" class="hash-link" href="#devicedisablesynchronization" title="Direct link to devicedisablesynchronization"></a></h3><p>Temporarily disable synchronization (idle/busy monitoring) with the app - namely, stop waiting for the app to go idle before moving forward in the test execution.</p><p>This API is useful for cases where test assertions must be made in an area of your application where it is okay for it to ever remain partly <em>busy</em> (e.g. due to an endlessly repeating on-screen animation). | |
| However, using it inherently suggests that you are likely to resort to applying <code>sleep()</code>’s in your test code - testing that area, <strong>which is not recommended and can never be 100% stable.</strong> Therefore, as a rule of thumb, test code running "inside" a sync-disabled mode must be reduced to the bare minimum.</p><p>Note: Synchronization is enabled by default, and it gets <strong>re-enabled on every launch of a new instance of the app.</strong></p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">disableSynchronization</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceenablesynchronization"><code>device.enableSynchronization()</code><a aria-label="Direct link to deviceenablesynchronization" class="hash-link" href="#deviceenablesynchronization" title="Direct link to deviceenablesynchronization"></a></h3><p>Re-enable synchronization (idle/busy monitoring) with the app - namely, resume waiting for the app to go idle before moving forward in the test execution, after a previous disabling of it through a call to <code>device.disableSynchronization()</code>.</p><p>⚠️ Note: Making this call would resume synchronization <strong>instantly</strong>, having its returned promise only resolve when the app becomes idle again. In other words, this <strong>must only be called after you navigate back to "the safe zone", where the app should be able to eventually become idle again</strong>, or it would remain suspended "forever" (i.e. until a safeguard time-out expires).</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">enableSynchronization</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceseturlblacklisturls"><code>device.setURLBlacklist([urls])</code><a aria-label="Direct link to deviceseturlblacklisturls" class="hash-link" href="#deviceseturlblacklisturls" title="Direct link to deviceseturlblacklisturls"></a></h3><p>Exclude synchronization with respect to network activity (i.e. don’t wait for network to go idle before moving forward in the test execution) according to <strong>specific</strong> endpoints, denoted as URL reg-exp’s. To disable endpoints at initialization, pass in the black-list as an <a href="/docs/guide/launch-args">app-launch argument</a> named <code>detoxURLBlacklistRegex</code> (as explained <a href="#11-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch">here</a>).</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">setURLBlacklist</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">[</span><span class="token string" style="color: rgb(255, 121, 198);">'.*127.0.0.1.*'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">'.*my.ignored.endpoint.*'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">]</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceresetappstatebundleids"><code>device.resetAppState([...bundleIds])</code><a aria-label="Direct link to deviceresetappstatebundleids" class="hash-link" href="#deviceresetappstatebundleids" title="Direct link to deviceresetappstatebundleids"></a></h3><p>Resets the app state by clearing app data and restoring it to a clean state.</p><p>On Android, this command clears the app's data using the <code>pm clear</code> command, effectively resetting the app to its initial installed state without uninstalling it.</p><p>On iOS, Detox uses a fallback that uninstalls and installs your app again to achieve a clean state.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token comment" style="color: rgb(98, 114, 164);">// Reset current app state</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">resetAppState</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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" style="display: inline-block;"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token comment" style="color: rgb(98, 114, 164);">// Reset specific app state</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">resetAppState</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'com.example.app'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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" style="display: inline-block;"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token comment" style="color: rgb(98, 114, 164);">// Reset multiple apps</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">resetAppState</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'com.app1'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">'com.app2'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceresetcontentandsettings-ios-only"><code>device.resetContentAndSettings()</code> <strong>iOS Only</strong><a aria-label="Direct link to deviceresetcontentandsettings-ios-only" class="hash-link" href="#deviceresetcontentandsettings-ios-only" title="Direct link to deviceresetcontentandsettings-ios-only"></a></h3><p>Resets the Simulator to clean state (like the Simulator > Reset Content and Settings... menu item), especially removing | |
| previously set permissions.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">resetContentAndSettings</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicegetplatform"><code>device.getPlatform()</code><a aria-label="Direct link to devicegetplatform" class="hash-link" href="#devicegetplatform" title="Direct link to devicegetplatform"></a></h3><p>Returns the current device, <code>ios</code> or <code>android</code>.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">if</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">getPlatform</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token plain"> </span><span class="token operator">===</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">'ios'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">expect</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">loopSwitch</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">toHaveValue</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'1'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicetappoint-shouldignorestatusbar"><code>device.tap(point, shouldIgnoreStatusBar)</code><a aria-label="Direct link to devicetappoint-shouldignorestatusbar" class="hash-link" href="#devicetappoint-shouldignorestatusbar" title="Direct link to devicetappoint-shouldignorestatusbar"></a></h3><p>Perform a tap at arbitrary coordinates on the device's screen.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="tap-parameters">tap parameters<a aria-label="Direct link to tap parameters" class="hash-link" href="#tap-parameters" title="Direct link to tap parameters"></a></h4><ul><li><code>point</code> — Coordinates in the element's coordinate space (default value: <code>{x: 100, y: 100}</code>, platforms: Android & IOS) <br/></li><li><code>shouldIgnoreStatusBar</code> — Coordinates will be measured starting from under the status bar (default value: <code>true</code>, platform: Android) <br/></li></ul><h4 class="anchor anchorWithStickyNavbar_LWe7" id="tap-examples">tap examples<a aria-label="Direct link to tap examples" class="hash-link" href="#tap-examples" title="Direct link to tap examples"></a></h4><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain" style="display: inline-block;"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">tap</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">tap</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"> </span><span class="token literal-property property">x</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">y</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">150</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">tap</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"> </span><span class="token literal-property property">x</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">y</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">150</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">tap</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token boolean">false</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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" style="display: inline-block;"></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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicelongpresspoint-duration-shouldignorestatusbar"><code>device.longPress(point, duration, shouldIgnoreStatusBar)</code><a aria-label="Direct link to devicelongpresspoint-duration-shouldignorestatusbar" class="hash-link" href="#devicelongpresspoint-duration-shouldignorestatusbar" title="Direct link to devicelongpresspoint-duration-shouldignorestatusbar"></a></h3><p>Perform a long press at arbitrary coordinates on the device's screen. Custom press duration if needed.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="longpress-parameters">longPress parameters<a aria-label="Direct link to longPress parameters" class="hash-link" href="#longpress-parameters" title="Direct link to longPress parameters"></a></h4><ul><li><code>point</code> — Coordinates in the element's coordinate space (default value: <code>{x: 100, y: 100}</code>, platforms: Android & IOS) <br/></li><li><code>duration</code> — Custom press duration time, in milliseconds. (default values: Android: Standard long-press duration. IOS: 1000 milliseconds, platforms: Android & IOS) <br/></li><li><code>shouldIgnoreStatusBar</code> — Coordinates will be measured starting from under the status bar (default value: <code>true</code>, platform: Android) <br/></li></ul><h4 class="anchor anchorWithStickyNavbar_LWe7" id="longpress-examples">longPress examples<a aria-label="Direct link to longPress examples" class="hash-link" href="#longpress-examples" title="Direct link to longPress examples"></a></h4><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain" style="display: inline-block;"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">longPress</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">longPress</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"> </span><span class="token literal-property property">x</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">y</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">150</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token number">2000</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">longPress</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"> </span><span class="token literal-property property">x</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">y</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">150</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token number">2000</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">longPress</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token number">2000</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">longPress</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"> </span><span class="token literal-property property">x</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">y</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">150</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">longPress</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"> </span><span class="token literal-property property">x</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">100</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token literal-property property">y</span><span class="token operator">:</span><span class="token plain"> </span><span class="token number">150</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">longPress</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token number">2000</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">longPress</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token boolean">false</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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" style="display: inline-block;"></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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicetakescreenshotname"><code>device.takeScreenshot([name])</code><a aria-label="Direct link to devicetakescreenshotname" class="hash-link" href="#devicetakescreenshotname" title="Direct link to devicetakescreenshotname"></a></h3><p>Takes a screenshot of the device. For full details on taking screenshots with Detox, refer to the <a href="/docs/guide/taking-screenshots">screen-shots guide</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicecaptureviewhierarchyname"><code>device.captureViewHierarchy([name])</code><a aria-label="Direct link to devicecaptureviewhierarchyname" class="hash-link" href="#devicecaptureviewhierarchyname" title="Direct link to devicecaptureviewhierarchyname"></a></h3><p><strong>iOS Only.</strong> Saves a view hierarchy snapshot (<code>*.viewhierarchy</code>) of the | |
| currently opened application to a temporary folder and schedules putting it to | |
| the artifacts' folder upon the completion of the current test. The file can be | |
| opened later in Xcode 12.0 and above. | |
| See <a href="/_404.html" rel="noopener noreferrer" target="_blank">Xcode 12 Release notes: #57933113</a> | |
| for more details.</p><p>The <code>name</code> parameter is optional — by default, it equals to <code>capture</code>.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js 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);">test</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Capture view hierarchy'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">async</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token plain"> </span><span class="token arrow 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 keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> temporaryArtifactPath </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">captureViewHierarchy</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'myElements'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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" style="display: inline-block;"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"> </span><span class="token comment" style="color: rgb(98, 114, 164);">// The temporary path will remain valid until the test completion.</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 comment" style="color: rgb(98, 114, 164);">// Afterwards, the artifact will be moved, e.g.:</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 comment" style="color: rgb(98, 114, 164);">// * on success, to: <artifacts-location>/✓ Capture view hierarchy/myElements.viewhierarchy</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 comment" style="color: rgb(98, 114, 164);">// * on failure, to: <artifacts-location>/✗ Capture view hierarchy/myElements.viewhierarchy</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 punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</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="devicegenerateviewhierarchyxmlshouldinjecttestids"><code>device.generateViewHierarchyXml([shouldInjectTestIds])</code><a aria-label="Direct link to devicegenerateviewhierarchyxmlshouldinjecttestids" class="hash-link" href="#devicegenerateviewhierarchyxmlshouldinjecttestids" title="Direct link to devicegenerateviewhierarchyxmlshouldinjecttestids"></a></h3><p>Generates a view hierarchy XML of the currently opened application. The XML is returned as a string.</p><p>The <code>shouldInjectTestIds</code> parameter is optional and defaults to <code>false</code>. When set to <code>true</code>, Detox will attempt to inject <code>testID</code> attributes into the XML for each element if undefined.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> viewHierarchyXml </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">generateViewHierarchyXml</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceshake-ios-only"><code>device.shake()</code> <strong>iOS Only</strong><a aria-label="Direct link to deviceshake-ios-only" class="hash-link" href="#deviceshake-ios-only" title="Direct link to deviceshake-ios-only"></a></h3><p>Simulate shake</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicesetbiometricenrollmentbool-ios-only"><code>device.setBiometricEnrollment(bool)</code> <strong>iOS Only</strong><a aria-label="Direct link to devicesetbiometricenrollmentbool-ios-only" class="hash-link" href="#devicesetbiometricenrollmentbool-ios-only" title="Direct link to devicesetbiometricenrollmentbool-ios-only"></a></h3><p>Toggles device enrollment in biometric authentication (Touch ID or Face ID).</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">setBiometricEnrollment</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token boolean">true</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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 comment" style="color: rgb(98, 114, 164);">// or</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 keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">setBiometricEnrollment</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token boolean">false</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicematchface-ios-only"><code>device.matchFace()</code> <strong>iOS Only</strong><a aria-label="Direct link to devicematchface-ios-only" class="hash-link" href="#devicematchface-ios-only" title="Direct link to devicematchface-ios-only"></a></h3><p>Simulates the success of a face match via Face ID</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceunmatchface-ios-only"><code>device.unmatchFace()</code> <strong>iOS Only</strong><a aria-label="Direct link to deviceunmatchface-ios-only" class="hash-link" href="#deviceunmatchface-ios-only" title="Direct link to deviceunmatchface-ios-only"></a></h3><p>Simulates the failure of face match via Face ID</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicematchfinger-ios-only"><code>device.matchFinger()</code> <strong>iOS Only</strong><a aria-label="Direct link to devicematchfinger-ios-only" class="hash-link" href="#devicematchfinger-ios-only" title="Direct link to devicematchfinger-ios-only"></a></h3><p>Simulates the success of a finger match via Touch ID</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceunmatchfinger-ios-only"><code>device.unmatchFinger()</code> <strong>iOS Only</strong><a aria-label="Direct link to deviceunmatchfinger-ios-only" class="hash-link" href="#deviceunmatchfinger-ios-only" title="Direct link to deviceunmatchfinger-ios-only"></a></h3><p>Simulates the failure of a finger match via Touch ID</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceclearkeychain-ios-only"><code>device.clearKeychain()</code> <strong>iOS Only</strong><a aria-label="Direct link to deviceclearkeychain-ios-only" class="hash-link" href="#deviceclearkeychain-ios-only" title="Direct link to deviceclearkeychain-ios-only"></a></h3><p>Clears the device keychain</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicesetstatusbar-ios-only"><code>device.setStatusBar()</code> <strong>iOS Only</strong><a aria-label="Direct link to devicesetstatusbar-ios-only" class="hash-link" href="#devicesetstatusbar-ios-only" title="Direct link to devicesetstatusbar-ios-only"></a></h3><p>Override simulator’s status bar. Available options:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">setStatusBar</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</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 literal-property property">time</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"12:34"</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 comment" style="color: rgb(98, 114, 164);">// Set the date or time to a fixed value.</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 comment" style="color: rgb(98, 114, 164);">// If the string is a valid ISO date string it will also set the date on relevant devices.</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 literal-property property">dataNetwork</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"wifi"</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 comment" style="color: rgb(98, 114, 164);">// If specified must be one of 'hide', 'wifi', '3g', '4g', 'lte', 'lte-a', 'lte+', '5g', '5g+', '5g-uwb', or '5g-uc'.</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 literal-property property">wifiMode</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"failed"</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 comment" style="color: rgb(98, 114, 164);">// If specified must be one of 'searching', 'failed', or 'active'.</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 literal-property property">wifiBars</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"2"</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 comment" style="color: rgb(98, 114, 164);">// If specified must be 0-3.</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 literal-property property">cellularMode</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"searching"</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 comment" style="color: rgb(98, 114, 164);">// If specified must be one of 'notSupported', 'searching', 'failed', or 'active'.</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 literal-property property">cellularBars</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"3"</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 comment" style="color: rgb(98, 114, 164);">// If specified must be 0-4.</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 literal-property property">operatorName</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"A1"</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 comment" style="color: rgb(98, 114, 164);">// Set the cellular operator/carrier name. Use '' for the empty string.</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 literal-property property">batteryState</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"charging"</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 comment" style="color: rgb(98, 114, 164);">// If specified must be one of 'charging', 'charged', or 'discharging'.</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 literal-property property">batteryLevel</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color: rgb(255, 121, 198);">"50"</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 comment" style="color: rgb(98, 114, 164);">// If specified must be 0-100.</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 punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</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="deviceresetstatusbar-ios-only"><code>device.resetStatusBar()</code> <strong>iOS Only</strong><a aria-label="Direct link to deviceresetstatusbar-ios-only" class="hash-link" href="#deviceresetstatusbar-ios-only" title="Direct link to deviceresetstatusbar-ios-only"></a></h3><p>Resets any override in simulator’s status bar.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicereversetcpport-android-only"><code>device.reverseTcpPort()</code> <strong>Android Only</strong><a aria-label="Direct link to devicereversetcpport-android-only" class="hash-link" href="#devicereversetcpport-android-only" title="Direct link to devicereversetcpport-android-only"></a></h3><p>Reverse a TCP port from the device (guest) back to the host-computer, as typically done with the <code>adb reverse</code> command. The end result would be that all network requests going from the device to the specified port will be forwarded to the computer.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="deviceunreversetcpport-android-only"><code>device.unreverseTcpPort()</code> <strong>Android Only</strong><a aria-label="Direct link to deviceunreversetcpport-android-only" class="hash-link" href="#deviceunreversetcpport-android-only" title="Direct link to deviceunreversetcpport-android-only"></a></h3><p>Clear a <em>reversed</em> TCP-port (e.g. previously set using <code>device.reverseTcpPort()</code>).</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicepressback-android-only"><code>device.pressBack()</code> <strong>Android Only</strong><a aria-label="Direct link to devicepressback-android-only" class="hash-link" href="#devicepressback-android-only" title="Direct link to devicepressback-android-only"></a></h3><p>Simulate press back button.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> device</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">pressBack</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</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><h3 class="anchor anchorWithStickyNavbar_LWe7" id="devicegetuidevice-android-only"><code>device.getUiDevice()</code> <strong>Android Only</strong><a aria-label="Direct link to devicegetuidevice-android-only" class="hash-link" href="#devicegetuidevice-android-only" title="Direct link to devicegetuidevice-android-only"></a></h3><p>Exposes <a href="/_404.html" rel="noopener noreferrer" target="_blank"><code>UiAutomator</code>’s <code>UiDevice</code> API</a>. | |
| <strong>This is not a part of the official Detox API</strong>, it may break and change whenever an update to <code>UiDevice</code> or <code>UiAutomator</code> Gradle dependencies (<code>androidx.test.uiautomator:uiautomator</code>) is introduced.</p><p><a href="https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/src/android/espressoapi/UIDevice.js" rel="noopener noreferrer" target="_blank"><code>UiDevice</code>’s autogenerated code</a></p></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/cli/run-server"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">detox run-server</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/api/matchers"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Matchers</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="#public-properties">Public Properties</a><ul><li><a class="table-of-contents__link toc-highlight" href="#deviceid"><code>device.id</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicename"><code>device.name</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceapplaunchargs"><code>device.appLaunchArgs</code></a></li></ul></li><li><a class="table-of-contents__link toc-highlight" href="#methods">Methods</a><ul><li><a class="table-of-contents__link toc-highlight" href="#deviceselectappname"><code>device.selectApp(name)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicelaunchappparams"><code>device.launchApp(params)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceterminateapp"><code>device.terminateApp()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicesendtohome"><code>device.sendToHome()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicereloadreactnative"><code>device.reloadReactNative()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceinstallapp"><code>device.installApp()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceuninstallapp"><code>device.uninstallApp()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceopenurlurl-sourceappoptional"><code>device.openURL({url, sourceApp[optional]})</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicesendusernotificationparams"><code>device.sendUserNotification(params)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicesenduseractivityparams-ios-only"><code>device.sendUserActivity(params)</code> <strong>iOS Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicesetorientationorientation"><code>device.setOrientation(orientation)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicesetlocationlat-lon"><code>device.setLocation(lat, lon)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicedisablesynchronization"><code>device.disableSynchronization()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceenablesynchronization"><code>device.enableSynchronization()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceseturlblacklisturls"><code>device.setURLBlacklist([urls])</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceresetappstatebundleids"><code>device.resetAppState([...bundleIds])</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceresetcontentandsettings-ios-only"><code>device.resetContentAndSettings()</code> <strong>iOS Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicegetplatform"><code>device.getPlatform()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicetappoint-shouldignorestatusbar"><code>device.tap(point, shouldIgnoreStatusBar)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicelongpresspoint-duration-shouldignorestatusbar"><code>device.longPress(point, duration, shouldIgnoreStatusBar)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicetakescreenshotname"><code>device.takeScreenshot([name])</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicecaptureviewhierarchyname"><code>device.captureViewHierarchy([name])</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicegenerateviewhierarchyxmlshouldinjecttestids"><code>device.generateViewHierarchyXml([shouldInjectTestIds])</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceshake-ios-only"><code>device.shake()</code> <strong>iOS Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicesetbiometricenrollmentbool-ios-only"><code>device.setBiometricEnrollment(bool)</code> <strong>iOS Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicematchface-ios-only"><code>device.matchFace()</code> <strong>iOS Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceunmatchface-ios-only"><code>device.unmatchFace()</code> <strong>iOS Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicematchfinger-ios-only"><code>device.matchFinger()</code> <strong>iOS Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceunmatchfinger-ios-only"><code>device.unmatchFinger()</code> <strong>iOS Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceclearkeychain-ios-only"><code>device.clearKeychain()</code> <strong>iOS Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicesetstatusbar-ios-only"><code>device.setStatusBar()</code> <strong>iOS Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceresetstatusbar-ios-only"><code>device.resetStatusBar()</code> <strong>iOS Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicereversetcpport-android-only"><code>device.reverseTcpPort()</code> <strong>Android Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#deviceunreversetcpport-android-only"><code>device.unreverseTcpPort()</code> <strong>Android Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicepressback-android-only"><code>device.pressBack()</code> <strong>Android Only</strong></a></li><li><a class="table-of-contents__link toc-highlight" href="#devicegetuidevice-android-only"><code>device.getUiDevice()</code> <strong>Android Only</strong></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> |