Automated testing for Windows Phone 8 - windows-phone

Hitting a couple of issues attempting to setup automated testing of our C++ code on Windows Phone 8.
1) I'm hitting the limit of installed applications on our device. Is there any way to automate uninstalling the applications on the device? Via the command line?
2) Is there a recommended method to run unit tests on WinPhone8? Currently, I'm using devenv to load/run the our solution file. This has provided inconsistent results. The Windows Phone debugger doesn't get set in some cases, this causing a 'debugger not set' error when attempting to run.

Here is some good information on unit testing in Windows Phone 8:
http://www.microsofttranslator.com/bv.aspx?from=&to=en&a=http://qmatteoq.com/blog/post/unit-testing-in-windows-phone-8-the-basics
http://wp.qmatteoq.com/unit-testing-in-windows-phone-8-asynchronous-operations-and-mocking/

JustinAngel's answer https://stackoverflow.com/a/13429709/2087252 gives an example how to automate installing, running and deleting of applications on Windows Phone 8.
To make it work you'll need to reference following dlls from your project:
Microsoft.Smartdevice.Connectivity.Interface.dll
Microsoft.Smartdevice.Connectivity.dll
Microsoft.Smartdevice.MultiTargeting.Connectivity.dll
If you want to run your application/test on emulator, you can start it with following command line:
"C:\Program Files (x86)\Microsoft XDE\8.0\xde.exe" /name "Emulator WVGA 512MB.username"
where username is your windows username.

Related

Hololens 2 emulator for openxr hello_xr test

I am working on Windows 10 with Windows Mixed Reality Runtime and Hololens 2 emulator to run the hello_xr test . I was able to build the project using Visual Studio 19 and run it from command prompt as follows
hello_xr.exe -g D3D12 -ff Hmd -vc Stereo -bm Opaque -s Local
This is unable to get system and throws the following error although Hololens 2 emulator has been launched prior to running the above command
[16:09:52.495][Info ] Press any key to shutdown...
[16:09:52.586][Info ] Available Layers: (0)
[16:09:52.616][Info ] Instance RuntimeName=Windows Mixed Reality Runtime RuntimeVersion=112.2211.2002
[16:09:52.623][Error ] XrResult failure [XR_ERROR_FORM_FACTOR_UNAVAILABLE]
Origin: xrGetSystem(m_instance, &systemInfo, &m_systemId)
Source: ..\..\..\src\tests\hello_xr\openxr_program.cpp:298
Maybe I should launch the test from within Visual Studio using Hololens 2 emulator as debug target for this to work. But I am not sure how that can be achieved.
How do I go about debugging this? I just started with XR development.
This was solved in the Khronos forums.
Update (adding some context in case the link is unavailable later):
Instead of hololens emulator we can also use Windows Mixed Reality Portal or SteamVR to run the hello_xr sample. I used SteamVR along with an android phone. Steps followed were
Install SteamVR.
Change the active runtime from Windows Mixed Reality to SteamVR. The path to the manifest json file for SteamVR should be {drive}:\Program Files (x86)\Steam\steamapps\common\SteamVR\steamxr_win64.json . Registry editor can be updated to change the active runtime, details about runtime discovery can be found in the loader spec.

Developer unlocked windows phone gets locked for no reason

I have 2 windows phone devices on my account that I use for testing. But they get locked for no reason.. I have to unlock it almost everyday. It even happened twice in one day. I haven't figured out what is causing this...
Is anyone experiencing this same issue?
**** UPDATE MESSAGE ****
This is the latest bizzare update on this bug... I've pasted my post in Microsoft Forum below:
I'm experiencing a very strange bug that I don't know if it is on the Windows Phone SDK or in Visual Studio.
I have 2 WP 8.1 devices to test an app that I'm developing. This was the sequence of events that led to this lock down:
Suddenly one phone that I used the most started to ask, almost everyday, to develop unlock the device...
Then the other phone started to do the same.
Now everytime I make a release version and run it targeting Device in Visual Studio, VS 2013 crashes... And the phone gets developer locked again.
Then I found a workaround that was to use the Application Deployment tool from the SDK only to test the release version. (Debug version it deployed without any problems on the device)
Today I forgot the manually deploy the XAP and clicked run in VS. VS crashed... Then I tried to deploy using the SDK tool it said that phone was locked... I unlocked it and clicked on the Deploy button again. Then the error: The maximum number of developer applications on this phone has been reached appeared.
I've uninstalled the app from the Windows Phone device manually and tried again and the same error occured.
I tried the other test device and had to register it again and got the same error.
Now I can't deploy any release version and I don't know how to fix this issue.
Do you know how can I fix all this Visual Studio bugs? I can't seem to find anyone else with the same problem as I'm having.
No, i have three unlocked devices in my account but one wp8.1 and other two win10, if you can upgrade your wp8.1 devices to windows 10 do that using that app because windows has inbuilt feature to developer unlock device, so your device won't get locked again automatically.
if you don't want to upgrade to and need assistance go to this link
this link requires you to login with your outlook account or may require you to login with your windows developer account.
and extra information if don't have windows developer account and want to publish your app go to this link from your windows mobile device or directly search for "Dev Share" App in windows store.

Can't get WinAppDeployCmd for Appx deployment to work

During the App Packaging and Deployment for Universal Windows Apps presentation (fast forward to 00:36:00) one specific command line utility - WinAppDeployCmd - was used for deployment Windows 10 Universal application to the phone running Windows 10 Mobile. This utility could be found here:
"c:\Program Files (x86)\Windows Kits\10\bin\x86\WinAppDeployCmd.exe"
But every time I'm trying to deploy sample .appx package to the Lunia 635 phone with Windows Mobile v10.0.12562.84 or Surface 3 device with Windows 10 Pro Insider Preview (all devices on the same network as my dev machine) - I'm getting the same "connection failed" error:
Windows App Deployment Tool Version
10.0.0.0 Copyright (c) Microsoft
Corporation. All rights reserved.
Opening connection to device at '192.168.1.139'.
0x80131500 - Connection Failed
0x800705B4 - Timed out waiting for
network events.
Just in case - I could ping both of the devices from my dev machine without problem and can also deploy to any of them from VS2015RC (also tried with renamed WinAppDeployCmd.exe - to make sure that VS2015RC doing deployment somehow differently without using this tool).
So, I'm wondering - are there anyone who succeeded with app deployment using WinAppDeployCmd.exe?
This is a known issue in the current release. There is no workaround and it will light up in a future Windows 10 Insider Preview SDK and tools release.
https://social.msdn.microsoft.com/Forums/en-US/5c8d6f20-699c-4da2-9460-f73e89bf27c3/known-issue-cannot-sideload-applications-using-winappdeploycmd-windows-10-insider-preview-sdk-and?forum=Win10SDKToolsIssues
I have succeeded to deploy an .appx using the WinAppDeployCmd command line tool. Probably the issue have been correct at the latest versions.
For the ones that are not familiar with this tool, it allows you to deploy an Universal Windows app from a Windows 10 machine to any Windows 10 Mobile device via USB or WiFi (since they're on the same subnet). That's a perfect solution if you doesn't have Visual Studio, doesn't have the app source code or if you're under a Hyper-V Virtual Machine.
Basically you will need:
Windows 10 SDK
Generate the .appx package (PC)
Enable the developer mode (Mobile)
Turn on the discovery mode (Mobile)
Get the code to pair devices (Mobile)
Get mobile IP address using WinAppDeployCmd tool (PC)
Run command (PC)
The command will look like this
WinAppDeployCmd install -file “<path>” -ip <ip> -pin <pin>
The tool can be found at C:\Arquivos de Programas (x86)\Windows Kits\10\bin\x86\WinAppDeployCmd.exe
You can find a detailed step-by-step tutorial here
This happened to me once when the USB socket was faulty and Windows compained about the device not being recognized. I switched sockets and everything worked. So make sure you try other sockets (or even a different computer, to rule out the specific machine).
This tool let's you install but does not run the app after install like it did the first version in windows 8.1

Can't execute ISETool.exe from the command prompt (Windows 8)

I'm trying to use the Isolated Storage Explorer tool from Windows Phone SDK in order to retrieve data stored in specific Windows Phone Apps' IsolatedStorage and copy it to a folder that resides in my computer.
My computer runs Windows 8 Pro, and i have both the WP7 and WP8 SDKs installed.
The problem is that when i run the command prompt and insert a command line (such as the one below) i get an error that states:
"This app can't run on your PC"
How do i solve this? Thanks
Example:
ISETool.exe ts xd f8ce6878-0aeb-497f-bcf4-65be961d4bba c:\data\myfiles
I'd suggest you try using the Windows Phone Power Tools instead of what you are doing there. It will give you a nice UI to work with instead of trying to get a command line tool to work.
If you really want to use that tool then please post which directory you are running it from otherwise it is hard to tell why it won't work.

Metro console application in Windows 8

Is there a way to build metro application that runs in console?
There is no console in the "Metro*" interface. There is still a command prompt on the desktop and that has not changed from Windows 7. This is not going to allow you to run a "Metro*" app, however - it is a command prompt.
I think you may need to do a bit of research into what the "Metro*" UI is, and what it is not.
* This UI is no longer called "Metro", but I have referred to it as such to avoid clouding the issue.
You can use a console if you need that in Windows 8, and your console applications will continue to work. But this is not Metro.