{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Appium Connection Guide"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"appium-connection-guide","__idx":0},"children":["Appium Connection Guide"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use Appium Inspector on macOS or Windows with any MoreLogin cloud phone model that supports ADB and meets the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/appium/appium-uiautomator2-driver#requirements"},"children":["UiAutomator2 driver requirements"]},". The Inspector connects to the Appium Server on your computer, which uses ADB to communicate with the phone."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide uses Android 15 to illustrate direct ADB with a connection code and Android 15A to illustrate ADB through an SSH tunnel. Android 15 was verified end to end on Windows, and Android 15A was verified end to end on macOS. For other models, use the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/cloud-phone/adb"},"children":["ADB Connection Guide"]}," to choose the connection method, then follow the same Inspector setup once ADB is connected."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run ADB, Appium Server, and Appium Inspector on the same computer. If the device is already connected, verify that its row shows ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["device"]}," in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["adb devices -l"]}," and that ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["adb -s DEVICE_IDENTIFIER shell getprop ro.build.version.release"]}," returns a version. Then skip to the Appium setup."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"get-the-adb-connection-details","__idx":1},"children":["Get the ADB connection details"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In MoreLogin Desktop, open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Profiles → Cloud Phone"]}," and start the target phone. Open the row’s ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["⋯"]}," menu and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enable ADB"]},". If the ADB column is off-screen, scroll the list horizontally. Hover over ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enabled"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/ml-enable.f15fca406b0642892c6d64f82f8293ff2ea998b2247fd5f57ae4c359796fc524.f59a5fd3.png","alt":"Enable ADB in a cloud phone's action menu"},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Connection address and connection code"]}," indicate direct ADB, as shown for Android 15."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SSH command, SSH password, and connection address"]}," indicate an SSH tunnel, as shown for Android 15A. Check the expiry time if displayed."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/ml-popup15.59c6a444c67e1d0293f95d90a2b9076847bc6d300dd700dba298dba5ccc639df.f59a5fd3.png","alt":"Android 15 connection details with values redacted"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/ml-popup15a.d5026fe728e2d59573d8d7fe1a88187425b447cf3ff9047fbf2b85311195f787.f59a5fd3.png","alt":"Android 15A SSH and ADB connection details with values redacted"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up-the-android-tools","__idx":2},"children":["Set up the Android tools"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In Android Studio’s SDK Manager, install the SDK platform for your target Android version (API 35 for Android 15) and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Android SDK Platform-Tools"]},". Note the SDK location. Install JDK 17 and Node.js 24 LTS, then verify that ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["adb version"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["java -version"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["node -v"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["npm -v"]}," work in the shell where you will run Appium. Appium 3 requires npm 10 or later."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["macOS"]},", adjust the SDK path if needed:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"export ANDROID_HOME=\"$HOME/Library/Android/sdk\"\nexport JAVA_HOME=\"$(/usr/libexec/java_home -v 17)\"\nexport PATH=\"$ANDROID_HOME/platform-tools:$JAVA_HOME/bin:$PATH\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Windows"]},", open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Edit environment variables for your account"]},". Set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ANDROID_HOME"]}," to the SDK directory and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["JAVA_HOME"]}," to the JDK directory. Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["%ANDROID_HOME%\\platform-tools"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["%JAVA_HOME%\\bin"]}," to the user Path, then reopen PowerShell. Models that connect through an SSH tunnel also require OpenSSH Client. Run ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ssh -V"]}," to check it. If needed, install it under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings → Optional features"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["adb version"]}," works but Doctor reports that ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ANDROID_HOME"]}," is missing, use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(Get-Command adb).Source"]}," to find the executable. Set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ANDROID_HOME"]}," to the SDK root that contains ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["platform-tools"]},". Set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["JAVA_HOME"]}," to the JDK 17 root and put its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bin"]}," directory ahead of older Java entries in Path. Reopen PowerShell after changing user variables, or set these values for the current shell before running Doctor and starting Appium. Replace the example paths below with your own."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"powershell","header":{"controls":{"copy":{}}},"source":"$env:ANDROID_HOME = 'C:\\Android\\Sdk'\n$env:JAVA_HOME = 'C:\\Program Files\\Java\\jdk-17'\n$env:Path = \"$env:JAVA_HOME\\bin;$env:ANDROID_HOME\\platform-tools;$env:Path\"\njava -version\nadb version\n","lang":"powershell"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"connect-adb","__idx":3},"children":["Connect ADB"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["direct ADB"]}," (Android 15 in this example), use the address and code from the MoreLogin tooltip. Replace the uppercase placeholders before running these commands:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"adb connect DEVICE_ADDRESS\nadb -s DEVICE_ADDRESS shell CONNECTION_CODE\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A successful ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["adb connect"]}," or a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["device"]}," row in the list confirms the ADB transport. The second command authenticates the connection and may print ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["OK! Login successful."]},". If it opens a device shell, enter ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["exit"]}," to return to your local terminal. If a shell command returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Access denied! Invalid password."]},", authenticate using the current connection code from MoreLogin, preserving its case, then retry the command."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ADB over SSH"]}," (Android 15A in this example), run the full ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SSH Connection"]}," command from the tooltip and enter the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SSH Password"]}," when prompted. If the command ends in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-Nf"]},", it normally returns to the prompt once the tunnel starts. If your Windows SSH client rejects ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-Nf"]},", use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-N"]}," and keep that terminal open. In another terminal, connect to the address displayed by MoreLogin. The port is assigned for the connection, so replace the example port below with your actual value:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"adb connect localhost:9897\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On either system, run ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["adb devices -l"]},". The target row should show ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["device"]},". Copy the entire first column into the Inspector’s ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["appium:udid"]}," field. To verify the connection, run ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["adb -s DEVICE_IDENTIFIER shell getprop ro.build.version.release"]}," using that exact identifier. See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/cloud-phone/adb"},"children":["ADB Connection Guide"]}," for other Android models."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"install-appium-and-uiautomator2","__idx":4},"children":["Install Appium and UiAutomator2"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If Appium 3 or UiAutomator2 is already installed, skip the corresponding install command. Stop any running Appium instance before installing the driver."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["macOS"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install -g appium@3\nappium driver install uiautomator2\nappium driver list --installed\nappium driver doctor uiautomator2\nappium --address 127.0.0.1 --port 4723 --base-path /\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Windows PowerShell"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"powershell","header":{"controls":{"copy":{}}},"source":"npm.cmd install -g appium@3\nappium.cmd driver install uiautomator2\nappium.cmd driver list --installed\nappium.cmd driver doctor uiautomator2\nappium.cmd --address 127.0.0.1 --port 4723 --base-path /\n","lang":"powershell"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the installer looks for a compatible driver version, wait for it to finish and confirm that the installed list includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["uiautomator2"]},". Fix any Doctor errors for ADB or Java. If Doctor finds both ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["adb.exe"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["java.exe"]}," and only reports a missing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emulator"]}," as a required fix, you can proceed with a MoreLogin cloud phone that is already online through ADB. Keep the server terminal open. In a second terminal, run ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["curl http://127.0.0.1:4723/status"]}," on macOS or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["curl.exe http://127.0.0.1:4723/status"]}," on Windows. Continue when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["value.ready"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},". ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://appium.io/docs/en/latest/quickstart/uiauto2-driver/"},"children":["UiAutomator2 installation"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"install-and-configure-appium-inspector","__idx":5},"children":["Install and configure Appium Inspector"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/appium/appium-inspector/releases"},"children":["official releases"]},". On ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["macOS"]},", choose an arm64 DMG for Apple Silicon or an x64 DMG for Intel, then drag the app into ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Applications"]},". On ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Windows"]},", download the Windows EXE, run it, select installation for the current user, choose a location, and click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Install"]},". Then select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Run Appium Inspector"]}," and click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Finish"]},". The Windows screenshots below show the installer and application."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["UI text translated into English"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/win-setup-steps.1d5d82f64c8166a167cba488022ac777eaafafbce700516aed6ec330180376dd.f59a5fd3.png","alt":"Windows installer scope and destination (UI text translated into English)"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/win-finish.cd7d1848bbff51814fc0a58112d0a52be56099e1e63272c0f1f420bcef51e69b.f59a5fd3.png","alt":"Windows installer completion (UI text translated into English)"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Appium Server"]}," tab, set ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Remote Host"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["127.0.0.1"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Remote Port"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4723"]},", and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Remote Path"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/"]},". Leave SSL and Use Proxy unchecked."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["127.0.0.1:4723"]}," is the Appium Server address."]}," Use the direct or forwarded ADB address to identify the device in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["appium:udid"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Capability Builder"]},", edit ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["JSON Representation"]},", paste the following, and save. Substitute your actual device identifier for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["localhost:9897"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"platformName\": \"Android\",\n  \"appium:automationName\": \"UiAutomator2\",\n  \"appium:udid\": \"localhost:9897\",\n  \"appium:noReset\": true\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/win-config.2d5344fa51514e241c2ec951a9df46ae0e952fbc67d78b74f68840f653f211c8.f59a5fd3.png","alt":"Windows Inspector with local server and example Android capabilities"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Start Session"]},". Once the device screenshot and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["App Source"]}," load, open the app you want to inspect and refresh the source. The screenshots below show successful sessions for Android 15 on Windows and Android 15A on macOS."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/win-android15-session.c59074d8c5ae9c482ba5ae6a7b0e274bfb54fdbbdc8da8221fe1b6c2aad33564.f59a5fd3.png","alt":"Successful Android 15 Inspector session on Windows"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/ins-live-session.5ddc67ab553c8e01fff640fcadcaf3101e727d67d6a1218b8c6a5f2f37fb5d07.f59a5fd3.png","alt":"Successful Android 15A Inspector session on macOS"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"troubleshoot","__idx":6},"children":["Troubleshoot"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Cannot connect to Appium Server"]},". Check ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/status"]},", then match the Inspector settings to the server startup log."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["No device found"]},". Run ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["adb devices -l"]}," on the same computer as Appium. Use the exact identifier from that list. For direct ADB, check connection-code authentication. For ADB over SSH, check that the tunnel is active and the connection details are still valid. Resolve an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["offline"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["unauthorized"]}," ADB status before retrying the session."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["UiAutomator2 driver not found"]},". Check the installed drivers in the same Node.js environment that runs Appium, then install the driver and restart the server."]}]}]},"headings":[{"value":"Appium Connection Guide","id":"appium-connection-guide","depth":1},{"value":"Get the ADB connection details","id":"get-the-adb-connection-details","depth":2},{"value":"Set up the Android tools","id":"set-up-the-android-tools","depth":2},{"value":"Connect ADB","id":"connect-adb","depth":2},{"value":"Install Appium and UiAutomator2","id":"install-appium-and-uiautomator2","depth":2},{"value":"Install and configure Appium Inspector","id":"install-and-configure-appium-inspector","depth":2},{"value":"Troubleshoot","id":"troubleshoot","depth":2}],"frontmatter":{"seo":{"title":"Appium Connection Guide"}},"lastModified":"2026-11-16T05:36:16.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/api-reference/cloud-phone/appium-inspector","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}