Set up your Android device
To prepare to run your Crossbow
app on an Android device, you need an Android device running Android 4.1 (API level 16) or higher.
- Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
- Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
Set up the Android emulator
To prepare to run and test your Crossbow app on the Android emulator, follow these steps if you want to install it from the console:
# Run following command to install System Image for Android SDK 31
crossbundle install sdkmanager --install "system-images;android-31;google_apis;x86_64"
# Run this command to create a new Pnone emulator
avdmanager create avd -n Phone -k "system-images;android-31;google_apis;x86_64"
# And finally run this command to start the emulator
emulator -avd=Phone
If you want to install it from the GUI, follow these instructions:
- Enable
VM acceleration
on your machine. - Launch Android Studio, click the AVD Manager icon, and select Create Virtual Device.
- Choose a device definition and select Next.
- Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is recommended.
- Under Emulated Performance, select Hardware - GLES 2.0 to enable
hardware acceleration
. - Verify the AVD configuration is correct, and select Finish. (For details on the above steps, see
Managing AVDs
) - In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for your selected OS version and device.
Add environment variables
If you will build application with emulator you should add this to environment variables:
Install via command line for for macos and linux:
export PATH=<path_to_sdk>\sdk\emulator:$PATH
export PATH=<path_to_sdk>\sdk\tools\bin:$PATH
Install via command line for windows:
- Add
<path_to_sdk>\sdk\tools\bin
toPATH
variable. - Add
<path_to_sdk>\sdk\emulator
toPATH
variable.
SETX "<path_to_sdk>\sdk\tools\bin" ~PATH~
SETX "<path_to_sdk>\sdk\emulator" ~PATH~