Run Xamarin.iOS app in real device - c#

I'm trying to use an iPhone 6 for running Xamarin.iOS app.
I connect iPhone to my Mac(in VMware), and not Windows Machine When I select iPhone in VS 2015 menu my iPhone name appear on VS 2015.
However , always show loading in Main.storyboard and doesn't show design and when I run the project I get this error :
Error : MessagingRemoteException: An error occured on client Build42217 executing a reply for topic xvs/Build/4.2.2.11/execute-
task/Lesson1/7b0d249%FDetectSigningldentiy
DirectoryNotFounfException: Directory '/Users/arazpashazadeh/Library/MobileDevice/Provisioning Profiles' not found.
What solution would you recommend to solve this problem?

This is what I do when i want to build on my Iphone
To deploy on your device, you need :
A Macintosh
Connect visual studio with MacAgent to your Macintosh
Create X-Code project to create a Bundle identifier
Plug your device on your mac
Build it on your device
Don't forget to authorize your app in (settings -> General -> Profils -> Dev App )
In xCode project in info.plist copy Bundle indentifier and paste it in your VS info.plist
Hope this helps you
Regards

1) If you haven't created a development provisioning profile for your device, follow this manual:
https://developer.xamarin.com/guides/ios/getting_started/installation/device_provisioning/
2) If you had created the profile before, open Xcode, click Xcode in the top left corner of the screen, click Preferences, click Accounts, sign in if needed, click View Details and click Download All Profiles.
3) Consider restarting the Visual Studio to synchronize.
Also make sure that your profiles are not expired.
You can also check the '/Users/arazpashazadeh/Library/MobileDevice/Provisioning Profiles' directory:
Inside VMWare, click Shift+Win+G, type ~/Library and navigate to Mobile Device folder. If you see Provisioning Profiles folder in there but it still doesn't work, you can try to move it to trash and repeat step #2 and #3.

Thank you for your guidance but when I log on to the Developer Center to accept license show me : To continue your enrollment, complete your purchase now and redirect me to Purchase Details page to pay US$ 99 cost for 1 year , but in the above link not to pay cost.
then I try generate a development certificate manually again redirect to Purchase Details page to pay US$ 99 cost for 1 year.
Why this happened to me؟
I try second step and add my Apple ID but in the View Details I don't have profiles for download
why created a development step different for me?

Related

WiX v3 Setup Project, Unable to uninstall via Apps & Features

I'm having a hard time trying to figure out what is causing this odd issue.
So I've created a very basic .msi by following the WiX v3 Setup Project documentation, pretty much just the provided template, but no matter what i try, whenever i go to uninstall it via the Windows 10 Apps & Features interface, i keep getting this:
However, when i uninstall via Control Panel\Programs\Programs and Features or by right-clicking and hitting Uninstall in the .msi's Context Menu, it uninstalls fine.
What am i missing here, should i be implementing something within the installer project to support the Apps & Features uninstall?
Thanks in advance.
AVG Anti Virus: In this case it was AVG anti virus. Uninstalling this product made the uninstall run correctly when
invoked from the new settings GUI in Windows 10.
Blocking: Errors like these often mean something is blocking the uninstall. Please disable or uninstall any anti-virus and / or security software and try again.
General Check List: Please check this answer for a "deployment check list" or "mnemonic" to debug similar problems: Deployment Mnemonic (mid-page). Also see comments above. Sweep for malware with Windows Defender Offline.
Microsoft Tips: Windows cannot access the specified device, path, or file...
Make Log File: To debug, always make an MSI log file:
FireGiant: MSI log "how-to"
Installsite: MSI log "how-to"
Exact Error Message: "Error: Windows cannot access the specified device, path, or file. You may not have the appropriate permission to access the item"

Why C# program started show "Unknown publisher" when executed

I am developing C# application in Visual Studio 2015. Old versions of my app were able to run on someone else's computer without showing any message. But when I run newer version of my app on someone else's computer, I get warning "Unknown publisher".
I am not aware of changing something important between old and new version. I dont want to pay for certificate and sign my app.
Do you have any idea why someone else's computer started to show this message (what could changed)?
Thank you very much for any idea.
This is "Open File - Security Warning". I am also a C# developer, but I have not faced this type of issue when running my developed app in my PC, but it is true that when I run those apps on another PC I get a popup that states "Open File - Security Warning".
Please follow the steps If you does not want to get Security Warning.
Run GPEDIT.MSC.
Local Computer Policy / User Configuration / Administrative Templates / Windows Components / Attachment Manager
On the right pane, double click Inclusion list for low file types.
Click Enable.
Include the file types such as .exe;.bat;.reg;.vbs in the Options box.
Click OK.
Hope this helps.

Android app debugs for a few seconds then just stops

I'm trying to set up a new Android app development environment at home and I've run into a problem that is a showstopper.
First, here is my environment:
Windows 10
Visual Studio Community 2015 with Xamarin platform installed
Test device is: G Pad 7.0 LTE
Android Version 5.0.2
I'm following this tutorial: MSDN tutorial
When I go to debug my test app, here is what happens.
Select debug from Visual Studio with my tablet as the target
VS deploys to the tablet
App starts on the tablet
App and debug session runs for about 5-10 seconds.
Debug session ends and app closes
No errors are displayed in Visual Studio and when i turn on Android logging it's a such a massive overflow of information that I don't really know where to begin searching for a problem.
Please also note that when I first set up the app, according to the tutorial, debugging on the tablet worked fine. The initial build is simply a template with a few basic controls.
In between then and when it stopped working I also added and successfully tested a Windows Phone project on a Windows Phone device.
Once I got to the section where I was modifying the project is when the problem started. I thought that perhaps a change in the code I did caused this issue so I tried another blank app and that blank app now crashes as well.
When I deploy the tutorial app to an emulator it crashes immediately but when I deploy a blank app it doesn't crash.
I also tried restoring the tablet to factory defaults and testing again. Same scenario: Blank app and tutorial app run for a few seconds, debugging stops, app closes.
Any clue as to what type of problem I'm looking at?
Solution
Clean your project (Right-Click on Project and select clean)
Go to your build folder. Probably in your Android project's root folder, named "obj". Delete either build you had, when you ran into this behavior (Debug or Release).
Directory Path
./AndroidProject/obj/Debug
./AndroidProject/obj/Release
Restart Visual Studio
Build and run again and it should work just fine, as the md5-hashes are now matching again.
I had also uninstalled the app before from the device and restarted it, I don't know whether this is required anymore, because the app is now being "reinstalled" by newer Xamarin versions anyway.
adb uninstall com.your.domain
Story and Background information
Have had the same issue with a device running Android 5.0.
Basically, the app was just stopping without any note.
When I now restarted the phone, The log was extended (once) by the following line:
Device could not find component named: *com.your.domain*/{*md5hash*}.*{Activity}
It turns out that with Andrpod 5.0 a hashing mechanism was implemented:
With the 5.0 release, the default package names for Android Callable
Wrappers will be based on the MD5SUM of the assembly-qualified name of
the type being exported. This allows the same fully-qualified name to
be provided from two different assemblies and not get a packaging
error.
See this for further information Xamarin.Android 5.1
So, if the md5-hash now changes from time to time, a simple Clean of your project is not enough.
I ran into this same issue and applied the same solution described above many times, which seemed to remedy this particular problem.
A possibly related fix, but definitely worthwhile note
After releasing this Android app and later releasing updates to the app, we got feedback from users that their Android Home screen shortcut to the app was disappearing after each app update. This is not good, for obvious reasons, but the fix for it was very simple as noted here:
dream-team-mobile-blog - Android app removes shortcut on update Xamarin solution
On the main activity, set a Name attribute of
<your package>.<your main activity>
like:
com.mycompany.myapp.MainActivity
For my solution, I chose to do it in code like this:
[Activity(Name = Constants.PackageName + "." + nameof(MainActivity),
Label = Constants.AppIconTitle, Icon = "#drawable/icon",
Theme = "#style/splashscreen", MainLauncher = true,
LaunchMode = LaunchMode.SingleInstance,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
//Side Note: I change my PackageName between Prod and SQA builds, so using
//a constant as seen above makes that change less risky to miss maintaining.
//Also, using nameof() keeps things tight and a sure match.
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
I mention it here in this post because, having this fix in place may have:
definitely prevented app shortcut loss and
possibly prevented the issue discussed in this post
as the MD5 hash prefix from the Main activity seems to no longer be generated.
This tweak may fix two bugs with one fix. If not, implementing a fixed main Activity Name will surely help your users keep their shortcut to your app when you release updates!
What fixed it for me in Visual Studio 2017 is going to :
Tools β†’ Options β†’ Xamarin β†’ Android Settings
and uncheck:
Preserve Application data cache on device between deploys
go to your AndroidManifest.xml and change your package name.

WinRT: cannot release build my application

In my application I have 3 WinRT projects which I want to deploy. I want to deploy 1 of them; M.Survey.Windows which is dependent on the other 2.
I can build the projects OK, but when I try to build and deploy I run into difficulties.
I click on store -> Create App Packages, select No to upload to the Windows Store, click next and then Create. This does a build which fails, see below. How do I fix this?
The error messages say;
Error 1 The text associated with this error code could not be found.
Cannot find a Resource with the Name/Key BlackSmallHeaderStyle ...\M.Survey.Windows\UserControls\DimUserControl.xaml 137 25
Error 2 Unable to remove directory "obj\x86\Release\PackageLayout\". The process cannot access the file 'Microsoft.Xaml.Interactions.dll' because it is being used by another process.
Killing XDesProc.exe also worked for me.
XDesProc.exe is the Visual Studio XAML Designer tool.

Open iOS application from Unity

I'm wanting to open up another application on my ipad via a button press in Unity. I know normally I would use Application.OpenURL() on my button press, but I'm unsure as to what to put in the brackets. This is an application already on the iPad and isn't one I've created.
Has anyone ever done this before? Could you possibly point me in the right direction so I can get this to work? Is it even possible?
The other application needs to support that behaviour, by defining a custom url scheme.
The developer needs add an URL Type i.e. "awesomeapp" in Xcode under Targets > Info > URL Types, if he does not support it you can not open the app.
In your Unity app just call
Application.OpenURL("awesomeapp://").
see also this stackoverflow entry:
Launch an app from within another (iPhone)
UPDATE 1: how to find a custom URL scheme of 3rd party app
Download the purchased app via iTunes on OSX
Go to the [AppName].ipa file on your filesystem
Rename it to a [AppName].zip so that you can extract it
Go to "[AppName]/Payload/[AppName].app"
Right click and select "Show Package Contents"
Open the Info.plist in Xcode and look for the key URL types or in a text editor for CFBundleURLTypes.
UPDATE 2: iOS 9
For iOS 9 you must whitelist that application in the Info.plist of the Xcode Project:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>awesomeapp</string>
</array>

Categories