[TIMOB-20095] Windows: Cannot deploy app to Win 10 Mobile emulator
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-12-14T21:42:06.000+0000 |
Affected Version/s | Release 5.2.0 |
Fix Version/s | Release 5.3.0 |
Components | Windows |
Labels | qe-5.3.0 |
Reporter | Christopher Williams |
Assignee | Christopher Williams |
Created | 2015-12-03T14:20:44.000+0000 |
Updated | 2016-04-12T20:58:08.000+0000 |
Description
With recent changes, we can get the listing of Win 10 emulators and can attempt to deploy using the old AppDeployCmd, but that fails complaining about bad XML. Attempts to manually open the solution in VS215U1 also failed to manually deploy (complains it can't copy the TitaniumWindows.winmd file from the SDK).
I also attempted to see if there were other workarounds for deploying. It _looks_ like the new WinAppDeployCmd could install an app on the emulator if we knew the IP address the emulator is using (in the range 169.254.x.x). I tested this manually after the emulator was launched and that appeared to work (well, it didn't fail but the app didn't load properly, maybe the same issue as from VS2015?).
The wrinkle is that I see no way to determine what IP the emulator is using. There are powershell scripts out there (i.e. http://www.ravichaganti.com/blog/get-hyper-v-windows-server-2012-guest-network-configuration-using-wmi/) that say you can, but I always get empty list of IP addresses.
When using the AppDeployCmd from 8.1 tooling, I get the same issue as described here: https://social.msdn.microsoft.com/Forums/exchange/en-US/97ac9637-7c74-4ba9-931e-f446156491cd/uwpdeploy-windows-10-app-to-windows-phone-10-device-without-visual-studio?forum=wpdevelop
https://social.msdn.microsoft.com/Forums/en-US/ce23adc6-53a0-44c6-8e75-7b57a33ebe84/uwp-how-to-programmatically-deploy-appx-to-win-10-mobile-emulator?forum=wpdevelop
https://blogs.windows.com/buildingapps/2015/07/09/just-released-windows-10-application-deployment-tool/
https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/10994868-full-emulator-support-in-winappdeploycmd
Here's the initial support for it at the windowslib level. If this PR gets approved/merged, I'll need to publish the package and then update titanium_mobile. https://github.com/appcelerator/windowslib/pull/27
https://github.com/appcelerator/titanium_mobile/pull/7569
After setting this up on the build machine, I ran into an issue I didn't locally. It looks like when Visual Studio starts up an emulator for the first time it also does some other work: - It enables developer mode on the emulator - It turns on device discovery - It pairs with the emulator using the pin from the emulator - It then generates a default checkpoint to boot to on subsequent starts We need to investigate if we can do these steps as well. there are powershelgl cmdlets to do hyper-v checkpoints, so that should be do-able, but the interactions with the emulator to turn on developer mode, discovery and pair look to be more difficult and likely are done using undocumented APIs in some DLLs. W may not be able to do this for the user and may need to tell them how to do so manually or ask them to launch the sun file in VS2015 and deploy to the emulator at least once there.
Some possible avenues for enabling developer mode, etc: http://blogs.msdn.com/b/dglover/archive/2015/05/05/how-to-enable-developer-mode-on-windows-10-mobile-technical-preview.aspx http://stackoverflow.com/questions/30249551/enabling-developer-mode-on-windows-10-build-build-10074 https://technet.microsoft.com/en-us/library/hh848539.aspx https://msdn.microsoft.com/library/windows/apps/xaml/dn706236.aspx
Verified as fixed, I am now able to deploy a mobile project to a windows 10 mobile emulator, running the following command in the mobile project root directory:
appc run -p windows -T wp-emulator --wp-sdk 10.0
Tested on: Windows 10 Pro Windows Phone 10.0 Emulator Ti SDK: 5.3.0.v20160411203046 Appc NPM: 4.2.5-1 Appc Core: 5.3.0-12 Node: v4.4.2 *Closing Ticket.*