Project Info |
|
License: |
Apache License, Version 2.0 |
Build: |
msbuild |
End User Documentation: |
|
Community Documentation: |
|
Issue tracker: |
|
Mailing lists: |
A Xamarin Application that demonstrates features of the Aerogear Xamarin SDK on iOS and Android.
For more information, please check the Mobile Security Project.
The following softwares must be installed in order to be able to compile the application:
The master
branch will always track to the latest release of the SDK.
$ git clone git@github.com:aerogear/xamarin-showcase-template.git
$ cd xamarin-showcase-template
A Xamarin application can run on both iOS and Android.
$ open xamarin-showcase-template.sln
-
A Visual Studio window will open. In the top bar, choose Example.iOS→Debug→iPhone 8 iOS 11.4.
-
Click on the
play
button
$ git clone git@github.com:aerogear/xamarin-showcase-template.git
$ cd xamarin-showcase-template
$ open xamarin-showcase-template.sln
-
A Visual Studio window will open. In the top bar, choose Example.iOS→Debug→YOUR_DEVICE (for example: nexus_5x_api_27 (API 27))
-
Click on the
▶️ button
If there is no available devices in your environment, they can be added from within Visual Studio by clicking on Tools→Device Manager
-
Add the Xamarin and mono tools executables to the path
$ export PATH=$PATH:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
-
Compile the sources
$ nuget restore $ msbuild xamarin-showcase-template.sln /p:Configuration=Debug /p:Platform=iPhoneSimulator /t:Clean,Rebuild
-
Choose the device to be used to run the app
$ export DEVICE=":v2:runtime=com.apple.CoreSimulator.SimRuntime.iOS-11-4,devicetype=com.apple.CoreSimulator.SimDeviceType.iPhone-8"
The available list of runtimes can be obtained with
$ xcrun simctl list runtimes
while the list of available devices can be obtained with
$ xcrun simctl list devicetypes
-
Run the application on the selected device
$ mtouch --device=$DEVICE -launchsim ./Example.iOS/bin/iPhoneSimulator/Debug/Example.iOS.app
To run the showcase app
-
Add the Mono and Android tools executables to the path and setup the environment
$ export SDK_HOME=$HOME/Library/Android/sdk $ export PATH=$PATH:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin:$SDK_HOME/tools:$SDK_HOME/platform-tools
-
Compile the sources
$ nuget restore $ msbuild Example.Android/Example.Android.csproj /p:Configuration=Debug /p:EmbedAssembliesIntoApk=True /t:Clean,Rebuild,SignAndroidPackage
-
Get the launchable activity name
$ export AAPT=`find $SDK_HOME/build-tools/ -name aapt | sort -r | head -n 1` $ export ACTIVITY=`$AAPT dump badging Example.Android/bin/Debug/org.aerogear.xamarin.Example-Signed.apk | grep launchable-activity | perl -pe "s/.*name='(.*?)'.*/org.aerogear.xamarin.Example\/\1/"`
-
Start the android emulator
$ emulator -avd nexus_5x_api_27 -partition-size 512
The list of available avd can be obtained with
$ emulator -list-avds
If no avds are available, the easiest way to add one is to open Visual Studio and click on
Tools→Device Manager
. -
Install the Showcase app APK into the emulator and run it
$ adb -e install -r ./Example.Android/bin/Debug/org.aerogear.xamarin.Example-Signed.apk $ adb shell am start -n $ACTIVITY
See LICENSE file
Join our user mailing list for any questions or help! We really hope you enjoy app development with AeroGear!
If you found a bug please create a ticket for us on Jira with some steps to reproduce it.