Android phones and tablets¶
AutoMobile drives Android devices and emulators through the Android SDK and
adb. Install the SDK before you start; the installer reports what is missing.
Get a device¶
- Call
getAndroidto acquire a device. PassavdNameto boot a named Android Virtual Device, ordeviceIdfor a device that is already running. With neither and norequires,getAndroidreturns the running device your session already holds. Otherwise it picks a phone: a running phone emulator first, else it cold-boots a configured phone AVD.requiresnarrows that phone choice. Onlypanelsabove 1,posture,screenRoundorvehicle.motionpicks another form factor instead. If there is no device to pick, the error tells you to calllistDeviceImagesand pass one of the names asavdName. See the FAQ. - Call
listDevicesto see devices, andlistDeviceImagesto see the system images you can boot. See Listing device images. - A device your session holds takes calls only from that session. See Device ownership.
When getAndroid fails¶
- Right after a cold boot,
adb installcan fail with no reason while the package manager starts.getAndroidretries that install withinautomationReadyTimeoutMs. This covers a first install and an upgrade of an older CtrlProxy. - If the call still fails after it cold-booted an emulator, the error message
ends with
deviceLeftand a next step: deviceLeft: shutdown: the call is stopping the emulator it cold-booted.deviceLeft: booted: the emulator is still running.deviceLeft: unknown: the call could not confirm the emulator’s state.- A device that was already running before the call is left running, and the
error does not add
deviceLeft. - The next step is to call
getAndroidagain with the sameavdName(or the same arguments when you passed none).
Android-only tools and features¶
- Manufacturer profiles approximate a device maker’s build on a stock emulator.
- App lifecycle backgrounds or kills one running app, or
sends it
onTrimMemory. - Kill profiles simulate a device maker’s background-kill policy for one app.
- Seed content adds contacts, calendar events, call history and SMS messages.
- Keystore state and Keystore metadata work with the AutoMobile SDK in a debug build.
- SDK capabilities report what the AutoMobile SDK in your app exposes.
- Reaching a host server lets an app on the device reach a
server on your machine at
localhost.
Shared with iOS¶
Most tools work the same on both platforms. These guides cover both:
- Device condition fixtures
- Storage capabilities
- Emulator and simulator audio
- Accessibility and performance audits and Performance traces
The Platforms column in Tools shows which devices each tool drives.