debug android app on chromebook - android

I have an android app that works on the chromebook flip when using arc welder to install and run it. However, when I download the current version from the play store, or sideload the current dev version by copying over the apk, the app doesn't run. I get the splash screen and then a white screen and nothing happens.
I tried using chrome on the chromebook and doing chrome://inspect/#devices and chrome://inspect/#apps but i don't see my running app in either place. (The app is mostly a webview wrapping a JS application, so this is typically how I debug it). I also tried using the android chrome browser and also do not see my app there. I am not sure where to find the application logs, although I did try looking at the various system logs. The chromebook is in developer mode so I can get a shell and look around, but I couldn't find an app log. adb devices does not show my app, and adb logcat doesn't show anything either.
Anyone know how to debug a webview app on the chromebook?

There is no need to use ARC Welder anymore. Play Store can be installed directly on Chromebook.
Also remote debugging using ADB is possible. Follow instructions from here.
https://developer.android.com/topic/arc/index.html

Related

When updating Chrome on Android Studio's Emulator, Chrome crashes

I am using Android Studio's device manager to run an emulated android tablet device on my Mac (M1). Specifically, the device targets API 30 and uses the arm64 architecture. By default, this device comes with the Chrome browser, version 91.
My goal is to update Chrome to the latest version possible (as of this post, version 108). Unfortunately, what I've tried either doesn't actually update Chrome or results in Chrome crashing immediately upon start up.
1. Clicking Chrome's Update Button - does nothing
The Chrome browser prompts me to update it, but clicking on this does nothing. The menu just closes.
2. Updating Chrome from the Play Store - can't select my device
I tried going through the Play Store instead. However, when I do this, it prompts me to select a valid device via a dropdown menu, and the emulator is not selectable in this dropdown.
3. Installing the APK via Android Debug Bridge - Chrome crashes
Finally, various places suggest using adb to install a Chrome APK file. This gist summarizes the process (remove old chrome, download the desired APK, and install it via command line).
I believe I'm supposed to download the "arm64-v8a + armeabi-v7a" version, because the architecture must match and my device manager is telling me my architecture is arm64:
When I install via adb, I get the "Success" message, and I can see in the app info on the emulator that Chrome is now version 108. However, when I attempt to turn it on, it crashes immediately.
For what it's worth, I tried every available APK architecture in the list just in case arm64 was wrong, and they all result in the same thing: "Success", but crashing upon startup.
Is it possible to update Chrome on an android emulator? Is there something I may be missing when installing the APK?
Let me know if more info is needed!
So, posting this question was apparently enough info for Stack Overflow to give me a good "Related Questions" list, and I found an answer on Is Google Play Store supported in avd emulators?.
Essentially, only some images support the Google Play Store; I hadn't realized this. That was why my attempts 1 and 2 (update via Chrome or Play Store respectively) didn't work. Once I used an image that supported the Play Store, I was able to update Chrome just fine!
Inconveniently, none of the tablet images support the play store, but there's a workaround.
Getting a Tablet Emulator with Google Play Store
Select an image that supports the Play Store (indicated by the icon in the Play Store column). I was only able to find these in the Phone section.
Download one of the provided system images. We only care that this image is downloaded, and we don't actually need to create this device.
Go back to the Device Manager and find your tablet image. Use its dropdown menu to Wipe Data and then Show on Disk. You may duplicate the image first, but wiping the data is important for the emulator to start on a clean slate.
Clicking Show on Disk should have brought up the files for that image. Locate config.ini and open it.
Change PlayStore.enabled from false to true.
Change image.sysdir.1, replacing where it says google_apis with google_apis_playstore instead. We downloaded this image on Step 2.
Save and start up the emulator. You now have a tablet emulator with the play store enabled!

Is there an alternative to the chrome feature flag "CommandLineOnNonRooted" to test a TWA

I am trying to use a TWA as explained in the original documentation (https://developers.google.com/web/updates/2019/02/using-twa). I tried setting the chrome flag Enable command line on non-rooted devices to Enable, but Chrome is telling me after the relaunch that You are using an unsupported feature flag: CommandLineOnNonRooted. Stability and security will suffer. I tested this on two real Android phones, one on Android 10, one on 9. I also tested it with multiple emulator devices on different Android versions but I am getting the same error message.
Is there any other way to test that the URL bar is not visible in the TWA, without the verification on the website part?
This feature is for debugging reasons. If you just want to test if the Url Bar is visible or not you do not have to enable this feature.
From the Link, getting Started with TWA:
Enable debug mode:
Open Chrome on the development device, navigate to chrome://flags, search for an item called Enable command line on non-rooted devices and change it to ENABLED and then restart the browser.
Next, on the Terminal application of your operating system, use the Android Debug Bridge (installed with Android Studio), and run the following command:

Verify how an Instant App in Android is launched

According to the documentations, an Instant App is downloaded via Google Play and launched on the fly. It is not installed but is rather cached in the Android system. As a developer and user, I would like to validate this behaviour.
I have tried running Clash Royale by hitting the "Try now" - that is when a splash screen is shown with a progress bar (assuming that's when the feature APK is downloaded?) and it launches soon. On exit, there is no application icon which is expected.
In the device storage I looked for trace of the APK but with no success. Do I need ROOT permissions to see this? Is there a way to inspect and verify?
There is still an APK installed.
For O+ devices, run adb shell pm path com.supercell.clashroyale after TRY NOW
And you'll see:
package:/data/app/com.supercell.clashroyale-CUaYOumzCbUDNAdv1MRtRg==/base.apk
package:/data/app/com.supercell.clashroyale-CUaYOumzCbUDNAdv1MRtRg==/split_split_2_tutorial_battles.apk
Do it again after INSTALL (for comparison), and you'll see:
package:/data/app/com.supercell.clashroyale-0Dn0s6yq6WqGCRZ9ETT8bA==/base.apk
package:/data/app/com.supercell.clashroyale-0Dn0s6yq6WqGCRZ9ETT8bA==/split_config.arm64_v8a.apk
package:/data/app/com.supercell.clashroyale-0Dn0s6yq6WqGCRZ9ETT8bA==/split_config.en.apk
package:/data/app/com.supercell.clashroyale-0Dn0s6yq6WqGCRZ9ETT8bA==/split_config.xxxhdpi.apk
(For pre-O devices, the first part won't work, but I don't know any other cmd that will do the same)
You can navigate to Settings -> Apps, and see instant apps there. The App Icon will have Lightning bolt sub-icon at least it looks like that on Samsung Android 12.

Another way to debug an android app

I want to debug my android application, I have Eclipse Installed fully setup for android developement.
The problem is,
1) I can't run android emulator(Hardware Concerns).
2) I can't attach phone to my computer(Driver Concerns).
Now,
Is there a way to get debug functionality by putting directly the apk into the phone storage and installing it from there.
I wanted get the logcat of the application that I'll be running.
Basically I'm quite naive in android, I'm not quite sure of the terms I said but, What I want is a way to test my app on my phone without the role of my PC.
If you have root you can use Wifi ADB
Also you can remove drivers for this device and install other driver from your device manufacturer.
If you can run standard emulator you can use Genymotion.

How to run Google Glass Project on emulator?

I don't have a google glass device. But I am very interested to do apps for Google Glass. I want to run a Hello World in Google Glass without the use of device.
I followed the tutorials for Google Glass. Then I found some sample projects of Google glass. Can Anyone tell me how to run a simple Google Glass Project on an emulator or without a device.
And can you tell, Is there any alternative way to test the Glass APK developed by us without device.
First you need to set up Glass On mobile or an Emulator in Web. Gooogle Glass is orignally a launcher over android you need to install the apks of that launcher.
Here you will find the APK's (however Camera for Glass never worked for me.)
Here is an Album showing you the process (on Nexus 7)
And This is the set of Demo's
After all set up you have to connect the android phone and then install the apk's using adb.
e.g.
adb install -r com.sample.packagee
after that you can launch the app through voice command or if it doesnot support voice trigger then launch it like
adb shell am start -n com.mikedg.android.glass.launchy/.MainActivity
I am writing down a wiki for the issues and the to do's Please check it here..
There are no simulators right now available to do perform testing without the device.
First :
You can try this https://github.com/zhuowei/Xenologer and install the apk on mobile device which is more or less similar to what you are looking for.
Second :
You can try thus but u have to build your application based on Mirror API http ://glasssim.com/ or
https ://developers.google.com/glass/tools-downloads/playground
Third to have your custom apk install :
https ://developers.google.com/glass/develop/gdk/quick-start#installing_the_samples
To display your hello world Try second option it should work. It will add your card in Glass Timeline.
Hope this answers your question.
Thanks
There is not an emulator for Glass at this time. Testing on Glass is an important part of a Glassware development life cycle as the user experience is completely different from what you can experience on a phone or an emulator.
Feel free to follow issue 253 on our issue tracker for updates as the GDK evolves.

Categories

Resources