ios之Windows环境下开发ios环境部署
我们都知道开发iPhone等ios平台的移动应用时需要使用Mac本,但是Mac本都比较昂贵,所以我们可以采用Windows7上利用VMWare安装Mac操作系统的方法来模拟ios开发环境,达到降低成本的目的。
1.相关配置
操作系统:windows10
Work station:VMWare10
Mac操作操作系统:OS X 10.8
安装的过程大概需要半小时左右的时间,等待安装完成之后,进行简单的设置,包括开机密码、Apple ID和Icloud、find my Mac等操作。就可以进入到Mac OS X 10.8的操作系统了。界面如下
安装好Mac操作系统后,打开里面的浏览器就可以直接进入到Apple的官方网站,在网站里面搜索xcode就可以进入到Xcode的下载界面
这里需要注意下,不是所有的Xcode都可以使用的,Xcode和Mac OS X操作系统需要一定的相互匹配关系的,具体的情况可以参考下面
Xcode和Mac os x对应关系
*后安装完成后,mac系统在虚拟机中没有全屏,这个时候需安装一个软件,vmware tools for mac 。可以找下*新版的,这里我给一个百度网盘地址,http://pan.baidu.com/share/link?shareid=3384093857&uk=4195607876&app=zd。
下载VMware tools FOR MAC镜像文件,记住是镜像文件,后缀为.iso格式。如果你找不到新版的,那么可以使用网盘中的,在下面已经给出。
Xcode is at the center of all development on Apple’s platforms, and with Xcode 12, it has a fresh new look to match macOS Big Sur. Xcode 12 for macOS Universal Apps beta is a distribution of Xcode 12 beta for creating Universal Mac apps that run on both Apple silicon and Intel-based Mac computers.
Here is some introduction about new updates in xcode, it is Xcode 12 Beta release. Update your apps to use new features and test your apps against changes in API. New document tabs make opening multiple files fast and lightweight to support interface files, and logs and project files each open in their own tab. Navigator fonts now match the system size, or can be set to small, medium, or large. And Xcode 12 builds macOS Universal apps by default to support new Macs with Apple silicon.
Xcode 12 for macOS Universal Apps beta includes SDKs for iOS 14, iPadOS 14, and macOS 11. The Xcode 12 for macOS Universal Apps beta release supports on-device debugging for iOS 9 and later. Xcode 12 for macOS Universal Apps beta requires a Mac running macOS 10.15.4 or later.
Xcode’s run destination menu now shows an “Any Mac” destination for Mac schemes. This is a new build destination that builds each target in the scheme for all of their supported architectures, regardless of the native architecture of the local Mac.
Xcode的运行目标菜单现在显示Mac方案的“ Any Mac”目标。 这是一个新的构建目标,可以为方案中的所有受支持体系结构构建每个目标,而与本地Mac的本机体系结构无关。
New Features
新功能
Documents can now be opened in their own tab, making it easy to quickly switch between files while maintaining the rest of Xcode’s configuration. Option-click or double-click to open a document in a tab.
Xcode adds support for previewing widgets, App Clips, and content in Swift packages. For more seamless live previewing on device, Xcode installs the new Xcode Previews app for iOS 14 and iPadOS 14.
The new LibraryContentProvider protocol gives you the ability to show your views and modifiers in Xcode’s library.
新的LibraryContentProvider协议使您能够在Xcode的库中显示视图和修饰符。
Code completions have a new, focused, user interface, making it easier to find a completion. Completions are also more accurate and up to 12 times faster in Xcode 12.
It adds support for Scalable Vector Graphic (SVG) image assets. These preserve their vector representation with deployment targets of macOS 10.15 or later, iOS 13 or later, and iPadOS 13 or later.
The required pixel size is now shown for complication placeholder images.
现在显示了复杂占位符图像所需的像素大小。
The “New Asset” menu has been changed to organize asset types by platform.
“新资产”菜单已更改为按平台组织资产类型。
调试 (Debugging)
When a process crashes under the debugger, Xcode prints the crash messages in the Console. These messages are similar to the ones displayed in CrashReporter.
Xcode debugger annotations will highlight source code with greater opacity to improve visibility in several Xcode themes.
Xcode调试器批注将以更高的不透明度突出显示源代码,以提高在多个Xcode主题中的可见性。
If you have disabled breakpoints in the Breakpoint Navigator, you can use the contextual menu to delete all the disabled breakpoints.
如果已在“断点导航器”中禁用了断点,则可以使用上下文菜单删除所有禁用的断点。
When paused in the debugger, stepping out of a block will unwind and land in a frame with debug symbol.
在调试器中暂停时,跳出块会展开并降落在带有调试符号的帧中。
设备 (Devices)
The “Add Device” sheet in the Devices and Simulators window is now resizable.
现在,“设备和模拟器”窗口中的“添加设备”工作表可调整大小。
The Devices and Simulators window permits selecting multiple devices in the navigator, so they can be unpaired together.
“设备和模拟器”窗口允许在导航器中选择多个设备,因此可以将它们取消配对。
界面生成器 (Interface Builder)
It Added support for the new safeAreaLayoutGuide on NSView introduced in macOS 11.
它增加了对macOS 11中引入的NSView上新的safeAreaLayoutGuide的支持。
Introduced a new minimap for the Interface Builder canvas. You can show and hide the minimap with Editor > Canvas > Minimap. Drag the minimap to any corner of the canvas.
Find and Replace now includes matches in attributed string literals.
查找和替换现在在属性字符串文字中包含匹配项。
Interface Builder now has a Current Date option for NSDatePicker.
Interface Builder现在为NSDatePicker提供了“当前日期”选项。
Standard spacing constraints are now created by default when items are positioned a standard distance from each other.
现在,默认情况下,当项目彼此之间的距离为标准距离时,会创建标准间距约束。
Added support for SF Symbols in macOS 11.
在macOS 11中添加了对SF符号的支持。
Added support for UIButton.ButtonType.close .
添加了对UIButton.ButtonType.close的支持。
Added support for the new toolbarStyle in macOS 11.
在macOS 11中添加了对新工具toolbarStyle支持。
Added support for the new subtitle property in macOS 11.
在macOS 11中添加了对新subtitle属性的支持。
Added support for the new NSSearchToolbarItem in macOS 11.
在macOS 11中添加了对新NSSearchToolbarItem支持。
Added support for selecting text styles in macOS 11.
添加了对在macOS 11中选择文本样式的支持。
Added support for the new NSTableViewStyle with Automatic, Full Width, Inset, and Source List options.
添加了对带有自动,全宽,插入和源列表选项的新NSTableViewStyle支持。
游乐场 (Playgrounds)
In Xcode Playgrounds now you can import and use Swift packages and frameworks. Select the Build Active Scheme checkbox in the playground’s File inspector and ensure that the active scheme builds the package or framework target.
The Attributes inspector now offers quick actions for editing the name, device, layout, preferred color scheme, and accessibility text size of a selected preview.
Xcode now connects with the new Xcode Previews app for iOS 14 and iPadOS 14 for greatly improved on-device previews. The Xcode Previews app seamlessly displays changes from Xcode Previews on devices.
The bottom bar of the canvas now contains a button for quickly inspecting the selected view.
现在,画布的底部栏包含一个用于快速检查所选视图的按钮。
仿真器 (Simulator)
Simulator can display a simulated device in full-screen mode, or tile its window alongside Xcode.
Simulator可以全屏模式显示模拟的设备,也可以将其窗口平铺在Xcode旁边。
Simulator now supports 64-bit and 32-bit processes for watchOS 7. To verify watchOS projects are 64-bit clean in Simulator, make sure ARCHS is set to its default value.
Window > Stay on Top keeps device windows in front of other application windows.
窗口>停留在顶部可使设备窗口位于其他应用程序窗口的前面。
Simulator defaults to the internal microphone unless you explicitly choose a different audio source. This avoids triggering phone call mode on Bluetooth headsets which degrades audio quality while listening to music.
Simulator supports simulating Nearby Interaction for devices that support the feature. Dragging the device window around on the screen will update the simulated distance between the two devices. The farther apart the windows are on screen the greater the reported distance.
Swift indentation has been overhauled, greatly improving the indentation of chained methods calls, especially those that involve nested or trailing closures.
快速缩进已得到全面改进,大大改善了链式方法调用的缩进,特别是那些涉及嵌套或尾随闭包的调用。
A property with an attached property wrapper can now rely on type inference to infer the wrapped value type when using default initialization without empty parentheses on the wrapper attribute. For example:
The wrapped property UseWrapper.value uses default initialization of IntWrapper, and relies on type inference to deduce the type-wrapped value type to be Int.
Swift now allows the implicit use of self in @escaping closures when reference cycles are unlikely to occur.
现在,当不太可能发生引用循环时,Swift允许在@escaping闭包中隐式使用self。
First, implicit use of self in @escaping closures is now allowed if the user has explicitly captured self in the closure’s capture list, so the following code is now valid:
Second, implicit self is available in @escaping closures when self is a value type, making the following code valid:
其次,当self是值类型时,隐式self在@escaping闭包中可用,使以下代码有效:
Notes: Here I try to give description about updates in xcode. It have amazing new features thats helps developers to design apps in easy way. Also It improves the speed for development.
——————————apache 部分—————————— Centos———————————————————— Server version: Apache/2.4.6 (CentOS) Server built: Nov 19 2015 21:43:13 Debian———————————————————— Server version: Apache/2.4.10 (Debian) Server built: Nov 28 2015 14:05:48 从版本号上看,是 debian 中的 apache 较新,但是有听到一种说法, centos 中的包都有 backport ,虽然版本号旧,但软件不旧,具体不知如何考证。
——————————php 部分—————————— Centos———————————————————— PHP 5.4.16 (cli) (built: Jun 23 2015 21:17:27) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies Debian———————————————————— PHP 5.6.17-0+deb8u1 (cli) (built: Jan 13 2016 09:10:12) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies 从版本号上看,是 debian 中的 php 较新。 但是安装 php-gd 的时候, centos 中是 bundle 版, debian 中是 dev 版, dev 字面上应该是开发版。明明用的是 debian 的 stable 源,为什么会是开发版?
——————————mysql 部分—————————— Centos———————————————————— mysql Ver 15.1 Distrib 5.5.44-MariaDB, for Linux (x86_64) using readline 5.1 Debian———————————————————— mysql Ver 14.14 Distrib 5.5.47, for debian-linux-gnu (x86_64) using readline 6.3 数据库这里就不能看版本号了,因为 centos 用 yum 安装 mysql 会自动安装 mariadb 。
debian 和 centos 下分别安装 Discuz x3.2 后进行压力测试,放个雅黑探针用于观测系统负载。 ——————————压力测试—————————— 使用 apache 的压力测试工具, ab -c 100 -n 100 http://127.0.0.1/forum.php ,之后逐步增加。 Centos———————————————————— Server Software: Apache/2.4.6 Server Hostname: 127.0.0.1 Server Port: 80
Concurrency Level: 100 Time taken for tests: 3.589 seconds Complete requests: 100 Failed requests: 0 Write errors: 0 Total transferred: 1359500 bytes HTML transferred: 1287200 bytes Requests per second: 27.86 [#/sec] (mean) Time per request: 3589.014 [ms] (mean) Time per request: 35.890 [ms] (mean, across all concurrent requests) Transfer rate: 369.92 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 1 1 0.3 1 2 Processing: 74 1974 996.3 1995 3513 Waiting: 71 1974 996.3 1995 3513 Total: 74 1975 996.0 1997 3514
Percentage of the requests served within a certain time (ms) 50% 1997 66% 2560 75% 2925 80% 3046 90% 3374 95% 3484 98% 3494 99% 3514 100% 3514 (longest request)
Debian———————————————————— Server Software: Apache/2.4.10 Server Hostname: 127.0.0.1 Server Port: 80
Concurrency Level: 100 Time taken for tests: 1.215 seconds Complete requests: 100 Failed requests: 0 Total transferred: 1367400 bytes HTML transferred: 1287200 bytes Requests per second: 82.30 [#/sec] (mean) Time per request: 1215.040 [ms] (mean) Time per request: 12.150 [ms] (mean, across all concurrent requests) Transfer rate: 1099.02 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 3 25 4.0 26 27 Processing: 149 705 315.9 706 1187 Waiting: 134 694 316.7 705 1186 Total: 170 730 317.1 732 1212
Percentage of the requests served within a certain time (ms) 50% 732 66% 917 75% 1010 80% 1055 90% 1161 95% 1205 98% 1211 99% 1212 100% 1212 (longest request)
Concurrency Level: 100 Time taken for tests: 1.024 seconds Complete requests: 100 Failed requests: 0 Total transferred: 1363960 bytes HTML transferred: 1287100 bytes Requests per second: 97.66 [#/sec] (mean) Time per request: 1023.960 [ms] (mean) Time per request: 10.240 [ms] (mean, across all concurrent requests) Transfer rate: 1300.82 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 9 28 3.4 28 32 Processing: 56 519 288.0 503 991 Waiting: 45 514 287.2 501 991 Total: 73 547 290.2 531 1023
Percentage of the requests served within a certain time (ms) 50% 531 66% 720 75% 819 80% 866 90% 964 95% 1011 98% 1016 99% 1023 100% 1023 (longest request) 测试结果*好,压力测试*好,资源占用*低 而且在压力测试参数增加后, nginx 的测试结果更好了,有点不解。
第 2 条附言 · 2016-03-25 22:28:31 +08:00
Time taken for tests: 3.589 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1359500 bytes
HTML transferred: 1287200 bytes
Requests per second: 27.86 [#/sec] (mean)
Time per request: 3589.014 [ms] (mean)
Time per request: 35.890 [ms] (mean, across all concurrent requests)
Transfer rate: 369.92 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 1 0.3 1 2
Processing: 74 1974 996.3 1995 3513
Waiting: 71 1974 996.3 1995 3513
Total: 74 1975 996.0 1997 3514
Percentage of the requests served within a certain time (ms)
50% 1997
66% 2560
75% 2925
80% 3046
90% 3374
95% 3484
98% 3494
99% 3514
100% 3514 (longest request)
## Debian
Server Software: Apache/2.4.10
Server Hostname: 127.0.0.1
Server Port: 80
Concurrency Level: 100
Time taken for tests: 1.215 seconds
Complete requests: 100
Failed requests: 0
Total transferred: 1367400 bytes
HTML transferred: 1287200 bytes
Requests per second: 82.30 [#/sec] (mean)
Time per request: 1215.040 [ms] (mean)
Time per request: 12.150 [ms] (mean, across all concurrent requests)
Transfer rate: 1099.02 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 3 25 4.0 26 27
Processing: 149 705 315.9 706 1187
Waiting: 134 694 316.7 705 1186
Total: 170 730 317.1 732 1212
Percentage of the requests served within a certain time (ms)
50% 732
66% 917
75% 1010
80% 1055
90% 1161
95% 1205
98% 1211
99% 1212
100% 1212 (longest request)
第 3 条附言 · 2016-03-25 22:29:09 +08:00
分别测试三次,取*好结果。
测试结果是 debian 的更好,但内存已经满了。 centos 则已经开始使用 swap 了。
系统负载方面也是 debian 更低,但微乎其微,至少和内存方面的差距比起来是这样。
测试结束后内存占用率回落也是 debian 更快, centos 回落速度慢是不是受 swap 硬盘速度的影响不得而知。 centos 是 mariadb 而 debian 是 mysql ,不知道这是不是也是个影响因素。
Concurrency Level: 100
Time taken for tests: 1.024 seconds
Complete requests: 100
Failed requests: 0
Total transferred: 1363960 bytes
HTML transferred: 1287100 bytes
Requests per second: 97.66 [#/sec] (mean)
Time per request: 1023.960 [ms] (mean)
Time per request: 10.240 [ms] (mean, across all concurrent requests)
Transfer rate: 1300.82 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 9 28 3.4 28 32
Processing: 56 519 288.0 503 991
Waiting: 45 514 287.2 501 991
Total: 73 547 290.2 531 1023
Percentage of the requests served within a certain time (ms)
50% 531
66% 720
75% 819
80% 866
90% 964
95% 1011
98% 1016
99% 1023
100% 1023 (longest request)
测试结果*好,压力测试*好,资源占用*低
而且在压力测试参数增加后, nginx 的测试结果更好了,有点不解。