Bizet
Bizet

Reputation: 56

Xamarin Forms UWP start application with parameters

I have a Xamarin project (Droid and UWP(Fall Creators)) and I would like to start the UWP application by passing parameters.

I found how to start the application from command :

 explorer.exe shell:AppsFolder\TestCommand_7ngdmc6chkqa8!App

Now I am looking to add parameters. I found some examples for UWP but it doesnt work with Xamarin.

Has anyone ever tried and found a solution?

Thanks

Upvotes: 1

Views: 539

Answers (1)

Nico Zhu
Nico Zhu

Reputation: 32775

The command line explorer.exe shell:AppsFolder\TestCommand_7ngdmc6chkqa8!App could not be used to launch UWP app with parameter. Windows Store apps aren't designed to run from the command line and there isn't a straightforward way to launch them from the command line. Although you can find some blogs about the above command line, but we could not recommend that.

Currently, It is a better way that launch UWP app with Windows.System.Launcher APi. But you need to register the protocol for your app at first.

After registered the protocol, you could also launch the App in the command prompt.

start [protocol name]:[parameter]

Example

start microsoft-edge:http://www.google.com

For more you could refer Launch an app for results.

Upvotes: 3

Related Questions