webgl2 on Android Simulator - android

I try to display a web content built by Unity using webgl2 on Android Simulator based on Android 12.
It works correctly on simulator running on Linux Host but not on the same simulator running on Windows Host.
Can someone tell me why those different behaviors ?
val webView: WebView = findViewById(R.id.webView)
webView.settings.javaScriptEnabled = true
webView.loadUrl("http://10.0.2.2:8000")
On Windows 10 : "WebGL2 is not supported"
On Windows 11 : "both async and sync fetching of the wasm failed"
I use this command on host side to run the webserver: python -m http.server
Thanks

Fixed by using http-server of npm package and enable CORS
And also by forcing the opengles 3.0 renderer on the simulator advanced settings

Related

Problem launching Android Emulator from Capacitor App in VSCode

I have an Ionic Capacitor app running from VSCode, but am getting the following error when I try to launch the emulator directly from the IDE:
Multiple network interfaces detected! You must select an
external-facing IP for the dev server that your device or emulator can
access with the --public-host option.
I'm using the Ionic extension for VSCode to launch the Android emulator from VSCode, which ultimately is running the following command:
npx ionic build && npx ionic cap run android -l --external --target=Pixel_5_API_27
As shown that's a Pixel 5, using API 27. I've tried a couple of different emulators with different API versions but it behaves the same. I understand the error is indicating I need to provide a IP and port, but not sure exactly where to configure this, or if that's exactly what needs done.
This additional information is provided in the output, but also not sure where this would be configured, or as part of the command to run:
You must select an external-facing IP for the dev server that your
device or emulator can access with the --public-host option.
Note, this does work if I open my app from Android Studio and run it on the same emulator from within that IDE, so this is something specific to VSCode. Any idea on what I need to do to get this emulator to launch please?

Open Chrome in incognito mode on real Android Device using Appium

I'm using Appium to test my website on Chrome for Android.
I would like to add some options to Chrome for Android such as the incognito mode and the possibility to disable the cache. I tried with the following sample code but it doesn't work properly. Appium is able to open Chrome on my Android device, but it isn't in incognito mode and hence it doesn't disable the browser's cache.
Here there is the code snippet of my Python script:
import appium
from time import sleep
desired_caps = {
'platformName' : 'Android',
'platformVersion' : '7.1.1',
'deviceName' : 'ZX1G423BZQ',
'browserName' : 'Chrome',
'chromeOptions': {'args':['--incognito', '--disable-cache']}
}
driver = appium.webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)
driver.get("http://www.google.com")
timings = driver.execute_script('return performance.timing')
print(timings)
driver.quit();
My environment is as follow:
Mac OS X 10.12
Android 7.1.1
Appium 1.6.4 (the dmg package)
Python 3.6 and the Python wrapper to Appium
Chrome v. 61.0.3163.98
I'm not sure what my mistake is here. Maybe, I'm not using the chromeOptions argument properly, but I didn't find the right way to exploit it.
The capabilities to set incognito/Private mode are not supported for mobile device driver instances in Appium Selenium

Android Emulator from Mac to Parallels with Web API on Local IIS

I am developing a React Native mobile app in a Mac environment for both iOS and Android devices (iOS is running perfect as usual). I have Android Studio installed with all the necessary dependencies from the SDK Manager, and the project builds and starts up successfully on both Android emulator and iOS simulator.
Here's where the problem kind of starts. I also have Parallels installed running Windows 10 with Visual Studio 2015 (Shared Network setting in Parallels), which runs my Web API project on Local IIS. The goal is to have these devices make requests to the Web API project in the Parallels environment (Again, iOS is good, Android is the problem).
On the Windows machine, I have modified the hosts file to include
127.0.0.1 <IISHostName>
On Mac, I have modified the hosts file to include
<MyWindowsIPAddress> <IISHostName>
On Mac, I am able to hit the Windows dev environment using a REST client and from the iOS simulator. However, the Android emulator (Genymotion) does not. It comes back with an error "Network Request Failed".
I am guessing that in the "Dev Settings"->"Debug server host & port for device", there is an address that needs to be set in order for the emulator to communicate locally with the Mac, which will then communicate with Parallels, but I'm not sure. Any suggestions?
*Note: Most articles I've read give instructions for the Windows environment to be able to see an emulator on Mac, I would like it the other way around (Emulator on Mac -> Windows).
This can be done as follows:
From a windows command prompt, run ipconfig and snag your IP:
IPv4 Address. . . . . . . . . . . : 10.211.55.4
Next, modify your .vs\config\applicationHost.config to bind to all interfaces:
binding protocol="http" bindingInformation=":8080:" />
Restart your web api project
Navigate to http://10.211.55.4:8080/... from your android emulator's browser to confirm.

Visual Studio 2015 website development android emulator

I'm developing a website that I will soon port to Android, Windows 10, and iOS. I'm using an HTML/CSS/Javascript combo and I started the project in Visual Studio 2015 as a new website.
I am able to test the site using all of my installed browsers and Windows Phone 8.1 (the Windows 10 emulators open but won't debug for some reason). I would like to be able to test my site on an Android emulator while in Visual Studio. I can launch a number of Android emulators outside of Visual Studio just fine by launching "Visual Studio Emulator for Android" through the Start menu, but I cannot figure out how to use these for debugging. There is no Android emulator option in the "Browse with" menu and I don't exactly know how to add one.
I know the emulators are probably more for developing actual Android applications but if this is possible I would like to do it to test for mobile browser quirks. Thanks!!
Your best bet for debugging hybrid apps (And especifically those on mobile devices) is to use a tool like VorlonJS. Here's a video + walkthrough on how to use it.
What is it?
The fine folks on the TED team at Microsoft introduced VorlonJS during //BUILD last week. Vorlon is an open source, extensible, platform-agnostic tool for remotely debugging and testing your JavaScript. Powered by node.js and socket.io.
I put together a brief video tutorial on how to set up Vorlon and have it debug not only web applications running in desktop browsers, but also mobile ones. In this particular case, I cover Firefox and Chrome on the desktop, and IE 11 on a Windows Phone simulator.
To get started, you simply install run Vorlon from the Node Package Manager (NPM) with the following command:
npm i -g vorlon
Then call Vorlon from NPM to spin up an express server and you are ready to debug!
Vorlon
Add the following JavaScipt to any web app you want to debug, and Vorlon will communicate with it through the Vorlon express server you started in the previous step.
<script src="http://localhost:1337/vorlon.js"></script>
In my browser, I navigate to http://localhost:1337/ and I can see Vorlon running, and in a second tab, I nagivate to the address of the application I am running from local host and see that the two are connected!
As documented about Android Emulator networking, 10.0.2.2 is the address which allows the emulator to connect to your local development machine.
You probably need to type 10.0.2.2:64833 in the browser on your emulator.

DNS Problem with Android Emulator

I cannot use the browser and internet connection in my android app with android simulator.
When I try to open a homepage using the native webbrowser in the emulator, but when I use the ip address, it opens just fine.
How can I fix DNS problems in the android Emulator.
I already turned off the Windows Firewall, but it didn't work.
Data: Windows 7 x64 / Eclipse Plugin for Android / Android version 2.1
Do you have multiple NICs on your machine? The emulator might be trying to use a DNS that it cannot access (i.e. going through the wired DNS server if wired is disconnected). You can check which DNS server is being used by starting the emulator with the -debug-slirp flag.
See here for more info.

Categories

Resources