Windows Phone Utility Library
This is a library of utilities for dealing programmatically with Windows Phone applications, used namely for tools like Titanium.
windowslib supports Visual Studio 2012, 2013, and 2015.
Installation
From NPM:
npm install windowslib
From GitHub:
npm install git://github.com/appcelerator/windowslib.git
Caveats
- Some of the emulator detection functionality requires the use of PowerShell scripts. For the library to be able to execute these scripts, the user must change their ExecutionPolicy by running the following in a PowerShell terminal as the Administrator:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
- If attempting to connect to a device, you need to ensure the connected device is not asleep/locked or connecting will fail. There's no way to programmatically unlock the device.
Examples
Detect all the connected Windows Phone devices:
Note: Microsoft's tooling always reports a single device present regardless if
there are no devices connected or several. The device will have an ID of 0
(zero).
In the event Microsoft's next mobile platform has improved tooling that supports multiple devices, this detection code should be good to go.
var windowslib = ; windowslibdevice;
Install an Application on Device
var deviceUDID = null; // string or null to pick first device windowslibdevice ;
Launch the Windows Phone Emulator
Passing in null for the udid
will auto-select a emulator and launch it.
windowslibemulator;
Launch, install, and Run an Application on the Emulator
var udid = null; // string or null to pick an emulator windowslibemulator ;
Force Stop an Application Running on the Emulator
windowslibemulator ;
Detect Everything
windowslib;
Running Tests
For best results, connect a Windows phone device.
To run all tests:
npm test
To run a specific test suite:
npm run-script test-assemblies
npm run-script test-device
npm run-script test-emulator
npm run-script test-env
npm run-script test-logrelay
npm run-script test-process
npm run-script test-visualstudio
npm run-script test-windowsphone
npm run-script test-wptool
Reporting Bugs or Submitting Fixes
If you run into problems, and trust us, there are likely plenty of them at this point -- please create an Issue or, even better, send us a pull request.
Contributing
windowslib is an open source project. windowslib wouldn't be where it is now without contributions by the community. Please consider forking windowslib to improve, enhance or fix issues. If you feel like the community will benefit from your fork, please open a pull request.
To protect the interests of the windowslib contributors, Appcelerator, customers and end users we require contributors to sign a Contributors License Agreement (CLA) before we pull the changes into the main repository. Our CLA is simple and straightforward - it requires that the contributions you make to any Appcelerator open source project are properly licensed and that you have the legal authority to make those changes. This helps us significantly reduce future legal risk for everyone involved. It is easy, helps everyone, takes only a few minutes, and only needs to be completed once.
You can digitally sign the CLA online. Please indicate your email address in your first pull request so that we can make sure that will locate your CLA. Once you've submitted it, you no longer need to send one for subsequent submissions.
Legal
Copyright (c) 2014-2015 by Appcelerator, Inc. All Rights Reserved. This project is licensed under the Apache Public License, version 2. Please see details in the LICENSE file.