Difference between revisions of "Deployment to Device"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__TOC__
+
__NOTOC__
  
This document will discuss the build and deployment processes of Gideros Player
+
== Android deployment ==
and your application to iPhone/iPad devices. To follow these steps,
+
In order to have a working Android environment, you need to follow these steps:
you must be an approved Apple Developer for iOS and install the
+
 
iOS SDK (requires Intel-based Mac running Snow Leopard). In the future,
+
=== Install Android Studio for your operating system ===
we are planning to wake up our Mac build server to allow developers to
+
(see: https://developer.android.com/studio/ ).
build Gideros Player and your projects for iPhone/iPad remotely on
+
 
Windows without having to install the Xcode.
+
=== Install Gideros Player ===
 +
* '''Installing from Google Play:''' grab the Android Gideros Player from this link: https://play.google.com/store/apps/details?id=info.simart.gideros
  
Gideros Player for iOS devices allows you to see and test your application on device
+
'''OR'''
'''instantly'''. After you deploy and open Gideros Player on your iPhone or iPad,
 
you see the IP of your device. Enter this IP from "Player→Player Settings" menu:
 
  
[[File:player_settings.png]]
+
Gideros Studio comes with GiderosAndroidPlayer.apk, which is on the root directory of the installation folder.
 +
* '''Installing from device:''' connect your Android device to your computer and copy GiderosAndroidPlayer.apk file to your device's internal disk. Then, using an internal file manager, click on the APK file and install.
  
When you press start button, your codes and asset files are transferred to
+
* '''Using adb install command:''' adb command comes with Android SDK, and can be used to automatize some actions (e.g installing or removing packages) on your device. Go to the GiderosAndroidPlayer.apk folder and run the following on a command line :
your iOS device via WiFi and your application starts.
+
 
 +
<code>
 +
adb install GiderosAndroidPlayer.apk 
 +
</code>
 +
 
 +
'''NB1''': your computer and your Android device should be connected, and you should have installed necessary Android drivers to your computer before.
 +
 
 +
'''NB2''': make sure the option to allow the installation of non-market apps is active: ''Settings->Applications->Unknown sources''.
 +
 
 +
=== Testing your app ===
 +
*Start the Android Gideros Player app on your phone.
 +
*Activate the WIFI on both your phone and your computer.
 +
*Open your project in Gideros Studio. Your phone should be visible as a player. Click Start to run your app.
 +
 
 +
=== Exporting your Android app ===
 +
*Go to File → Export Project.
  
 
== iOS deployment ==
 
== iOS deployment ==
 
 
=== Prerequisites ===  
 
=== Prerequisites ===  
 
 
Apple requires developers to subscribe to Apple Developer Program. This allows programmers the ability to run their application on real devices. If you haven't done so, click http://developer.apple.com/ to join the iOS Developer Program either as an individual or a company.  
 
Apple requires developers to subscribe to Apple Developer Program. This allows programmers the ability to run their application on real devices. If you haven't done so, click http://developer.apple.com/ to join the iOS Developer Program either as an individual or a company.  
  
Line 30: Line 43:
 
# Creating your App IDs: https://developer.apple.com/ios/manage/bundles/howto.action
 
# Creating your App IDs: https://developer.apple.com/ios/manage/bundles/howto.action
 
# Creating Provisioning Profiles: https://developer.apple.com/ios/manage/provisioningprofiles/howto.action
 
# Creating Provisioning Profiles: https://developer.apple.com/ios/manage/provisioningprofiles/howto.action
 
=== Deploying Gideros Player to iOS Devices ===
 
 
There are two projects <code>GiderosiPhonePlayer.zip</code> and <code>GiderosiPadPlayer.zip</code>
 
which come with the installation. You need to extract these zip files and open, build, deploy these projects from Xcode using Mac OS X. This should be done only once as player need not be updated, and it's only used to run your code.
 
  
 
=== Deploying your application to iOS devices ===
 
=== Deploying your application to iOS devices ===
 
 
To deploy your application to iPhone/iPad you need to:
 
To deploy your application to iPhone/iPad you need to:
  
Line 43: Line 50:
 
# Build and deploy Xcode project to actual device
 
# Build and deploy Xcode project to actual device
  
First step is done through "File → Export Project" menu:
+
First step is done through "File → Export Project" menu.
  
[[File:export_project.png]]
+
For the second step, you need Intel-based Mac running Snow Leopard and Apple Developer License.
  
For the second step, you need Intel-based Mac running Snow Leopard and
+
=== Deploying Gideros Player to iOS Devices ===
Apple Developer License.
+
For your iOS device, you need to build and sign the player application yourself. Like everything for iOS, this has to be done within XCode. Please unzip the GiderosiPhonePlayer.zip archive to a location of your choice. Start XCode and load:
  
== Android deployment ==
+
<code>GiderosiPhonePlayer.xcodeproj</code>
  
Gideros includes support for Android, that is, you can write your code in Gideros Studio and deploy to both iOS and Android using same set of code. In order to have a working Android environment, you need to follow these steps:
+
Inside XCode, browse to the resource section in the “Groups and Files” list box and there open the GiderosiPhonePlayer-Info.plist. Here you need to set the bundle identifier to the app ID you have used to create a provisioning profile in the iOS Provisioning Portal.
  
# Install Android Studio for your operating system (see: https://developer.android.com/studio/ ).
+
After you have made your changes, save it and open the project settings. There you need to set the code signing identity to the one of your provisioning profile. If it doesn’t show up, then you have forgotten to actually install it. And make sure that you set the code signing identity in the configuration you want to use when you build the player. Close the settings and then Build and Run the player. If everything was set right, you will see the icon for the player show up in your device.
# Deploy Gideros Player to your Android device (this is explained below).
 
# Deploy your application to your Android device (this is also explained below).
 
  
After installing Android Studio, follow these steps to deploy your Player and application to Android.
+
== UWP deployment ==
 +
You  will need Visual Studio 2017, there is a free version (community edition):  https://visualstudio.microsoft.com/downloads/
  
=== Deploying Gideros Player to Android devices ===
+
You will also need (installed whilst VS2017 is closed):
  
Gideros Studio comes with GiderosAndroidPlayer.apk, which is on the root directory of the installation folder. This apk file is used to "run" your application on a real device, so you can test your application thoroughly.  
+
The latest Windows SDK: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
  
There are two easy methods to install an APK file to your device.
+
The latest advertising SDK: https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDK
 
 
* '''Using adb install command:''' adb command comes with Android SDK, and can be used to automatize some actions (e.g installing or removing packages) on your device. Go to the GiderosAndroidPlayer.apk folder and run the following on a command line :
 
 
 
<code>
 
adb install GiderosAndroidPlayer.apk 
 
</code>
 
  
In order to perform the command above, your computer and your Android device should be connected, and you should have installed necessary Android drivers to your computer before.
+
=== Export ===
 +
Export your Gideros app/game like you would any other platform.  Select the UWP tab in export.
  
* '''Installing from device:''' Connect your Android device to your computer and copy GiderosAndroidPlayer.apk file to your device's internal disk. Then, using an internal file manager, click on the APK file and install.
+
Once exported, go to the export folder, look in the app/games sub-folder and double-click the .sln file.
  
After you install Gideros Player on a real device, you can immediately start testing your applications on your Android, by clicking on the GiderosAndroidPlayer icon and observing the IP address of your device. Then go to Gideros Studio → Player → Player Settings and enter the IP here. As you click OK, Gideros Studio will connect to your Android device and the play button will go green.  
+
Visual Studio 2017 should open, make sure that the build type is set to 'Release' (not 'Debug'), then click the Build menu item and click 'Build solution'.
  
=== Deploying your application to Android devices ===
+
== HTML5 deployment ==
 +
Export your Gideros app/game as usual, selecting Html5 tab.
  
# Open your application with Gideros Studio.
+
Most options are pretty much self explanatory, however a few of them deserve explanation:
# Export your application for Android (File → Export Project).
+
* Facebook Instant Game: tick here if you are targeting Facebook instant game platform. If you do so, you will have to select a preload amount, which correspond to how much gideros loading (the time before your lua code is executed) weight in your app loading. You will typically leave it to 100%, unless your code takes a significant amount of time to init. In the latter case, set preload amount to whatever is suitable for you then call [[Special:MyLanguage/FBInstant.setLoadingProgress|FBInstant.setLoadingProgress]] to update loading bar within your app.
 +
* Host name: lock your app to this hostname. Your app will refuse to run if hosted/accessed from a non matching url.
 +
* Crash reporting URL: You can indicate here an endpoint where crash reports will posted to. A basic PHP receiver script may be:
 +
<syntaxhighlight lang="php">
 +
<?php
 +
header("Content-Type: text/plain");
 +
$json = file_get_contents('php://input');
 +
error_log("JSCRASH:".$json);
 +
?>
 +
</syntaxhighlight>

Latest revision as of 14:26, 13 July 2023


Android deployment

In order to have a working Android environment, you need to follow these steps:

Install Android Studio for your operating system

(see: https://developer.android.com/studio/ ).

Install Gideros Player

OR

Gideros Studio comes with GiderosAndroidPlayer.apk, which is on the root directory of the installation folder.

  • Installing from device: connect your Android device to your computer and copy GiderosAndroidPlayer.apk file to your device's internal disk. Then, using an internal file manager, click on the APK file and install.
  • Using adb install command: adb command comes with Android SDK, and can be used to automatize some actions (e.g installing or removing packages) on your device. Go to the GiderosAndroidPlayer.apk folder and run the following on a command line :

adb install GiderosAndroidPlayer.apk

NB1: your computer and your Android device should be connected, and you should have installed necessary Android drivers to your computer before.

NB2: make sure the option to allow the installation of non-market apps is active: Settings->Applications->Unknown sources.

Testing your app

  • Start the Android Gideros Player app on your phone.
  • Activate the WIFI on both your phone and your computer.
  • Open your project in Gideros Studio. Your phone should be visible as a player. Click Start to run your app.

Exporting your Android app

  • Go to File → Export Project.

iOS deployment

Prerequisites

Apple requires developers to subscribe to Apple Developer Program. This allows programmers the ability to run their application on real devices. If you haven't done so, click http://developer.apple.com/ to join the iOS Developer Program either as an individual or a company.

These are the steps you need to follow before going on for iOS deployment. If you have already completed these steps, go to "Deploying Gideros Player to iOS devices" section.

  1. Obtaining your Certificate: https://developer.apple.com/ios/manage/certificates/team/howto.action
  2. Assigning devices: https://developer.apple.com/ios/manage/devices/howto.action
  3. Creating your App IDs: https://developer.apple.com/ios/manage/bundles/howto.action
  4. Creating Provisioning Profiles: https://developer.apple.com/ios/manage/provisioningprofiles/howto.action

Deploying your application to iOS devices

To deploy your application to iPhone/iPad you need to:

  1. Export your application as Xcode project
  2. Build and deploy Xcode project to actual device

First step is done through "File → Export Project" menu.

For the second step, you need Intel-based Mac running Snow Leopard and Apple Developer License.

Deploying Gideros Player to iOS Devices

For your iOS device, you need to build and sign the player application yourself. Like everything for iOS, this has to be done within XCode. Please unzip the GiderosiPhonePlayer.zip archive to a location of your choice. Start XCode and load:

GiderosiPhonePlayer.xcodeproj

Inside XCode, browse to the resource section in the “Groups and Files” list box and there open the GiderosiPhonePlayer-Info.plist. Here you need to set the bundle identifier to the app ID you have used to create a provisioning profile in the iOS Provisioning Portal.

After you have made your changes, save it and open the project settings. There you need to set the code signing identity to the one of your provisioning profile. If it doesn’t show up, then you have forgotten to actually install it. And make sure that you set the code signing identity in the configuration you want to use when you build the player. Close the settings and then Build and Run the player. If everything was set right, you will see the icon for the player show up in your device.

UWP deployment

You will need Visual Studio 2017, there is a free version (community edition): https://visualstudio.microsoft.com/downloads/

You will also need (installed whilst VS2017 is closed):

The latest Windows SDK: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

The latest advertising SDK: https://marketplace.visualstudio.com/items?itemName=AdMediator.MicrosoftAdvertisingSDK

Export

Export your Gideros app/game like you would any other platform. Select the UWP tab in export.

Once exported, go to the export folder, look in the app/games sub-folder and double-click the .sln file.

Visual Studio 2017 should open, make sure that the build type is set to 'Release' (not 'Debug'), then click the Build menu item and click 'Build solution'.

HTML5 deployment

Export your Gideros app/game as usual, selecting Html5 tab.

Most options are pretty much self explanatory, however a few of them deserve explanation:

  • Facebook Instant Game: tick here if you are targeting Facebook instant game platform. If you do so, you will have to select a preload amount, which correspond to how much gideros loading (the time before your lua code is executed) weight in your app loading. You will typically leave it to 100%, unless your code takes a significant amount of time to init. In the latter case, set preload amount to whatever is suitable for you then call FBInstant.setLoadingProgress to update loading bar within your app.
  • Host name: lock your app to this hostname. Your app will refuse to run if hosted/accessed from a non matching url.
  • Crash reporting URL: You can indicate here an endpoint where crash reports will posted to. A basic PHP receiver script may be:
<?php
header("Content-Type: text/plain");
$json = file_get_contents('php://input');
error_log("JSCRASH:".$json);
?>