How to access Chromebook Android via ADB in local Linux VM? - android

Backstory: I'm developing an app on a Chromebook using the Linux (Beta) feature whereby I have VS Code, GIT and everything else installed. Plugging my phone into the Chromebook pops up a "Connect to Linux" dialog which then makes it accessible via adb running in the Linux VM. From there I can install and run my test application as part of a build script. Parallel to this I have Android enabled on the Chromebook and set it into developer mode which lets me access adb via CROSH. From this shell I can install and run APK's directly on the Chromebook itself through its Android emulation layer.
What I would like to do (if it's even possible) is to access the Chromebook's Android layer via adb in the local Linux (Beta) VM. Thus I would be able to run my build script to run, install and launch on the Chromebook Android layer itself.
My idea: the Chromebook would need to provide an emulated USB device to the Linux VM or I could somehow setup the Chromebook Android stuff so that I could connect over a local port (TCP/IP) with adb.
Thoughts, insight, resources?

The answer is to run adb connect arc and then the Chromebook shows up in the ADB devices list!
Thanks to Morrison Chang who provided the link to https://chromeos.dev/ which led me to https://chromeos.dev/en/android-environment/deploying-apps#deploy-with-terminal .
It seems that if your Chromebook is in developer mode then the convenient UI "Develop Android apps" is not available.

Related

Connect Android Studio with android via AirDroid

My computer seems to be too slow to run the android studio emulator (it wanted me to install some hardware acceleration), so I can't test apps there. Also my USB Cord doesn't work, I am wondering if it is possible to test apps in Android Studio via airdroid(http://web.airdroid.com/). I'm not sure how to set this up, however, since I don't really know how to configure android Studio to get this to work: as android studio only seems to work via a USB connection (which is not working for me). To sum it all up: I want to test apps on my phone via airdroid from android studio, and I need to know how to configure this.
Thanks.
As i know, AirDroid doesn't support ADB. But if really don't have a USB, you can use some Apps like WiFi ADB to get ADB work over WiFi
But if you are accidently using CyanogenMod or any other Mods which have ADB over Network, it could be natively supported
Download e.g. Shell Terminal Emulator (on Google Play). Open it and run
adb tcpip 5555
Open the terminal in Android Studio and write
adb connect ip_to_android_phone:5555
OBS!
Some devices require root access, while others don't.

VirtualBox Ubuntu 12.04 (64-bit) Guest Not Recognizing Android Device

I've setup an Ubuntu 12.04 LTS 64-bit VirtualBox guest running on a Windows 7 host (also 64-bit) with the sole purpose of Android-based hacking, programming, debugging, etc. I've followed numerous guides and forums in order to have my VBox guest recognize my physical Android device via USB, but I keep getting the following error pop-up:
Failed to attach the USB device motorola XT926 [0228] to the virtual machine Android.
USB device 'motorola XT926' with UUID {REDACTED} is busy with a previous request. Please try again later.
Result Code: E_INVALIDARG (0x80070057)
Component: HostUSBDevice
Interface: IHostUSBDevice {REDACTED}
Callee: IConsole {REDACTED}
I've tried the following:
Note that I've already uninstalled VirtualBox, reinstalled the latest version, installed the VirtualBox Guest Additions as well as the latest expansion pack
Shutdown VM
Plug in Android device via USB and allow Windows to recognize it
Run "VboxManage list usbhost" to confirm that the device is being recognized by VBox and listed as "Available"
Edit VM settings to enable USB Controller AND USB 2.0 (EHCI) Controller.
Add filter for Motorola device (VendorID = 22b8) and set Remote option to "Any"
Unplug Android device
Start VM, login and wait for it to "settle"
Plug in Android device
I've also tried the following:
echo Y into the old_schema_first config
create 70-android.rules with the appropriate SUBSYSTEM, ATTR and MODE values set
The guest VM still does not recognize the Android device and abd doesn't list any when I issue the adb devices command.
Any help here would be greatly appreciated.
If your device support adb wireless debug (like Nexus), use that. If not, you can install adbWiress, this app makes your device debugable through wifi (need root).

unable to debug android/chrome remotely from ubuntu/linux

I'm an android newbie. I've got a an android with chrome v30 installed. I enabled USB debugging on it. On my ubuntu linux I've installed ADB extension for chrome v27. I plug usb cable, so the connection is established automatically (ubuntu recognizes android as "camera"). On my laptop chrome I've got an android icon (ADB icon), I turn it on (start ADB). Then a number "1" shows up in a rectangle - yes, a device has been recognized (hurray!). But I'm unable to debug my mobile gmail. Either there is something wrong or I don't know how to access ADB. I've got following sections in the View inspection targets:
Pages - these are just my laptop tabs
Extensions - chrome laptop extensions, such as JSONView
shared workers - empty
other - with one element: chrome-devtools://devtools/devtools.html?dockSide=bottom&toolbarColor=rgba(223,223,223,1)&textColor=…
Does anyone know what did I do wrong? The chrome version on mobile is ok (should be 24+, it's 30), the USB debug permission is set to true, USB cable is plugged both ways, ADB icon shows 1.
Besides, the official chrome ADB page says that I should run command adb devices, but I don't know where to execute it. I didn't install android SDK, since ADB is supposed to run without full android SDK installation. What is this command and how should I execute it?
I have the same problem with you, you can follow the steps: http://developer.android.com/tools/device.html#setting-up
you can type
lsusb
in your terminal to find your deveice's vendor id,
then follow the steps above, finally, you may
sudo service udev restart
then restart adb , and you will see the device
follow steps on https://developers.google.com/chrome-developer-tools/docs/remote-debugging#remote-debugging
make sure USB debugging is enabled in Chrome as well (required before Chrome 32 ships)
reconnect the device to see auth message on the device screen and accept it (Chrome 32 or Chrome Canary would list your device as pending auth unless you accept it)
Try enabling "PTP" mode on your device
On the device, in the notification for the cable connection, hit "Tap for more options" and select the "PTP" option.
This page specifically suggests this as one tip: https://developers.google.com/web/tools/chrome-devtools/remote-debugging/
More context:
Initially, connecting my USB cable, and refreshing chrome://inspect, I got no prompt on the device or any changes in the PC browser.
Fresh install of Ubuntu 20.04
Pixel 2 with latest Android OS I did not install any extra software
(ADB or anything related to Android dev)
Device was already working
for remote dev on other systems (Macos)

Linux CLI into Android

I was wondering if it is possible to terminal into my Android (Razr) and navigate the file system and processes like you would on any other Linux distribution. As it is supposed to be built on top of the Linux Kernel.
I find it annoying that you simply can't shut down most apps, like Firefox for example, from the phone's default UI, I wish there would be a way to find the process ID and kill it like you would on a regular Linux/Unix machine.
If you enable debugging and have the Android SDK installed then you can use adb shell to get a shell on the android device using the USB cable to a PC. If you want something just on the device, ConnectBot which is a SSH client application that is available for free, can provide a localhost only shell which will let you work as for most linux systems. Note that the shell is fairly restricted. A lot of common commands are missing.
adb shell
with your phone connected to your PC, via network or USB according to your device, with USB debug enabled.
I use the connectbot app; it's primarily useful as an ssh client but also allows you to run a local terminal session

Android Download And Install Non-Marketplace App

Android 2.1 Downloaded APK from server. Now I want to programaticllly install this on the phone/tablet without starting it up. Just install it. How do I do this on Android 2.1?
Installing an app doesnt necessarily cause the app to start running, unless the app is meant to run as a service, in which case I dont know of any way to install the app and prevent it from hooking into your system and running behind the scenes.
As far as programatic installatation, a quick google search turned this up as the successor to PackageManager.installPackage:
http://www.mailinglistarchive.com/html/android-developers#googlegroups.com/2010-01/msg03943.html
After downloading the app, download the Android SDK and adb, enable USB debugging, connect the device to your machine via a USB cable and do an adb install of the APK. If you're using Windows to deploy the app, you'll have to download the USB drivers as well. My recommendation is to use either Linux or a Mac for easier deployment.
From the command line, you'll do something like this:
$ adb install yourdownloadedpackage.apk
If you've connected your device appropriately you should see your application if the install completed successfully.

Categories

Resources