Share xamarin app with friend for testing - xamarin

thanks in advance. I've been working on a Xamarin app that I hope to market before too long. It's at the stage where I'd like to share it with one or 2 beta testers on Windows 10. however, I am unable to run the app outside of Visual Studio (where it works fine). When I try to click on the relevant debug or release .exe in Windows Explorer nothing happens. How can I let my beta testers try it without having them install VS and giving them the entire project?

If you have registered a Microsoft developer account and paid for it, then you can add your tester's Microsoft account to the console, then you upload your app to the console, they can see it in the store for testing.
Otherwise, you can make an offline bundle file using the visual studio publish wizard. For more info, see the details.

Related

Xamarin Form Won't Deploy Visual Studio 2019

I'm new to creating Mobile Android apps using Visual Studio and I've started creating a new Xamarin Forms project. I didn't add any code. I just created it and testing out how it works. When I tried to deploy, it will show an error, "There were deployment errors. Continue?"
Deployment Error
I even went to the Android Device Manager to create an Android Emulator and it also provided me this error.
Android Emulator
I tried every solution that I could find online. Some told me to rebuild, clean and build my solution. That didn't work. I researched to check mark Hyper-V in the Windows features and even rebooting my computer several times and that didn't work. When I tried to deploy, this shows up in the output log. Not sure if this will help.
Output Log
I also attached images of what I've done so far and I really don't know what else to do.
Android SDK Platform and Tools 1
Android SDK Platform and Tools 2
Windows Features 1
Windows Features 2

Xamarin workflow on Windows

I'm aware that a Mac or a Mac service e.g. MacInCloud.com is necessary for building and submitting iOS apps.
My question is about the actual workflow of building an app on Windows using Xamarin on Visual Studio 2017.
We need to write code, test and debug throughout development cycle. How does this work with Xamarin running on Windows? How would I actually see what my mobile app looks like or behaves during the actual development cycle?
While developing my web apps in Visual Studio, there are many trips back and forth to the browsers and back to VS in order for me to see the results of my code. How does this work with Xamarin running on Windows? Is Xamarin Live Player the only option for development cycle? Is there a solution through MacInCloud or similar services so that tethering a device to dev machine is not necessary?
I'm just trying to understand how a healthy development cycle is created for Xamarin developers on Windows.
I will answer your question in few section: Coding, Debug, Test
Coding
You will be using Visual Studio to write your codes. iOS and Android code will be written in C#. You will get access to UI Designer for both iOS and Android to edit the layout files and storyboard/xibs. For 3rd party library, there is NuGet to serve your needs.
Debug
You can use Xamarin Live Player without connection to a Mac/MacInCloud for basic preview. However, some features of iOS is not available in Xamarin Live Player (e.g. xibs files not supported...).
If you setup with connection to a Mac, you will be able to see a list of Simulator that available in the Mac you connected to. By default, if you debug it, the simulator will still show up in the Mac. Then you will need to VMWare or remote into the Mac to check the simulator output. If you have Visual Studio Enterprise license, you can get access to a Remote iOS Simulator feature. You will need to turn the option ON. After that, you will able to see a remote iOS Simulator showing in your Windows machine without the needs to remote into Mac machine anymore. For debugging in actual iOS devices, you will still need to plug your device into the Mac. Previously (more than 1 years ago), Xamarin announce that they are working on "iOS USB remoting" to allow you to plug in iOS device into Windows machine and debug on it. But it is not release until now.
For Android, you can get access to Android Emulator Manager to add emulator to debug or you can deploy apps to physical phone just like what you can do with Android Studio.
Test
I will be referring to Xamarin.UITest for this part. You will be able to write UITest code in C# inside Visual Studio. Xamarin have product "Xamarin Test Cloud" to allow you to upload test code and binary and then run your test in cloud periodically. If you want to run the test locally in your machine, you will only able to run Android UITest in windows machine. To run iOS UITest locally, you will only able to run it in Mac machine. Using a Mac, you can also run Android UITest.
You can use a simulator/emulator instead of a device. For iOS, the simulator would run on the Mac Build Host that you are connected to. You can select the option for "Remote iOS simulator" in Visual Studio -> Xamarin.iOS options and you'll be able to interact with the simulator without having to RDP/VNC/look at the mac. For android, you can just run an emulator in Window and interact with it like that. Using your web apps comparison, you would use a simulator/emulator instead of browser but, for the most part, the process would be similar.
I have been developing a Xamarin MVVM app targeted at iOS and Android. I initially did the iOS development on Windows with VS 2022 and an iPhone attached via USB. I knew that I was going to have to eventually move to the Mac for final provisioning but I ended up taking that painful step earlier than planned because certain Xamarin features were just not working on Windows. First I could not get my app icon to be anything other than the Xamarin default and then Xamarin.Essentials.FilePicker would not select a file:
https://github.com/xamarin/Essentials/issues/1710
So after a week of struggling I finally got my project building and deploying on the Mac. However, I am not nearly as comfortable working on the Mac as I am on Windows where I have all my familiar development tools. So then the question was how to share the project files between the PC and the Mac so that I could edit and compile on the PC and then move to the Mac for final testing.
At first I tried iCloud but I could never get the files to sync reliably between the shared folder on the PC and the Mac. I am used to Dropbox and OneDrive, which work as expected. iCloud not so much.
So what I have been doing is committing and pushing the changes to github and then pulling the changes into the project on the Mac. It is quick and has the added benefit of version control using an offsite server. I am happy with this workflow and publishing the app on the Apple Store should be an easy task when that time comes.
Update:
This process is still working for me. I have taken the additional step of doing the release configuration on VS Mac and publishing my app to App Store Connect. That experience was convoluted and frustrating but it now works and I have people testing my app via TestFlight.
One hiccup is that when selecting Automatic iOS Bundle Signing in the project properties on VS Windows, this change gets pushed to the Mac side and causes a build error under Debug until I select the Automatic provisioning profile on the Mac. Somehow it gets set to the Wildcard profile on the Windows side.

Error in VS2015 installation and Xamarin UWP not working

I'm trying to install VS2015 Community in my PC.
When I install everything at the end the installer gives to me the following message:
I've tried to install, reinstall, update but anything changed. The only consequence that I can see is that when I create a new Xamarin solution, when I run the UWP project using Local Machine as target it starts, but then I obtain this exception message.
If I run the application from the Mobile emulator, it starts without problems.
Somewhere (sorry, I forgot the source) I've read that I should be sure to add following references for the project:
Windows Desktop Extensions for the UWP
Windows Mobile Extensions for the UWP
But I've only the first one, not the second. Maybe it's related to the installation issue?
I'm new to Xamarin and UWP, but UWP should be run to both Mobile devices and desktops, so why I have this behaviour? and what I can try to solve the installation problem that's probably related to this?
So, at the end, what I can try in order to fix the installation and allows the xamarin UWP project to run correctly in the local machine?
If I run the application from the Mobile emulator, it starts without problems.
According to your error message, it seems you are using StatusBar in your project.
While using StatusBar, please note that this is not a Universal API, this class can be only used in Mobile Device. Because status bar only exists in Mobile devices, there is no such thing in desktop, table or IoT devices. So if you use this class on Local Machine, you will get an error, but in Mobile Emulator, it can work without problems.
For more info, please see Requirements section of StatusBar.
Usually, when using StatusBar, we would use it with Runtime API check like following:
Windows.UI.ViewManagement.StatusBar statusBar = null;
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
}
if (statusBar != null)
{
//TODO
}
On Local Machine, as there is no StatusBar, ApiInformation.IsTypePresent method will return false. This will help us avoid the error. For more info, please see Write adaptive code.
But I've only the first one, not the second. Maybe it's related to the installation issue?
I'm not sure why you can't find the Windows Mobile Extensions for the UWP. But if you have used StatusBar and can build and run your project in Mobile Emulator, then you must have referenced Windows Mobile Extensions for the UWP. Without this extension, we can't use StatusBar and the build will fail.
Depending on the SDK you've installed, you can find following extensions in Reference Manager (Right click "References" in your project and then select "Add Reference" → "Universal Windows" → "Extensions").
I'd suggest you create a new Blank App (Universal Windows) project with Visual Studio to see if you have both the Desktop Extensions and Mobile Extensions. If you still have problem in new Blank App, I'd suggest you use Visual Studio Uninstaller to uninstall Visual Studio completely and also check the Control Panel to make sure you have uninstall all related stuffs like the SDKs. Then you can try to reinstall Visual Studio to see if it works.

Debugging Xamarin Android apps if I'm using VSTS hosted builds / HockeyApp

I have been developing a Xamarin Android app using Visual Studio Community 2015. So far, everything has been working well for debugging, as I simply build my app in VS, and connect my phone to my laptop and debug it using F5.
Recently, I started using HockeyApp for crash reporting, so that as I'm using my app (during the day when I'm not programming), if it crashes, I can send crash reports. This works OK, but the crash reports don't include line numbers, and also I don't have good references to what build of the app crashed, as the app itself isn't actually getting uploaded to HockeyApp, nor are the debugging symbols.
To help with this, I'm trying to get more organized using Visual Studio Team Services, doing hosted builds upon checkin of my source code, and automatically uploading the app and debugging symbols to HockeyApp.
Now I'm trying to reconcile in my mind how this is supposed to all work for me. If I'm coding in VS and debugging through VS, the app is getting deployed to my phone. But now, I check in the source code, and VSTS does a CI build and uploads everything to HockeyApp. But now, the CI build that VSTS did isn't really the same build that's on my phone, since that build came from the Visual Studio build.
So, when I'm done coding then later in the day, I run my app and it crashes, I'm concerned that the crash report from HockeyApp isn't actually going to relate to what Hockeyapp has. For one, I may not have done a check-in to the source control, in which case, my phone will have a newer version than HockeyApp has. But even if I had remembered to check it in, it's really not the same "build" (since my phone has the APK that was built by Visual Studio and HockeyApp has the APK that was built by VSTS).
Questions:
1) Is there a way to upload my app and debug symbols directly from Visual Studio, without going through a VSTS build? (preferrably automatically upon every build, so that I don't have to remember to do an extra step)?
2) If not, what are the best practices to resolve the issues that I mentioned above?
Ideally, I don't want to have to do any extra steps when I'm done coding for the day. I want to be able to always know that the last version that I built and deployed to my phone will have been uploaded to HockeyApp, so that if it crashes, the crash repo that HockeyApp sends will match with the correct source code and debug symbols.
For your first question, This depends on the project you working on. If you are working on a UWP project, there is an "Enable Crash Analytics" option and "Distribute With Hockey App" option allow you to do this when you right click on the project. But if you are working on a Xamarin.Android project, there is no option to do this. You need to upload them to Hockey App manually. However, you can create a power-shell script to upload these files to Hockey App and configure this power-shell script as post-build event. You can check the power-shell script here for reference: upload_file.ps.
And for the Visual Studio Team Services(VSTS) build, you just need to make sure that the app version and build configuration is totally the same as you debugging through VS from your local machine. Hockey App will detect the version automatically and send the data to the related build version.

Xamarin Windows Phone Store Package

I' am in a bit of truble at the moment.
I try to build my Xamarin Windows Store App for publishing, but the Create App Packages Wizard, wont open I tried many solutions from the web, like unloading and reloading the project, or making a new project. But the wizard does not open with my solution i treid a normal Windows Phone app(no Silverlight), that worked but i could not Port my xamarin project to a standard Windows Phone App.
Has someone encountered a similar issue with Xamarin and Windows Phone,
or can anyone help to get my app into the Appstore?
Thanks.
I would have asked in the Xamarin Forum, but I cant reach them siche this morning.
And sorry for the engrish.
To submit package to the windows phone store you'll need to build your project (for ARM in Release mode to avoid warnings). Then on developer site when there is button to upload package you have to attach *.xap file from your project's bin\release folder (or bin folder you have specified). Then you can go through the next windows phone store app submitting steps.

Resources