18

I've gone through everything on http://www.chromium.org/chromium-os/android-apps and also watched the IO video and there doesn't seem to be any mention of what the side-loading (and debugging) mechanism available for developing/testing Android apps on ChromeOS will be?

I know that ARC used adb on desktops but not Chromebooks

Given that the new implementation is different and its a full Android framework in a Linux container and has access to USB, will ADB be available for this prupose? Using ADB could also be useful for remote debugging since Devtools already runs an adb client

EDIT: As of 9 Aug 2016 there is now official documentation available.

Maks
  • 7,562
  • 6
  • 43
  • 65
  • Since none of this has been released yet, I think that you are "jumping the gun" a bit. – CommonsWare May 25 '16 at 11:44
  • @CommonsWare the M53 release is already out and Google have said it's going out to the initial 3 Chromebooks in dev channel in "mid June" which is only a couple of weeks away, so would be nice to make some decisions on tooling setup prior soon. – Maks May 25 '16 at 12:57
  • Yes, but until they announce the tooling setup, asking questions about the tooling setup is "jumping the gun" a bit. – CommonsWare May 25 '16 at 13:21
  • 1
    Now that the Android for the ASUS Chromebook Flip is available on the dev channel, and since I haven't seen any instructions from Google, this question becomes much more relevant. USB debugging options show up in the Android Settings app, but the Flip only has USB host ports, so that doesn't seem right. Also, as is pointed out elsewhere, [we do not have access to allow "unknown sources"](https://stackoverflow.com/q/37877608/115145), so even manual APK copying is out. `adb` over WiFi, perhaps? – CommonsWare Jun 17 '16 at 17:48
  • We now have [official `adb` access instructions](http://www.chromium.org/chromium-os/android-apps), though those instructions have bugs, at least at the present time. [This blog post](https://commonsware.com/blog/2016/07/08/android-chrome-os-adb-access.html) outlines what worked for me to get `adb` going. – CommonsWare Jul 08 '16 at 14:12

1 Answers1

13

Edit: The instructions below are now no longer needed as ChromeOS has enabled allowing ADB access to the Android container without needing to put the Chromebook into developer mode BUT ONLY IF you want to access ADB from the Linux container on the same Chromebook as documented here.


Unless you are in Developer Mode, you won't be able to enable unknown sources. So in order to side load apps you will need to put your device into Developer Mode (instructions here - follow the steps for the Chromebook Pixel 2015).

Once you are in Dev Mode, go to Chrome Settings > App Settings > Security > Unknown sources (move to the right)

After enabling developer mode you can side load apps in one of 2 ways:

  1. Upload your .apk to Google Drive or send it to yourself via email, and open it with the Android app equivalent (Drive and Gmail respectively)
  2. Transfer the .apk to the Downloads folder of your Chromebook using a thumb drive, and install it via a File Manager Android app
  3. Transfer the .apk over ethernet from another device, using VT-2 to access the command line on your Chromebook

Here is a sample walkthru of setting up an ethernet connection for approach 3:

  • On desktop - Plug ethernet cable into desktop
  • On desktop - Set an IP: ifconfig eth1 10.xx.xx.xx netmask 255.255.255.254
  • On Chromebook - Go to VT-2: ctrl-alt-fwd (a.k.a. f2)
  • On Chromebook - Plug ethernet into Chromebook
  • On Chromebook - Set an IP for the ethernet: ifconfig eth1 10.xx.xx.xx netmask 255.255.255.254
  • Use scp to transfer the .apk file from the desktop to the Chromebook
Maks
  • 7,562
  • 6
  • 43
  • 65
msheets
  • 396
  • 2
  • 4
  • The documentation that you link to says that the details of Developer Mode are device-specific, then links [here](https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices). That page, in turn, does not provide instructions for about half of the Chrome OS devices. Notably, it does not provide instructions for either the ASUS Chromebook Flip or the Acer Chromebook R11, which are two of the three devices that we are supposed to be using for testing. – CommonsWare Jun 17 '16 at 23:17
  • 1
    For the ASUS Chromebook Flip and Acer Chromebook R11 the instructions are the same as for the Pixel 2 found here: https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/chromebook-pixel-2015. Note that at the time of writing this, only the Chromebook Flip is supporting the Play store on dev – msheets Jun 17 '16 at 23:30
  • 1
    OK, I can confirm that putting the device into Chrome OS Developer Mode allows access to the "unknown sources" switch -- many thanks! Note that you can also copy an APK over via a thumb drive, copy it from there into the Flip's `Downloads` folder, and install it via a file manager Android app (it will show up in `Downloads` on external storage). IOW, it behaves more or less normally for Android. I am hoping that we'll get `adb` access at some point (LogCat, debugging, etc.). Thanks again! – CommonsWare Jun 17 '16 at 23:43
  • No problem! I've added the thumb drive approach to the answer to make it easier for people to see the possibilities. – msheets Jun 17 '16 at 23:48
  • @msheets thanks for such quick and comprehensive answers. Would you know if it's possible to run it to listen on a port and get access to adbd inside the Android container? Using the IP connectivity as per your method 2? – Maks Jun 18 '16 at 00:32
  • Ah! as per G+ post, its same as above (https://plus.google.com/+AlbertoMartin/posts/Ap3xMYnCnox) – Maks Jun 18 '16 at 06:18
  • 1
    @Maks: per comments I posted on that G+ post, make sure to adb connect to port 22 on the chromebook instead of the default: adb connect :22 – Elijah Taylor Jun 18 '16 at 18:42
  • @ElijahTaylor Local adb (on the Chromebooks shell) works fine via connecting to the Android containers virtual network IP 192.168.254.2 on usual port 5555. The ssh method tunneling does nt seem to be soemthing that is shipped in the public dev channel images. So I expect what needs to be done is proxying the internal network port out via the ChromeOS publicly visible network IP address. – Maks Jun 19 '16 at 11:16
  • 1
    @CommonsWare Actually as per (http://stackoverflow.com/a/18551325/85472) having the adb server on the chromebook bind to listen on all interfaces and then having the "Development" machine adb client connect to that adb server using -H should do the trick but doesn't work for me at the moment (though that might be sue to my local LAN setup). – Maks Jun 19 '16 at 11:47
  • 1
    @Maks: You need to open the port in `iptables` via `iptables -I INPUT -p tcp --dport 5037 -j ACCEPT`. That allows me to connect. Then, `adb` on my development machine fails with "adb server version (32) doesn't match this client (36); killing...". So, communications are available, but there's a version mismatch. – CommonsWare Jun 19 '16 at 14:02
  • @commonsware thanks! Forgot about that! Opening up the port was the final step as I'm lucky to still have v32 of adb on my device machine, so finally got remote adb shell working into the Android container on the Flip over WiFi! – Maks Jun 19 '16 at 22:19