Skip to content

Commit

Permalink
Problem: Missing android build command for simple demo (fix cronos-la…
Browse files Browse the repository at this point in the history
…bs/play-unreal-plugin#238) (#28)

Close:
- cronos-labs/play-unreal-plugin#238

Solution:
- Add android-build.ps1
- Remove android_key_gen.bat and replace it with android_key_gen.ps1
- Update README

* Update README

* Update README
  • Loading branch information
damoncro authored Jan 4, 2023
1 parent 6564a0e commit a9bab9b
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 47 deletions.
108 changes: 67 additions & 41 deletions simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,77 @@ repository](https://github.com/crypto-com/play-unreal-plugin).
## Pre-built Release
Download the release zip file in [Release](https://github.com/cronos-labs/play-unreal-demo/releases) page.


## Setup Manually
If you prefer configuring the project manually:
1. For windows,
- `git clone https://github.com/cronos-labs/play-unreal-plugin.git Plugins/play-unreal-plugin/`
- `cd Plugins/play-unreal-plugin/`
- `install-play-cpp-sdk.bat`
- `cd ../../`
- `windows-build.bat`
If you prefer configuring the project manually,

### Windows
``` powershell
git clone https://github.com/cronos-labs/play-unreal-plugin.git Plugins\play-unreal-plugin\
cd Plugins\play-unreal-plugin\
.\install-play-cpp-sdk.bat
cd ..\..\
.\windows-build.bat
```

### Mac or Linux
``` sh
git clone https://github.com/cronos-labs/play-unreal-plugin.git Plugins/play-unreal-plugin/
cd Plugins/play-unreal-plugin
make
cd ../../
make
```

### Android
1. Install Android Studio, and download android sdk and ndk
- Customize > All Settings > Appearance & Behavior > System Settings > Android SDK
- SDK Platforms: Android 11.0 (R), API Level 30 (>= 28)
- SDK Tools
- Android SDK Build-Tools: 30.0.3 (>= 28)
- NDK (Side by side): 21.47075529

2. For mac or Linux,
- `git clone https://github.com/cronos-labs/play-unreal-plugin.git Plugins/play-unreal-plugin/`
- `cd Plugins/play-unreal-plugin`
- `make`
- `cd ../../`
- `make`
2-1. Build Android on Mac
- Setup the key for signing, check
[here](https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/Android/DistributionSigning/),
or run `./android_key_gen.sh` to generate a test keystore
- Project Settings > Platforms > Android SDK ($HOME: replace with the location of your HOME
directory)
- Location of Android SDK: $HOME/Library/Android/sdk
- Location of Android NDK: $HOME/Library/Android/sdk/ndk/21.4.7075529
- Location of JAVA: /Applications/Android Studio.app/Contents/jre/Contents/Home
- SDK API Level: latest
- NDK API Level: android-21
- Run:
```sh
git clone https://github.com/cronos-labs/play-unreal-plugin.git Plugins/play-unreal-plugin/
cd Plugins/play-unreal-plugin/ && make
cd ../../ && make android
```

3. For android,
- Install Android Studio, and download android sdk and ndk
- Customize > All Settings > Appearance & Behavior > System Settings > Android SDK > SDK
Tools
- Android SDK Build-Tools: >= 28
- NDK (Side by side): 21.47075529
- Setup the key for signing, check
[here](https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/Android/DistributionSigning/),
or run `./android_key_gen.sh` to generate a test keystore
- Project Settings > Platforms > Android SDK ($HOME: replace with the location of your HOME
directory)
- Location of Android SDK: $HOME/Library/Android/sdk
- Location of Android NDK: $HOME/Library/Android/sdk/ndk/21.4.7075529
- Location of JAVA: /Applications/Android Studio.app/Contents/jre/Contents/Home
- SDK API Level: latest
- NDK API Level: android-21
- `git clone https://github.com/cronos-labs/play-unreal-plugin.git Plugins/play-unreal-plugin/`
- `cd Plugins/play-unreal-plugin/ && make`
- `cd ../../ && make android`
2-2. Build Android on Windows
- Setup the key for signing, check
[here](https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/Android/DistributionSigning/),
or run `.\android_key_gen.ps1` to generate a test keystore
- Run
``` powershell
git clone https://github.com/cronos-labs/play-unreal-plugin.git Plugins/play-unreal-plugin/
cd Plugins\play-unreal-plugin\
.\install-play-cpp-sdk.bat
cd ..\..\
.\android-build.ps1
```

4. For ios,
- Specify a valid Provision and a valid Certificate in Project Settings > Platforms > iOS > Mobile Provision
- DISABLE `Support bitcode in shipping` in Project Settings > Platforms > iOS > Build
- Setup distribution type based on the iOS profile in Project Settings > Packaging > Project > For Distribution
- `git clone https://github.com/cronos-labs/play-unreal-plugin.git Plugins/play-unreal-plugin/`
- `cd Plugins/play-unreal-plugin/ && make`
- `cd ../../ && make ios`
### iOS
Build iOS on Mac:
1. Specify a valid Provision and a valid Certificate in Project Settings > Platforms > iOS > Mobile Provision
2. DISABLE `Support bitcode in shipping` in Project Settings > Platforms > iOS > Build
3. Setup distribution type based on the iOS profile in Project Settings > Packaging > Project > For Distribution
```sh
git clone https://github.com/cronos-labs/play-unreal-plugin.git Plugins/play-unreal-plugin/
cd Plugins/play-unreal-plugin/ && make
cd ../../ && make ios
```

### More information for Cronos Play
## More information for Cronos Play
If you are a game developer, please visit [Cronos Play](https://cronos.org/play) or fill this
[Contact Form](https://airtable.com/shrFiQnLrcpeBp2lS) for more information.
16 changes: 16 additions & 0 deletions simple/android-build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[System.Environment]::SetEnvironmentVariable('JAVA_HOME','C:\Program Files\Android\Android Studio\jre')
[System.Environment]::SetEnvironmentVariable('ANDROID_HOME',"$env:LOCALAPPDATA\Android\Sdk")
[System.Environment]::SetEnvironmentVariable('NDKROOT',"$env:LOCALAPPDATA\Android\Sdk\ndk\21.4.7075529")

$curDir = (Get-Item .).FullName
cmd.exe /c "C:\Program Files\Epic Games\UE_4.27\Engine\Build\BatchFiles\RunUAT.bat" `
BuildCookRun `
-utf8output `
-platform=Android `
-cookflavor=ASTC `
-clientconfig=Development `
-serverconfig=Development `
-project="$curDir/CronosPlayUnrealDemo.uproject" `
-noP4 -nodebuginfo -allmaps `
-cook -build -stage -prereqs -pak -archive `
-archivedirectory="$curDir\archive"
6 changes: 0 additions & 6 deletions simple/android_key_gen.bat

This file was deleted.

13 changes: 13 additions & 0 deletions simple/android_key_gen.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
& "C:\Program Files\Android\Android Studio\jre\bin\keytool.exe" `
-genkey -v -keystore key.keystore -alias Mykey -keyalg RSA -keysize 2048 -validity 10000 `
-dname "CN=TestGuy, OU=MyCompany, O=MyGame, L=MyCity, ST=NC, C=00" `
-storepass 123456 -keypass 123456

$path = "Build\Android"
If(!(Test-Path -PathType container $path))
{
New-Item -ItemType Directory -Path $path
}


move key.keystore Build\Android

0 comments on commit a9bab9b

Please sign in to comment.