Winium.Mobile is Selenium Remote WebDriver implementation for automated testing of Windows StoreApps and Silverlight apps, tested on emulators (currently only Windows Phone/Mobile apps are supported).
Windows 10 mobile and Windows 10 Kit (C:\Program Files (x86)\Windows Kits\10\bin\x86) contains some interesting features and code.
This might be very interesting as API provided by Microsoft.Tools.Connectivity lists interesting methods. E.g. RemoteDevice has methods for file manipulation and launching of processes. This is not yet tested, but might be very interesting in context of launching driver as separate background process.
Windows 10 devices (and emulators) can be discovered over network. To enable this feature on device go to Settings -> For Developers and choose Developer mode and enable Device discovery.
To be able to connect to device from host you will have to pair device and host.
On device: press Pair.
On host: run WinAppDeployCmd.exe devices to list devices and note guid or ip of device you are interested in
On host: run WinAppDeployCmd.exe list -guid {0} -pin {1} where {0} is guid of device, {1} is pin displayed by device
On device press Done in Pair device window
For emulators this will keep your device and host paired until restart of device or host. To keep emulator paired after restart create checkpoint and set it as default:
In emulator chrome press Additional Tools button
Navigate to Checkpoints tab
Press New checkpoint
Once checkpoint is created click radio button next to it, so that it becomes default checkpoint.
Now when emulator is restarted, it will load this checkpoint, including pairing status.
Following is a sample of how to deploy application from programmatically using this new interface:
public IRemoteApplication DeployApp(IDevice device, FileInfo appxFile, List<FileInfo> givenDependencies, Guid productId)
{
string destinationIp;
string sourceIp;
int destinationPort;
device.GetEndPoints(0, out sourceIp, out destinationIp, out destinationPort);
var deploy = new Deploy();
var address = IPAddress.Parse(destinationIp);
var co = new ConnectivityOptions(address);
if (Device.IsApplicationInstalled(productId))
{
Device.GetApplication(productId).Uninstall();
}
deploy.DoInstallOrUpdate(co, appxFile, givenDependencies, Deploy.DeployAction.Install, null);
return device.GetApplication(productId);
}
Notes
This code will require SirepClient.dll and SirepInterop.dll to be put next to project output (or maybe in path).
productId can be found in app manifest.
Microsoft.SmartDevice.MultiTargeting.Connectivity and Microsoft.SmartDevice.Connectivity.Interface (found in GAC) will be needed for IDevice and IRemoteApplication.
Microsoft.Tools.Deploy.Host.Deploy and Microsoft.Tools.Deploy.Host.ConnectivityOptions (C:\Program Files (x86)\Windows Kits\10\bin\x86\WinAppDeploy.dll) will be needed for Deploy and ConnectivityOptions.
See deployment code from project on how to read manifest and get IDevice instance.
Windows 10 mobile and Windows 10 Kit (
C:\Program Files (x86)\Windows Kits\10\bin\x86
) contains some interesting features and code.This might be very interesting as API provided by
Microsoft.Tools.Connectivity
lists interesting methods. E.g.RemoteDevice
has methods for file manipulation and launching of processes. This is not yet tested, but might be very interesting in context of launching driver as separate background process.Windows 10 devices (and emulators) can be discovered over network. To enable this feature on device go to
Settings -> For Developers
and chooseDeveloper mode
and enableDevice discovery
.To be able to connect to device from host you will have to pair device and host.
WinAppDeployCmd.exe devices
to list devices and note guid or ip of device you are interested inWinAppDeployCmd.exe list -guid {0} -pin {1}
where{0}
is guid of device,{1}
is pin displayed by deviceDone
in Pair device windowFor emulators this will keep your device and host paired until restart of device or host. To keep emulator paired after restart create checkpoint and set it as default:
Additional Tools
buttonCheckpoints
tabNew checkpoint
Now when emulator is restarted, it will load this checkpoint, including pairing status.
Following is a sample of how to deploy application from programmatically using this new interface:
Notes
SirepClient.dll
andSirepInterop.dll
to be put next to project output (or maybe in path).productId
can be found in app manifest.Microsoft.SmartDevice.MultiTargeting.Connectivity
andMicrosoft.SmartDevice.Connectivity.Interface
(found in GAC) will be needed forIDevice
andIRemoteApplication
.Microsoft.Tools.Deploy.Host.Deploy
andMicrosoft.Tools.Deploy.Host.ConnectivityOptions
(C:\Program Files (x86)\Windows Kits\10\bin\x86\WinAppDeploy.dll
) will be needed forDeploy
andConnectivityOptions
.