I'm trying to automate the testing of a web page on a Windows Phone Emulator.
For that I need to launch the browser from a command line, but I haven't found anything to do this.
Can you help me?
Here is a workaround. You make a simple app with a WebBrowser control. Now, you can start this app from command prompt,
This launches an app from PC:
XapDeployCmd.exe /launch <Product ID/Xap FileName> <targetdevice[:param]>
You can get targetdevice[:param] from XapDeployCmd.exe /enumerateDevices. You also know the Product ID of your app.
This XapDeployCmd is in C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\XAP Deployment
Example
XapDeployCmd.exe /launch f8ce6878-0aeb-497f-bcf4-65be961d4bba /targetdevice:0
Related
I am working in WSL2 on Windows 11 trying to run an index.js file with Live Server. Whenever I open Live Server it seems that I can only do so when I use Microsoft Edge. This seems to add another layer of problems because the JavaScript does not seem to be working as I would expect. For example, if I click a button element I don't see any animations to signify a "click".
I have checked that "liveServer.settings.CustomBrowser": "chrome" is indeed reflectin Chrome in the VS Code settings, but when this is the case there are no windows that pop up at all. The only thing that I see trigger is a notification that tells me that the server is active on Port 5000, just no window popping up to demonstrate that. Ideally I would like to try and open Live Server with Chrome, but if this isn't possible in Windows 11 then is there a way to make JavaScript behave in Microsoft Edge?
I've the same configuration and the same issue. I've raised the issue #2445 in Github.
A workaround solution is to call directly your chrome program installed under windows to your liveserver setting.
check that chrome is well installed on W10 or W11. You can test it by opening a command line and running "start chrome", then chrome browser must open.
look for chrome' installed directory. You can use this command to find it: sudo find /mnt/c/ -type f -iname chrome.exe 2>&1 | grep -v "Permission denied". For me this it's here:mnt/c/Program Files/Google/Chrome/Application.chrome.exe.
Now change liveserver setting on your settings.json file:
{
"liveServer.settings.AdvanceCustomBrowserCmdLine": "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe --remote-debugging-port=9222",
}
Now chrome should start when you run liverserver.
Hope this help
I work with AVD emulator and I have to restart my PC again and again because of some updates. so each time I start the pc, I have to run the custom bat file to start the emulator again and that becomes a tidy process to me.
Here is my way to make bat file to open emulator
I have searched on stackoverflow and on other places but couldn't find the exact solution.
Here are some relevant links
Run AVD Emulator without Android Studio
https://developer.android.com/studio/run/emulator-commandline
For Windows Users
Make a shortcut of your bat file
Press Ctrl+R
Write shell:startup (it's a command to reach to startup folders) and press enter.
it will open a location in my case it is like "C:\Users\UserName\AppData\Roaming\Microsoft\Windows\StartMenu\Programs\Startup"
Paste your short cut here and on next start up your bat file will run automatically and will open the AVD emulator.
I am trying to clear app's data from several emulators, in a loop inside a bash script.
Doing so from the terminal indeed clears the app's data, but doing so from a bash script will also uninstall the app from the emulator and close the emulator's window (UI).
I don't want my app to be uninstalled as i need to test it.
Is there a reason that this command works differently when executed from terminal vs. when executed from bash script? When executing from a script against a real device it works perfectly as it should - clear the app's data without uninstalling the application from the device.
I found the answer.
When the emulator is open (with GUI) - the command will work as it should, that is clear the app's data.
When the emulator is open without GUI - the application will also get uninstalled.
I am really struggling to get Google Chrome Remote Debugging to work! I have the phone setup and confirmed:
Then below are what I see in chrome://inspect/#devices and also F12 (both open at the same time);
It flashes with the "Connected" for about 3 seconds, and then goes to:
Offline
ZX1G324RSV Pending authentication: please accept debugging session on the device.
It's driving me nuts, as it should be simple to do, but it just doesn't want to play ball :/ Do I need to do anything special? I've used it before on this PC and although I had some fun and games with it the first time around, it worked after that.
There seems to be a ton of posts/articles about how to fix it, but none of them are working for me. https://bugs.chromium.org/p/chromium/issues/detail?id=450492 for example.
Download Android SDK here ("SDK Tools Only" section) and unzip the content.
Run SDK Manager.exe and install Android SDK platform tools
Open up the Command prompt (simply by pressing the windows button and type in cmd.exe)
Enter the path with ex: cd c:/downloads/sdk/platform-tools
Open ADB by typing in adb.exe
Run the following command by typing it and pressing enter: adb devices
Check if you get the prompt on your device, if you still can't see your phone in Inspect Devices run the following commands one by one (excluding the ") "adb kill-server" "adb start-server" "adb devices"
Here are the things that you can try:
Try different USB cable(s)
Try different USB ports on your machine(for some people using 2.0 port worked out)
Try the same process, with unchecked 'Discover USB Devices' in chrome://inspect (then Chrome will connect through the ADB server, not directly) ==> This solution worked in my scenario.
When I launch google apps[which is developed by myself] from command line, for example:
chrome.exe --load-and-launch-app="C:\Users\KyawKhaing\Desktop\chrome\Chrome App\Example2"
After I run this, I see Google Chrome Browser open first follow by my google chrome apps launch. I don't want to open google chrome browser when I launch a chrome app. Any one know the solution. Is it possible?
Use the --silent-launch argument.
chrome.exe --silent-launch --load-and-launch-app="C:\Users\KyawKhaing\Desktop\chrome\Chrome App\Example2"
As I was running automation scripts in java, i did notice that chrome did not open using command prompt.
Runtime.getRuntime().exec("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe \"http:\\www.google.com\"");
From Windows 7, I fixed the problem with the following steps:
Go to the folder C:\Program Files (x86)\Google\Chrome\Application
Right-click on chrome.exe
Select Properties
Select the Compatibility TAB
Click on the "Change settings for all users" button
Make sure to put a Check Mark on "Run this program in compatibility mode for:" and
Select "Windows 7" from the drop down list.
Enjoy!
I don't think you can do it currently. It is a reasonable feature request! You can make feature requests at http://crbug.com/new
There is a bug already logged for this, see http://crbug.com/175381.
We are working on making app background pages keep the browser process alive; once this is done we can fix this bug. The problem currently is due to the way the process is kept alive - if we don't show the browser window the process exits between loading the app and the app opening a window.
I don't think you can do that. The browser is the environment of the app. Its like trying to run a windows app, without running windows. The app depends on the browser. You can't open the app without opening the browser first. Sorry. Hope this helps.