Being able to run Android apps on a Chromebook is great, it gives users access to the vast Android ecosystem offerings and it gives Android developers the opportunity to reach Chrome OS users.
Developers should make a point to verify their apps on different form factors, since this will help improve users' experiences. This is why Chrome OS provides Android developers with the tools to deploy and test their apps on Chromebooks.
Whether developers are deploying their Android app directly from Chrome OS (using Android Studio in your Chromebook) or from another device, developers can use ADB to deploy their apps and debug different interactions with Chromebooks. For more details checkout the steps below.
Enable ADB debug
Previously, using ADB on your Chromebook was only possible while in developer mode, which requires powerwashing (resetting) the device and can reduce security. Luckily since Chrome 81, developers can keep their devices out of developer mode and still deploy apps they develop directly in Chrome OS, with the flip of a switch. Here is how:
Once Linux is available open the Linux settings and you'll find a new option Develop Android apps, open that option.
Toggle enable ADB debugging and the computer will restart.
When the computer restarts you'll see a message that lets you know that there may be applications that were not downloaded from the app store on the device.
ADB is now available to deploy apps to your Chromebook, run debugging commands and interact directly with the device.
To ensure that your Android app works well on a variety of Chromebook devices and available form factors, Google recommends that you test your app on the following devices:
- An ARM-based Chromebook
- An x86-basedChromebook
- A device with a touchscreen and one without one
- A convertible device; that is, one that can change between a laptop and a tablet
- A device with a stylus
Deploy from Chrome OS
Deploy with Android Studio
After you have set up Android Studio and the ADB as described above, you can push your apps to the Chromebook's Android container directly from Android Studio. The Chromebook will appear as an option in the device drop down:
Now you can push your app like any other Android device! The ADB authorization dialog appears.After you authorize your application will launch in a new window.
That's it, you can now deploy the app to the Chromebook, test and debug without the hassle of being in developer mode.
Deploy with Terminal
Install ADB if necessary:
sudo apt install adb
Connect to the device:
adb connect arc
An authorization popup for USB debugging appears. Grant it.
Install your app from the terminal:
adb install [path to your APK]
Deploy from another device
Connect to ADB over a network
- Make sure you enabled ADB debugging.
Get the IP address of your Chromebook:
- Click the clock in the bottom right area of the screen.
- Click the gear icon.
- Click the network type you are connected to (Wi-Fi or Mobile data) then the name of the network.
- Take note of the IP Address.
Tip: Another quick way to find your Chromebook’s IP address is to click the clock in the bottom right, click the Wi-Fi icon, and click the Network info button.
Connect to your Chromebook:
Return to your development machine and use ADB to connect to your Chromebook using its IP address:
adb connect <ip_address>
On your Chromebook, click Allow when prompted whether you want to allow the debugger. Your ADB session is established.
Troubleshoot ADB debugging over a network
Sometimes the ADB device shows that it's offline when everything is connected properly. In this case, complete the following steps to troubleshoot the issue:
- Deactivate ADB debugging in Developer options.
- In a terminal window, run
- Re-activate the ADB debugging option.
- In a terminal window, attempt to run
- Click Allow when prompted whether you want to allow debugging. Your ADB session is established.
Connect to ADB over USB
To push your APK from another device into the Chromebook, you must start your Chrome OS in developer mode so that you can configure the Chromebook and push apps from the host machine. Follow this steps to get into developer mode
- Enable ADB debugging.
- Determine if your device supports USB debugging
- Press Control + Alt + T to start the Chrome OS terminal.
shellto get to the bash command shell:
crosh> shell chronos@localhost / $
Type the following commands to set up your device:
$ sudo crossystem dev_enable_udc=1 $ sudo reboot
After rebooting, open the terminal again and run the following command to enable ADB on the Chromebook’s USB port:
$ sudo ectool usbpd <port number> dr_swap
Use this command each time you disconnect and reconnect a USB cable. To ensure your Chromebook is in UFP mode, you can run
ectool usbpd <port number>.
- Plug in a USB cable to a supported port on your device
adb devicesfrom the Android SDK platform tools on your host machine to see your Chromebook listed as an ADB supported device
- On your Chromebook, click Allow when prompted whether you want to allow the debugger. Your ADB session is established.