ios developer tiny share-20160712
2016-07-12 20:20
441 查看
今天讲如何运行起你上一节创建的工程,具体如下:
After you create your project from a template, build and run your app to see what the app looks like on a device. For macOS apps, just click the Run button in the toolbar and the app launches on your Mac. For other apps, you can develop and test your app
on your Mac using a simulated device and later, test using a real device connected to your Mac.
Projects can have multiple targets—multiple apps and multiple configurations of the same app. A target specifies a product to build, such as an iOS, watchOS, or macOS app. Most projects you create from a template have one target for the main app and other targets
for test apps. For watchOS apps, there’s a target for the iOS app, the WatchKit extension, and the WatchKit app. To view the targets, click the Project/Targets button in the project editor.
To run your app, choose a scheme from the Scheme pop-up menu in the toolbar. A scheme is a collection of settings that specify the targets to build, the build configuration, and the executable environment. Xcode creates a default scheme for each target in
your project. Choose the scheme from the Scheme pop-up menu that matches your app’s name.
Next choose a run destination from the Scheme pop-up menu in the toolbar. The run destination determines where the app runs after it’s built. For macOS apps, the run destination is the Mac running Xcode. For other apps, you can choose a simulator of a product
family running a version of the operating system, or a device connected to your Mac. To test your app without a device, choose a simulator from the Scheme pop-up menu. For tvOS apps, choose Apple TV 1080p under tvOS Simulator.
To test a WatchKit App target, choose the WatchKit App as the scheme, and choose an iPhone simulator paired to an Apple Watch as the run destination.
Now click the Run button in the toolbar to compile, link, and debug your app. The activity viewer in the toolbar shows the build progress and results. If an error or warning occurs, a corresponding yellow or red icon appears in the activity viewer and you
can click it to view details in the issue navigator. Click the issue in the navigator and Xcode displays the line of code where the compiler error occurred.
If the build is successful, your macOS app launches on your Mac. For other apps, the app launches in Simulator—a developer tool included with Xcode that simulates devices. For iOS and tvOS apps created from a template, Simulator displays an empty view because
you haven’t created the UI yet. For watchOS apps, Simulator opens both an iPhone simulator displaying the Home screen, and an Apple Watch simulator displaying an empty view.
In Simulator, you can simulate a physical user action—such as rotating or shaking an iOS device—using the Hardware menu. You can also simulate touch gestures and simulate Apple Watch interactions using the Mac pointer.
For iOS and tvOS apps, use the Settings app to configure the simulator. To open Settings, choose Hardware > Home and double-click Settings. For example, if your app uses iCloud services, you can enter iCloud credentials in Simulator before launching your
app.
If the target launches successfully, Xcode starts a debug session in the debug area below the editor. To quit the app and the debug session, click the Stop button next to the Run button in the toolbar.
After you create your project from a template, build and run your app to see what the app looks like on a device. For macOS apps, just click the Run button in the toolbar and the app launches on your Mac. For other apps, you can develop and test your app
on your Mac using a simulated device and later, test using a real device connected to your Mac.
Projects can have multiple targets—multiple apps and multiple configurations of the same app. A target specifies a product to build, such as an iOS, watchOS, or macOS app. Most projects you create from a template have one target for the main app and other targets
for test apps. For watchOS apps, there’s a target for the iOS app, the WatchKit extension, and the WatchKit app. To view the targets, click the Project/Targets button in the project editor.
To run your app, choose a scheme from the Scheme pop-up menu in the toolbar. A scheme is a collection of settings that specify the targets to build, the build configuration, and the executable environment. Xcode creates a default scheme for each target in
your project. Choose the scheme from the Scheme pop-up menu that matches your app’s name.
Next choose a run destination from the Scheme pop-up menu in the toolbar. The run destination determines where the app runs after it’s built. For macOS apps, the run destination is the Mac running Xcode. For other apps, you can choose a simulator of a product
family running a version of the operating system, or a device connected to your Mac. To test your app without a device, choose a simulator from the Scheme pop-up menu. For tvOS apps, choose Apple TV 1080p under tvOS Simulator.
To test a WatchKit App target, choose the WatchKit App as the scheme, and choose an iPhone simulator paired to an Apple Watch as the run destination.
Now click the Run button in the toolbar to compile, link, and debug your app. The activity viewer in the toolbar shows the build progress and results. If an error or warning occurs, a corresponding yellow or red icon appears in the activity viewer and you
can click it to view details in the issue navigator. Click the issue in the navigator and Xcode displays the line of code where the compiler error occurred.
If the build is successful, your macOS app launches on your Mac. For other apps, the app launches in Simulator—a developer tool included with Xcode that simulates devices. For iOS and tvOS apps created from a template, Simulator displays an empty view because
you haven’t created the UI yet. For watchOS apps, Simulator opens both an iPhone simulator displaying the Home screen, and an Apple Watch simulator displaying an empty view.
In Simulator, you can simulate a physical user action—such as rotating or shaking an iOS device—using the Hardware menu. You can also simulate touch gestures and simulate Apple Watch interactions using the Mac pointer.
For iOS and tvOS apps, use the Settings app to configure the simulator. To open Settings, choose Hardware > Home and double-click Settings. For example, if your app uses iCloud services, you can enter iCloud credentials in Simulator before launching your
app.
If the target launches successfully, Xcode starts a debug session in the debug area below the editor. To quit the app and the debug session, click the Stop button next to the Run button in the toolbar.
相关文章推荐
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 不可修补的 iOS 漏洞可能导致 iPhone 4s 到 iPhone X 永久越狱
- iOS 12.4 系统遭黑客破解,漏洞危及数百万用户
- 每日安全资讯:NSO,一家专业入侵 iPhone 的神秘公司
- [转][源代码]Comex公布JailbreakMe 3.0源代码
- 讲解iOS开发中基本的定位功能实现
- iOS中定位当前位置坐标及转换为火星坐标的方法
- js判断客户端是iOS还是Android等移动终端的方法
- iOS应用开发中AFNetworking库的常用HTTP操作方法小结
- iOS应用中UISearchDisplayController搜索效果的用法
- iOS App开发中的UISegmentedControl分段组件用法总结
- IOS开发环境windows化攻略
- iOS应用中UITableView左滑自定义选项及批量删除的实现
- iOS中UIAlertView警告框组件的使用教程
- 浅析iOS应用开发中线程间的通信与线程安全问题
- iOS中的UIKeyboard键盘视图使用方法小结
- 检测iOS设备是否越狱的方法
- .net平台推送ios消息的实现方法