Unable to run android emulator in build agent connected to my local machine in TFS - android-studio

I am stuck with an issue which I dont seem to find any way to fix it.
I have created a batch file to launch the android emulator
emulator -avd myEmulator -gpu swiftshader
adb wait-for-device
when I open cmd and run the batch file manually in my machine, I am able to launch the emulator.
Now, I have a Batch Task added in TFS which points to the above batch file in the repository.
Whenever I run the task, I see the below information
The emulator seems to be running in the backgroud because when I try and start the same emaulator manually when the build is running, it gives me the error Emulator is already running. How do I fix this. i want the emulator to launch and be visible. I didnot add any script to run in the background because if I run the batch file manually it seems to be working. Please help

Update:
As an interactive process with auto-logon enabled. In some cases, you
might need to run the agent interactively for production use - such as
to run UI tests. When the agent is configured to run in this mode,
the screen saver is also disabled.
Try to run your build agent under Interactive mode. More details please refer our official doc here: Interactive vs. service
According to your description, TFS seems succeed creates and starts emulator in background, and waiting for full android loading on emulator.
To get a workaround, could you try to run the emulator directly on the build agent machine instead of your local machine.
You could setup your own agent and instance on a local machine that runs an emulator. Check if this do the trick.

Related

Install windows updates on Azure Virtual Machine W10

I have a Windows10 Azure Virtual Machine running, and via the Windows Update Config screen (in Windows) I see several updates ready to install. However, the Update and Restart option in the start menu doesn't seem to do anything, and the same for the Restart functionality in the Virtual Machine pane of Azure.
I created an Update Management schedule (via Guest & Host Update menu), but this also doesn't seem to do anything. It succeeds after one minute, and when I look on the VM it still lists the updates as needed to install.
How can I install these updates on a Windows10 Azure Virtual Machine?
Try following the steps in this article to clear the Windows Update Cache. Then attempt installing one at a time
https://blogs.technet.microsoft.com/mckittrick/windows-update-issues-clear-windows-update-cache/
If that fails, please try the following :
Click on Start, and then click Run.
Type cmd in the Open box to get a DOS prompt.
Type "net stop wuauserv" without the quotes at the command prompt, and press
Enter.
Delete (or put in recycle bin) the contents of
C:\WINDOWS\SoftwareDistribution (but not the SoftwareDistribution folder)
Type net start wuauserv at the command prompt, and press Enter.
Now try Windows Update again.
If the issue still persists, kindly share the screenshot of the windowsupdate
Also is this the only VM where the issue is happening?

.NET Core Container Exits After Run

I have a simple .NET Core API that returns a simple hello world string at port 80, I have built it into a docker container which works. I am able to run it locally in detach mode after building it through visual studio, however after I uploaded it to the azure container registry and tried to pull the container from the azure container registry it will no longer run in detach mode and it exits right after the run command.
NOTE: before I pulled the image from the registry I removed the original version of the image.
It turns out the problem was I was trying to run an image built from my debug environment in visual studio, Once I build the image from release in VS then it worked in detached mode after I pulled it down from the Azure Container Registry. I am assuming (this is the theory I am researching to confirm) the images VS tags as :dev need to be run alongside VS so they can be debugged and stepped through, while the release build images can run without VS.

Emulator is running, but doesn't execute my program

I'm new in using android studio. I don't have any error, whenever I run my program and the emulator runs, it doesn't execute my program and stays like this.
it happens sometimes,
probebly you turned it on for the FIRST TIME
go to apps, can you run your app from there?
only after the first time it runs you will be able to run the app automatically.

TFS run local process

i have TFS express 2015 running on a local machine, i'm trying to get it to run a local process (a calculator window) as a second step after building.
i've tried command line, tried batch script and even tried powershell. the second step seems to go through just fine but no calculator is beeing opened.
is there anything i'm missing here? the TFS Express is installed on the same machine that runs visual studio.
please help!
For XAML build
If you want to open the local process (for example notepad) during Team Build, you need set your Build Service running as Interactively, launch your TFS Admin Console>>Build Configuration>>Build Service Properties>>Stop the service>>selected Run the Service Interactively.
Then you need to customize your build process template to create a InvokeProcess activity. You can use the InvokeProcess activity to start a process (run a program) on the build server. This activity is essentially a wrapper over Start. In your InvokeProcess activity, set FileName = “C:\Windows\notepad”.
After above two steps, you can open the notepad during Team Build. When running your build definition, the notepad will be opened on your build agent machine, and your build keeps on running this open notepad activity. You need logon your build agent using your TFS Build Service account, then you will see the notepad be opened on build agent machine, after you close this notepad, your build will continue run next steps.

Kernel debugging in VS 2012

I have a Kernel mode filter driver project. Host: Win8 Pro x64 running VS2012, Target:Win8 Pro x64 VM on the same machine. I was able to provision the VM through VS 2012 over the network. I deployed the package project. When I try to deploy and Install the package from VS, I am not able to succeed. So I manually installed the driver and the driver works fine. After installing the driver manually, I attach to the kernel of the VM and click on Break all. I find the Kd console in the immediate window of VS '12. I type the command "bu !DriverEntry" and then I type the "g" command. I see the message Debuggee is running. When I place break points on my code and press any key in the VM, I don't see the break points getting hit in my code. Need help!!
Use Fltmc command to load and attach your filter to a specific drive
You can put breakpoints directly in VS without the need to type in the console, if your filter is getting loaded after you type fltmc load "filter name" VS should stop at the driver entry function breakpoint, you may also need to attach it.
Dont forget to check if your debugger is working by when you click break all target machine should freeze.
I wasn't able to debug through VS. I went for a work around and this time I used a Win7 VM. Made use of the KdPrint() method and used the DebugView tool to see the messages. This is a lengthy process but atleast I'm able to debug my driver. Hope this helps someone else too

Resources