Skip to content

Instantly share code, notes, and snippets.

View topgenorth's full-sized avatar

Tom Opgenorth topgenorth

  • Sherwood Park, AB, Canada
View GitHub Profile
@topgenorth
topgenorth / gist:3fea57dd810a165bbfa5
Created September 17, 2014 15:31
Another way to check wait for Google Play Services & the map.
var cancellation = new CancellationTokenSource();
Task.Run (async () =>
{
while (true)
{
await Task.Delay(100, cancellation.Token);
_map = _mapFragment.Map;
if (_map != null)
cancellation.Cancel();
@topgenorth
topgenorth / gist:52c012501f61c1cb5c51
Created September 9, 2014 14:53
UITests for Android
[08:50:19][Execute xtc_android] Negotiating file upload to Xamarin Test Cloud.
[08:50:20][Execute xtc_android] Posting to https://testcloud.xamarin.com/ci/upload2
[08:50:20][Execute xtc_android]
[08:50:20][Execute xtc_android] Uploading tests to Xamarin Test Cloud
[08:50:20][Execute xtc_android] Uploading CreditCardValidation.Tests.dll ... Already uploaded.
[08:50:20][Execute xtc_android] Uploading Xamarin.UITest.dll ... Already uploaded.
[08:50:20][Execute xtc_android] Uploading nunit.framework.dll ... Already uploaded.
[08:50:28][Execute xtc_android] Uploading CreditCardValidation.Droid_resigned.apk... Done.
[08:50:29][Execute xtc_android] Uploading AndroidTestServer.apk... Done.
[08:50:30][Execute xtc_android] Upload failed. Response:
using System;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Drawing;
namespace TwinCoders.Utils
{
public abstract partial class ParentViewController
{
[14:33:01]Checking for changes
[14:33:02]Publishing internal artifacts
[14:33:02]Clearing temporary directory: /Users/rupert/BuildAgents/buildAgent1/temp/buildTmp
[14:33:02]Checkout directory: /Users/rupert/BuildAgents/buildAgent1/work/a758c76eda83da31
[14:33:02]Updating sources: server side checkout
[14:33:02]Step 1/3: Build APK (Command Line) (7s)
[14:33:10]Step 2/3: Build iOS (Command Line) (4s)
[14:33:14]Step 3/3: Submit iOS app to TestCloud (Command Line)
[14:33:14][Step 3/3] Starting: /Users/rupert/BuildAgents/buildAgent1/temp/agentTmp/custom_script8174017321572368380
[14:33:14][Step 3/3] in directory: /Users/rupert/BuildAgents/buildAgent1/work/a758c76eda83da31
XBuild Engine Version 12.0
Mono, Version 3.6.0.0
Copyright (C) 2005-2013 Various Mono authors
Loading default tasks for ToolsVersion: 2.0 from /Library/Frameworks/Mono.framework/Versions/3.6.0/lib/mono/2.0/Microsoft.Common.tasks
Build started 2014-08-11 7:16:58 PM.
__________________________________________________
Loading default tasks for ToolsVersion: 4.0 from /Library/Frameworks/Mono.framework/Versions/3.6.0/lib/mono/4.5/Microsoft.Common.tasks
/Users/tom/work/xamarin/ci/taskypro/Tasky.Droid/Tasky.Droid.csproj: Importing project /Library/Frameworks/Mono.framework/External/xbuild/Novell/Novell.MonoDroid.CSharp.targets from extension path /Library/Frameworks/Mono.framework/External/xbuild
/Library/Frameworks/Mono.framework/External/xbuild/Novell/Novell.MonoDroid.CSharp.targets: Importing project /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets from extension path /Library/Frameworks/Mono.framework/External/xbuild
#!/bin/sh
# add a simple 'nuget' command to Mac OS X under Mono
# get NuGet.exe binary from http://nuget.codeplex.com/releases/view/58939
# get Microsoft.Build.dll from a Windows .NET 4.0 installation
# copy to /usr/local/bin and Robert is your father's brother....
#
PATH=/usr/local/bin:$PATH
mono --runtime=v4.0 /usr/local/bin/NuGet.exe $*
18:19 ~/work/xamarin/code/mobile-samples/TaskyPro-Calabash (master)
$ calabash-android console ./Tasky.Droid/bin/Release/com.xamarin.samples.taskydroid-Signed.apk
2.1.2 :001 > reinstall_apps
NameError: undefined local variable or method `reinstall_apps' for main:Object
from (irb):1
from /Users/tom/.rvm/rubies/ruby-2.1.2/bin/irb:11:in `<main>'
2.1.2 :002 > install_apps
NameError: undefined local variable or method `install_apps' for main:Object
from (irb):2
from /Users/tom/.rvm/rubies/ruby-2.1.2/bin/irb:11:in `<main>'
@topgenorth
topgenorth / UIViewHelpers
Created June 24, 2014 19:09
Set the accessibility Id
public static class UIViewHelpers
{
static readonly IntPtr selAccessibilityIdentifier_Handle = Selector.GetHandle("accessibilityIdentifier");
static readonly IntPtr setAccessibilityIdentifier_Handle = Selector.GetHandle("setAccessibilityIdentifier:");
public static UIView SetAccessibilityId(this UIView view, string id)
{
var intPtr = NSString.CreateNative(id);
Messaging.void_objc_msgSend_IntPtr(view.Handle, setAccessibilityIdentifier_Handle, intPtr);
NSString.ReleaseNative(intPtr);
@topgenorth
topgenorth / gist:b52f3c5a95d11ec34660
Created June 23, 2014 17:22
Error when trying to run test-cloud.
### Checking ipa for linking with Calabash ###
ipa: /Users/tom/work/xamarin/code/private-samples/Xamarin.UITest/CreditCardValidation/CreditCardValidation.iOS/bin/iPhone/Debug/CreditCardvalidationiOS-1.0.ipa *contains* calabash.framework
### Checking for Gemfile ###
2014-06-23 11:18:38 -0600
2014-06-23 11:18:38 -0600 Gemfile missing.
2014-06-23 11:18:38 -0600 You must provide a Gemfile in your workspace.
2014-06-23 11:18:38 -0600 A Gemfile must describe your dependencies and their versions
2014-06-23 11:18:38 -0600 See: http://gembundler.com/v1.3/gemfile.html
2014-06-23 11:18:38 -0600
12-06-2014 12:14:15.328 -06:00 - iOS test running Xamarin.UITest version: 0.3.5
12-06-2014 12:14:15.328 -06:00 - Skipping local screenshots. Can be enabled with EnableScreenshots() when configuring app.
12-06-2014 12:14:15.329 -06:00 - Artifact folder: /var/folders/61/bhbtr4_51tx9bl3l5lqzl87m0000gn/T/CT-b0bf79d5-882f-4115-9642-e6857039e2dc
12-06-2014 12:14:15.380 -06:00 - Starting app. [ DeviceId: ff38b4ded1c2c83752a17c8b4f0fde1acde2f0c9, BundleId: com.xamarin.calabash.example.creditcardvalidation ]
12-06-2014 12:14:15.972 -06:00 - Starting process. [ Path: /usr/bin/instruments, Arguments: -w ff38b4ded1c2c83752a17c8b4f0fde1acde2f0c9 -D "/var/folders/61/bhbtr4_51tx9bl3l5lqzl87m0000gn/T/CT-b0bf79d5-882f-4115-9642-e6857039e2dc/Output-20140612-181415-3289" -t "/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate" "com.xamarin.calabash.example.creditcardvalidation" -e UIARESULTSPATH "/var/folders/61/bhbtr4_51tx9bl3l5l