You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -72,14 +68,78 @@ To list all the downloaded system images use the `list` command.
72
68
avdmanager list
73
69
```
74
70
75
-
## Using third-party emulators
71
+
####Using third-party emulators
76
72
77
73
An applicable option is to use third-party emulators (like **GenyMotion**).
78
74
Visit the official sites for details on how to install and use these emulators.
79
75
80
76
-[GenyMotion official site](https://www.genymotion.com)
81
77
82
-
## Running on physical device
78
+
### iOS Simulators
79
+
80
+
---
81
+
82
+
#### Creating iOS Simulators
83
+
84
+
The iOS simulator emulates iOS devices on Macs. The following documentation is a quick way to get the iOS simulator set up. For more information, see [Apple's documentation](https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/simulator_help_topics/Chapter/Chapter.html).
85
+
86
+
#### Running on iOS Simualators
87
+
88
+
On a mac if you have XCode installed with the proper tools, executing `ns run ios` from your terminal will launch the Simulator program with a default device. Alternatively, you can open the Simulator program on your mac, select which device(s) you want to open by navigating to `File -> Open Simulator` and choosing the device to launch. Then execute `ns run ios` and the NativeScript app will launch on the open simulator(s).
89
+
90
+
## Running your app on Android devices
91
+
92
+
#### Enable Debugging over USB
93
+
94
+
Most Android devices can only install and run apps downloaded from Google Play, by default. You will need to enable USB Debugging on your device in order to install your app during development.
95
+
96
+
To enable USB debugging on your device, you will first need to enable the "Developer options" menu by going to Settings → About phone → Software information and then tapping the Build number row at the bottom seven times. You can then go back to Settings → Developer options to enable "USB debugging".
97
+
98
+
#### Plug in your device via USB
99
+
100
+
Let's now set up an Android device to run our NativeScript projects. Go ahead and plug in your device via USB to your development machine.
101
+
102
+
Now check that your device is properly connecting to ADB, the Android Debug Bridge, by running adb devices.
103
+
104
+
```shell
105
+
adb devices
106
+
```
107
+
108
+
The device should be listed. See the full [adb documentation](https://developer.android.com/studio/command-line/adb) for troubleshooting and detailed information.
109
+
110
+
#### Run your app
111
+
112
+
Type the following in your command prompt to install and launch your app on the device:
113
+
114
+
```shell
115
+
ns run android
116
+
```
117
+
118
+
## Running your app on iOS devices
119
+
120
+
#### Plug in your device via USB
121
+
122
+
Connect your iOS device to your Mac using a USB to Lightning cable. Navigate to the `ios` folder in your project under `platforms`, then open the `.xcodeproj` file, or if you are using CocoaPods open `.xcworkspace`, within it using Xcode.
123
+
124
+
If this is your first time running an app on your iOS device, you may need to register your device for development. Open the Product menu from Xcode's menubar, then go to Destination. Look for and select your device from the list. Xcode will then register your device for development.
125
+
126
+
#### Configure code signing
127
+
128
+
Register for an Apple developer account if you don't have one yet.
129
+
130
+
Select your project in the Xcode Project Navigator, then select your main target (it should share the same name as your project). Look for the "General" tab. Go to "Signing" and make sure your Apple developer account or team is selected under the Team dropdown. Do the same for the tests target (it ends with Tests, and is below your main target).
131
+
132
+
#### Run your app
133
+
134
+
If the device is now registered with your developer account you should be able to run your NativeScript app on the device. Execute the following from your terminal to run the app from the CLI:
135
+
136
+
```shell
137
+
ns run ios
138
+
```
139
+
140
+
The app should install and launch on the connected iOS device.
141
+
142
+
Alternatively, once you have the NativeScript project built, you can open open the native project inside XCode by opening the `.xcworkspace` or `.xcproject` file from XCode's menu and then running on a connected device or simulator.
0 commit comments