你的开发环境

How you set up your hardware and software depends on what mobile platforms you’re targeting and what computing environments are most comfortable for you. 
The requirements for Xamarin.Forms are no different from the requirements for using Xamarin.iOS or Xamarin.Android or for programming for Windows Runtime platforms. 
This means that nothing in this section (and the remainder of this chapter) is specific to  Xamarin.Forms. There exists much documentation on the Xamarin website on setting up machines and software for Xamarin.iOS and Xamarin.Android programming, and on the Microsoft website about Windows Phone. 
原文

  如何配置你的硬件和软件取决于你的目标是什么样的移动平台和什么样的计算环境是最适合你。

  使用Xamarin.iOS、Xamarin.Android或者为Windows运行时平台编写程序,所需要的Xamarin.Forms是不同的。

  这意味着在这一节和这一章剩余的部分没有特定于Xamarin.Forms。在Xamarin网站上有许多文档关于如何设置机器和软件,去开发Xamarin.iOS、Xamarin.Android和Windows Phone。

机器和开发环境

If you want to target the iPhone, you’re going to need a Mac. Apple requires that a Mac be used for building iPhone and other iOS applications. You’ll need to install Xcode on this machine and, of course, the Xamarin platform that includes the necessary libraries and Xamarin Studio. You can then use   Xamarin Studio and Xamarin.Forms on the Mac for your iPhone development. 
Once you have a Mac with Xcode and the Xamarin platform installed, you can also install the  Xamarin platform on a PC and program for the iPhone by using Visual Studio. The PC and Mac must be connected via a network (such as Wi-Fi). Visual Studio communicates with the Mac through a Secure Shell (SSH) interface, and uses the Mac to build the application and run the program on a device or simulator. 
You can also do Android programming in Xamarin Studio on the Mac or in Visual Studio on the PC. If you want to target the Windows platforms, you’ll need Visual Studio 2015. You can target all the platforms in a single IDE by running Visual Studio 2015 on a PC connected to the Mac via a network. (That’s how the sample programs in this book were created.) Another option is to run Visual Studio in a virtual machine on the Mac. 
原文

  如果你针对iPhone,你可能需要一台Mac。苹果需要一台Mac去生成iPhone或者其他iOS应用程序。你需要在电脑上安装Xcode,另外还需要包含必要类库的Xamarin平台和Xamarin Studio。你可以在Mac上使用Xamarin Studio和Xamarin.Forms开发程序。

  一旦你拥有了一台Mac,并且安装了Xcode和Xamarin平台,你也可以安装 Xamarin在一台PC上并且使用Visual Studio开发iPhone程序。PC和MAC必须通过网络连接,Visual Studio通过SSH接口与MAC进行通信。使用MAC生成程序,并且运行程序在设备或者模拟器中。

  你也可以在MAC使用Xamarin Studio或者PC上使用Visual Studio进行Android编程。

  如果你想开发Windows应用,那么需要安装Visual Studio 2015。如果你需要使用Visual Studio 2015开发可以针对所有平台的应用,那么需要通过网络连接到Mac上,或者安装一个Mac虚拟机去运行Visual Studio 2015。

设备和模拟器

You can test your programs on real phones connected to the machines via a USB cable, or you can test your programs with onscreen emulators. 
There are advantages and disadvantages to each approach. A real phone is essential for testing complex touch interaction or when getting a feel for startup or response time. However, emulators allow you to see how your application adapts to a variety of sizes and form factors. 
The iPhone and iPad emulators run on the Mac. However, because Mac desktop machines don’t have touchscreens, you’ll need to use the mouse or trackpad to simulate touch. The touch gestures on the Mac touchpad do not translate to the emulator. You can also connect a real iPhone to the Mac, but you’ll need to provision it as a developer device. 
Historically, Android emulators supplied by Google have tended to be slow and cranky, although they are often extremely versatile in emulating a vast array of actual Android devices. Fortunately,Visual Studio now has its own Android emulator that works rather better. It’s also very easy to connect a real Android phone to either a Mac or PC for testing. All you really need do is enable USB Debugging on the device. 
The Windows Phone emulators are capable of several different screen resolutions and also tend to run fairly smoothly, albeit consuming lots of memory. If you run the Windows Phone emulator on a touchscreen, you can use touch on the emulator screen. Connecting a real Windows Phone to the PC is fairly easy but requires enabling the phone in the Settings section for developing. If you want to unlock more than one phone, you’ll need a developer account. 
原文

  你可以将真实的手机通过USB连接到电脑上,来测试你的应用程序,或者通过带有屏幕的模拟器。

  每个方法都有各自的优缺点,当我们要测试一个复杂的触摸交互或者感受程序的启动响应时间,这时一个真实的手机就很有必要。然而,通过模拟器可以看到你的应用程序如何适应各种尺寸和外形的设备。

  iPhone和iPad模拟器运行在Mac上,但是Mac的台式机不具备触摸屏幕,所以需要鼠标或者trackpad来模拟触摸。在Mac触摸板上的触摸手势不能转变成模拟器上的操作。如果你连接一个iPhone到Mac上,需要将手机设置为开发者模式。

  历史上,Google发布的模拟器往往比较缓慢和不稳定,尽管它们在模拟各种各样的真实安卓设备方便非常灵活。幸运的是,Visual Studio有一个自己的Android模拟器,并且表现的相当好。而且它也很容易连接一个真实的安卓设备,不管你是用的Mac还是Pc进行测试。你只需要将Android手机的USB调试功能启用。

 

你可能感兴趣的:(你的开发环境)