MAC上Xamarin使用
此为在MAC上部署安装Xamarin以及DEMO开发
一,下载安装最新版本Xcode
- the latest IOS SDK
- the latest version of Xcode
- Mac OS X 10.9
二,部署Xamarin
2.1 自动部署安装
下载地址:http://xamarin.com/download:
运行安装包后静默安装。
2.2 手动部署安装
2.2.1 下载文件如下:
http://xamarin.com/installer_assets/v3/Mac/Universal/InstallationManifest.xml此为官方提供的下载需求列表。
根据需要mac下需要下载:(下面提供一套版本下载地址,如果需要下载最新的,点击上方列表连接)
Xamarin自动下载工具,下载的所有文件信息在mac的:/Users/电脑名/Library/Caches/XamarinInstaller/Universal/ 目录下可以查看得到。包括上面的Xamarin安装需求列表文件;
1,Mono Framework :http://download.xamarin.com/MonoFrameworkMDK/Macx86/MonoFramework-MDK-4.0.0.143.macos10.xamarin.x86.pkg
2,Java SDK:http://download.xamarin.com/Installer/MonoForAndroid/jdk-7u71-macosx-x64.dmg
3,Android SDK:http://dl.google.com/android/android-sdk_r22-macosx.zip
http://dl.google.com/android/repository/repository-10.xml
http://schemas.android.com/sdk/android/repository/10
4,Android NDK:http://dl.google.com/android/ndk/android-ndk-r10d-darwin-x86_64.bin
5,Xamarin Studio:http://download.xamarin.com/studio/Mac/XamarinStudio-5.9.0.431-0.dmg
6,Xamarin.Android:http://download.xamarin.com/MonoforAndroid/Mac/mono-android-5.1.0-115.pkg
7,Xamarin.iOS:http://download.xamarin.com/MonoTouch/Mac/monotouch-8.10.0.267.pkg
8,Xamarin.Mac:http://download.xamarin.com/XamarinforMac/Mac/xamarin.mac-2.0.0.262.pkg
9,Xamarin Android Player:http://developer.xamarin.com/guides/android/getting_started/installation/android-player/
下载链接:https://xamarin-android-player.s3.amazonaws.com/installer/Mac/Xamarin%20Android%20Player.dmg
10,VBox:http://download.virtualbox.org/virtualbox/4.3.26/VirtualBox-4.3.26-98988-OSX.dmg
2.2.2 安装步骤如下:
1,安装Mono Framework — Java JDK —安装 Xamarin Studio— 安装Xamarin.IOS— 安装Xamarin.android— 安装Xamarin.mac— 解压Android SDK 以及NDK
2.2.3 安装后查看About
Xamarin Studio
Version 5.9 (build 431)
Installation UUID: 97c8e49a-b04c-4431-895f-17165ebacb09
Runtime:
Mono 4.0.0 ((detached/d136b79)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400000143
Xamarin.Android
Version: 5.1.0.115 (Trial Edition)
Android SDK: /Users/simafei/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
5.0 (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Xamarin Android Player
Not Installed
Apple Developer Tools
Xcode 6.3.1 (7703)
Build 6D1002
Xamarin.iOS
Version: 8.10.0.267 (Trial Edition)
Hash: 6481535
Branch: master
Build date: 2015-04-27 04:38:13-0400
Xamarin.Mac
Version: 2.0.0.262 (Starter Edition)
Build Information
Release ID: 509000431
Git revision: 7560726734fc7267de2fa9abed2509968deefaa8
Build date: 2015-04-17 19:25:48-04
Xamarin addins: 2e772c734ab3148054eae7bf8949f340fdeb5e5e
Operating System
Mac OS X 10.10.0
Darwin zhaoliangdeMini.lan 14.0.0 Darwin Kernel Version 14.0.0
Fri Sep 19 00:26:44 PDT 2014
root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
|
3,配置环境检测
3.1 IOS 环境配置,其中Apple SDK的位置是指Xcode运行程序的位置;如果全部是默认安装,安装路径指向默认地址。
3.2 Android环境配置
4,Android开发
自动生成两个目录,AndroidTest 以及对应的AndroidTest.UITests 文件夹。Mac 下Xamarin Studio开发Android与在Window下开发Android无区别,如果需要了解Android开发,可以查看上一篇文章。
附带:
<updates>
<Global>
<WelcomeUrl>http://xamarin.com/welcome</WelcomeUrl>
</Global>
<Update>
<Name>Mono Framework</Name>
<Version>4.0.0</Version>
<GenericName>MONO</GenericName>
<Url>
http://download.xamarin.com/MonoFrameworkMDK/Macx86/MonoFramework-MDK-4.0.0.143.macos10.xamarin.x86.pkg
</Url>
<RequiresAdminRights>true</RequiresAdminRights>
<ManualInstructions>
<Para>
Download the<Link handler="variable" target="Url">
<Name/>
v<Version/>
archive
</Link>
to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.
</Para>
</ManualInstructions>
</Update>
<Update>
<Name>Java SDK</Name>
<Version>1.7</Version>
<GenericName>MacJDK</GenericName>
<Url>http://this.is.not/used</Url>
<Url>
http://download.xamarin.com/Installer/MonoForAndroid/jdk-7u71-macosx-x64.dmg
</Url>
<IsAppleJava>false</IsAppleJava>
<RequiresAdminRights>true</RequiresAdminRights>
<ManualInstructions>
Mac OS X uses its own version of Java and in order to install it you need to<Link handler="exec" target="TerminalApp">start the terminal app</Link>
and type the following command:<Shell>javac -version</Shell>
After typing it you should see a Mac OS X system popup which will guide you to install the Java software.
</ManualInstructions>
</Update>
<Update Long="true">
<Name>Android SDK</Name>
<Version>22</Version>
<GenericName>ASDK</GenericName>
<Url>
http://dl.google.com/android/android-sdk_r22-macosx.zip
</Url>
<RepositoryUrl>
http://dl.google.com/android/repository/repository-10.xml
</RepositoryUrl>
<RepositoryNS>
http://schemas.android.com/sdk/android/repository/10
</RepositoryNS>
<Platforms>10,12,15,19,21</Platforms>
<Samples/>
<DownloadDocs>false</DownloadDocs>
<ManualInstructions>
<Optional if="NeedMainSDK">
<Para>
Download the<Link handler="variable" target="Url">
<Name/>
for Mac OS X version<Version/>
</Link>
, open the downloaded archive and copy the<Bold>contents</Bold>
of the folder found at its root directory (most probably named<Monospace>android-sdk-macosx</Monospace>
) to the<Monospace>
<TargetDir/>
</Monospace>
directory.
</Para>
</Optional>
<Para>
<Link handler="exec" target="SdkManager">Click here</Link>
in order to start the Android SDK Manager application. In the GUI make sure the following components are installed or selected for installation:<List type="ul">
<ListItem>Android SDK Tools</ListItem>
<ListItem>Android SDK Platform-tools</ListItem>
<ListItem>Android SDK Build-tools</ListItem>
<Repeat for="Platforms" format="csl">
<ListItem>
Android API<RepeatItem/>
</ListItem>
</Repeat>
</List>
</Para>
<Para>
Once all the required components are selected (you can select others as well, if you wish) start the installation.<Optional if="TargetDirIsLibrary">
<Note>
If you cannot see<Monospace>
<TargetDir/>
</Monospace>
in Finder please<Link handler="file" target="TargetDir" isDir="true">click here</Link>
to reveal the directory in Finder.
</Note>
</Optional>
</Para>
<Optional if="NeedNDK">
<Para>
Download the<Link handler="variable" target="NDKUrl">
Android NDK for Mac OS X version<NDKVersion/>
</Link>
, open the downloaded archive and copy the<Bold>contents</Bold>
of its root directory (most probably named<Monospace>
android-ndk-<NDKVersion/>
</Monospace>
) to the<Monospace>
<NDKTargetDir/>
</Monospace>
directory.
</Para>
</Optional>
<Para>
When the<Name/>
installation is finished you might want to start the<Link handler="exec" target="AvdManager">Android Emulator Manager</Link>
and create as many emulator images as you might need for your development. This step can be performed at any time, on an as-needed basis.
</Para>
</ManualInstructions>
<NDK>
<Version>10</Version>
<VersionTag>d</VersionTag>
<Url>
http://dl.google.com/android/ndk/android-ndk-r10d-darwin-x86_64.bin
</Url>
<TargetDir>|Personal|/Library/Developer/Xamarin/android-ndk</TargetDir>
</NDK>
<AVD>
<Name>MonoForAndroid API 15</Name>
<BasePlatform>15</BasePlatform>
<SdCardSize>512</SdCardSize>
<SkinName>QVGA</SkinName>
<RamSize>512</RamSize>
<LcdDensity>120</LcdDensity>
<HeapSize>48</HeapSize>
</AVD>
<AVD>
<Name>MonoForAndroid API 14</Name>
<BasePlatform>14</BasePlatform>
<SdCardSize>512</SdCardSize>
<SkinName>QVGA</SkinName>
<RamSize>512</RamSize>
<LcdDensity>120</LcdDensity>
<HeapSize>48</HeapSize>
</AVD>
<AVD>
<Name>MonoForAndroid API 12</Name>
<BasePlatform>12</BasePlatform>
<SdCardSize>512</SdCardSize>
<SkinName>WXGA</SkinName>
<RamSize>512</RamSize>
<HeapSize>48</HeapSize>
<LcdDensity>160</LcdDensity>
<KeyboardLid>false</KeyboardLid>
</AVD>
<AVD>
<Name>MonoForAndroid API 10</Name>
<BasePlatform>10</BasePlatform>
<SdCardSize>512</SdCardSize>
<SkinName>QVGA</SkinName>
<RamSize>512</RamSize>
<HeapSize>32</HeapSize>
<LcdDensity>120</LcdDensity>
</AVD>
</Update>
<Update>
<Name>Xamarin Studio</Name>
<Version>5.9.0</Version>
<ReleaseId/>
<GenericName>MonoDevelop</GenericName>
<Url>
http://download.xamarin.com/studio/Mac/XamarinStudio-5.9.0.431-0.dmg
</Url>
<RequiresAdminRights>false</RequiresAdminRights>
<ManualInstructions>
<Para>
Download the<Link handler="variable" target="Url">
<Name/>
v<Version/>
archive
</Link>
to any directory on your disk, double-click it and then drag and drop the<Name/>
icon to the Applications folder.
</Para>
</ManualInstructions>
</Update>
<Update Selectable="true" Long="false">
<Name>Xamarin.Android</Name>
<Version>5.1.0</Version>
<VersionTag/>
<GenericName>XAndroid</GenericName>
<DependsOn>MONO,MacJDK,ASDK,MonoDevelop</DependsOn>
<Url>
http://download.xamarin.com/MonoforAndroid/Mac/mono-android-5.1.0-115.pkg
</Url>
<RequiresAdminRights>true</RequiresAdminRights>
<ManualInstructions>
<Para>
Download the<Link handler="variable" target="Url">
<Name/>
v<Version/>
archive
</Link>
to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.
</Para>
</ManualInstructions>
</Update>
<Update Selectable="true" Long="false">
<Name>Xamarin.iOS</Name>
<Version>8.10.0.267</Version>
<VersionTag/>
<GenericName>XIOS</GenericName>
<Url>
http://download.xamarin.com/MonoTouch/Mac/monotouch-8.10.0.267.pkg
</Url>
<DependsOn>MONO,MonoDevelop</DependsOn>
<RequiresAdminRights>true</RequiresAdminRights>
<RequiresXcode>true</RequiresXcode>
<ManualInstructions>
<Para>
Download the<Link handler="variable" target="Url">
<Name/>
v<Version/>
archive
</Link>
to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.
</Para>
</ManualInstructions>
</Update>
<Update Selectable="true" Long="false">
<Name>Xamarin.Mac</Name>
<Version>2.0.0.262</Version>
<GenericName>XAMMAC</GenericName>
<Url>
http://download.xamarin.com/XamarinforMac/Mac/xamarin.mac-2.0.0.262.pkg
</Url>
<DependsOn>MONO,MonoDevelop</DependsOn>
<RequiresAdminRights>true</RequiresAdminRights>
<RequiresXcode>true</RequiresXcode>
<ManualInstructions>
<Para>
Download the<Link handler="variable" target="Url">
<Name/>
v<Version/>
archive
</Link>
to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.
</Para>
</ManualInstructions>
</Update>
<ManualInstructionsIntro>
<Para>
<Note>
It was not possible to complete an automatic installation. This might be due to a problem with your network, proxy servers or an unsolvable installation conflict. At this point, you can continue the installation by manually downloading and installing the independent pieces. The list below shows each component that you need to install.
</Note>
</Para>
</ManualInstructionsIntro>
<ManualInstructionsStyleSheet>
<![CDATA[
body { font-size: 10pt; font-family: sans-serif; color: black; } .monospace { font-family: monospace; } .executableName, .fsLocation { font-family: monospace; font-weight: bold; } .shellCode { display: block; font-family: monospace; margin-left: 5em; margin-right: 5em; margin-top: 1em; margin-bottom: 1em; padding: 0.5em; border: darkgray 1px dotted; } .note { display: block; font-size: 11pt; background-color: lightgray; color: darkred; padding: 10px; border: gray 1px solid; margin-left: 5em; margin-right: 5em; margin-top: 1em; margin-bottom: 1em; } .item { margin-top: 1em; border-top: darkgray 1px solid } .itemTitle { background-color: #eeeeee; font-size: 12pt; font-weight: bold; margin-bottom: 0.5em; }
]]>
</ManualInstructionsStyleSheet>
</updates>
|
分享到:
相关推荐
- **macOS Sierra介绍**:介绍macOS Sierra的关键更新,以及它们如何影响Xamarin.Mac应用的开发和部署。 - **生成新式macOS应用**:讨论如何利用最新技术和API来构建现代化的MacOS应用。 #### 六、进阶主题 - **...
在当今的企业信息化建设中,移动应用的开发和部署成为了关键环节之一。随着企业对于跨平台移动应用需求的增加,如何高效、快速、安全地开发并部署这些应用成为了技术团队面临的挑战。为了解决这个问题,微软的技术...
5. 部署和测试:描述如何运行和测试Xamarin.Mac应用程序,确保应用的稳定性和性能。 为了开始使用Xamarin.Mac开发,你需要以下硬件和软件的要求: - 一台运行macOS Yosemite(10.10)或更高版本的Mac计算机。 - ...
1. **Xamarin环境搭建**:首先,你需要安装Visual Studio或Visual Studio for Mac,并配置Xamarin工作环境,包括安装Xcode、设置iOS模拟器或连接真实设备进行测试。 2. **C#语言基础**:Xamarin开发基于C#,因此...
使用Xamarin,开发者可以利用C#和.NET工具链进行开发,这意味着他们可以使用熟悉的编程语言和IDE(如Visual Studio或Visual Studio for Mac)来开发移动应用。同时,由于Xamarin编译为本地代码,所以应用运行速度快...
安装Xamarin涉及在Windows或macOS上集成到Visual Studio或Visual Studio for Mac中。Xamarin安装通常包括Xamarin.Android SDK、Android SDK工具、模拟器组件等,以便开发者能够创建、构建和测试应用。在Windows上的...
Xamarin.Forms是微软开发的一个开源UI工具包,它允许开发者用XAML和C#编写代码来创建和部署原生用户界面布局,这些布局可以在iOS、Android、Windows Phone和通用Windows平台(UWP)上运行。 教程中首先介绍了...
最后,Xamarin.Forms提供了丰富的API和组件库来帮助开发者快速构建和部署应用程序,包括对设备API的访问,比如相机、联系人、传感器等。掌握这些API能够更好地利用设备的特性,从而开发出功能丰富、性能优良的移动...
1. **实时预览**:Xamarin Live Player允许开发者在设备或模拟器上实时查看代码更改,无需反复编译和部署。这大大缩短了迭代周期,提高了开发效率。 2. **跨平台支持**:支持iOS和Android两大主流移动操作系统,...
此外,Xamarin Studio和Visual Studio都提供了方便的应用发布工具,帮助开发者快速将应用部署到应用商店。 总的来说,Xamarin是一个功能强大的工具,它通过C#和.NET Framework为开发者提供了构建高性能、跨平台移动...
Xamarin.Forms项目可以在Visual Studio或Visual Studio for Mac中创建和管理。部署应用到Android设备或模拟器时,只需选择目标设备,点击“运行”按钮即可。调试过程中,可以设置断点,检查变量值,以及跟踪代码执行...
开发完成后,可以通过 Visual Studio 或 Visual Studio for Mac 将应用打包并发布到各个目标平台。同时,内置的调试工具可以方便地在模拟器或真机上测试应用性能和功能。 9. **持续集成与持续部署 (CI/CD)** 对于...
1. **Visual Studio 或 Visual Studio for Mac**: 提供强大的集成开发环境,支持调试、单元测试和性能分析。 2. **模拟器与真机调试**: 可以在 Android 模拟器上测试,也可以通过 USB 联接真机进行调试。 3. **...
使用Xamarin Studio时,在PC上只会创建XamlSamples.Android和XamlSamples项目,而在Mac上还会创建XamlSamples.iOS项目。创建解决方案之后,开发者可能会想测试开发环境,通过选择不同的平台项目作为解决方案的启动...
3. **Xamarin.Mac**:与Xamarin.iOS类似,它为.NET开发者提供了完整的macOS SDK,支持创建原生Mac应用。 4. **Xamarin.Forms UI框架**:这是一个核心组件,它允许开发者通过共享的C#代码来构建用户界面,而无需为每...
Xamarin是一种流行的跨平台移动...整体而言,这篇Xamarin跨平台入门指南为开发者提供了一个全面的知识体系,从基础知识到高级应用,从编码实践到部署调试,内容丰富详尽,涵盖了使用Xamarin进行跨平台开发的方方面面。
1. **入门指南**:介绍如何安装Xamarin Studio或Visual Studio for Mac/Windows,设置开发环境,并创建第一个Xamarin应用。 2. **Xamarin.Forms教程**:详细解释XAML语法,控件使用,布局管理,以及如何实现跨平台的...
api样板 这将作为在.NET中创建Xamarin应用程序的一般基础。 它基于出色的 。 如此处所述:具有预先配置的Visual Studio 2015环境的简单项目,将视图模板,,可观察对象和,通过依赖... 按照找到的说明连接Xamarin Mac
而Xamarin.LivePlayer则是这一框架的补充工具,它允许开发者在IDE(如Visual Studio或Visual Studio for Mac)中即时查看代码更改的效果,而无需构建和部署应用程序。 ### 功能特性 1. **即时预览**:Xamarin.Live...
3. **安装依赖**: 由于Xamarin需要Visual Studio for Mac或Visual Studio的特定版本,配置文件需要包含安装这些工具的命令。此外,可能还需要安装Android SDK和iOS模拟器的相应组件。 4. **构建与测试**: 配置文件...