コード例 #1
0
ファイル: TimingTests.cs プロジェクト: joobn72/xamarin-macios
        public TimingTests(MTouch.Profile profile)
        {
            this.profile = profile;

            // Create dummy app to initialize the simulator.
            using (var buildTool = new MTouchTool()) {
                buildTool.Profile = profile;
                buildTool.CreateTemporaryApp(true);
                buildTool.Execute(MTouchAction.BuildSim);
                var mlaunch = new MLaunchTool();
                mlaunch.AppPath = buildTool.AppPath;
                mlaunch.Profile = profile;
                mlaunch.Execute();
            }
        }
コード例 #2
0
        public void CreateTemporaryApp(MTouch.Profile profile = MTouch.Profile.Unified, bool hasPlist = false, string appName = "testApp", string code = null)
        {
            var testDir = CreateTemporaryDirectory();
            var app     = Path.Combine(testDir, appName + ".app");

            Directory.CreateDirectory(app);

            AppPath    = app;
            Executable = MTouch.CompileTestAppExecutable(testDir, code, "", Profile, appName);

            if (hasPlist)
            {
                File.WriteAllText(Path.Combine(app, "Info.plist"), CreatePlist(profile, appName));
            }
        }
コード例 #3
0
        string CreatePlist(MTouch.Profile profile, string appName)
        {
            string plist = null;

            switch (profile)
            {
            case MTouch.Profile.Unified:
                plist = string.Format(@"<?xml version=""1.0"" encoding=""UTF-8""?>
<!DOCTYPE plist PUBLIC ""-//Apple//DTD PLIST 1.0//EN"" ""http://www.apple.com/DTDs/PropertyList-1.0.dtd"">
<plist version=""1.0"">
<dict>
	<key>CFBundleDisplayName</key>
	<string>{0}</string>
	<key>CFBundleIdentifier</key>
	<string>com.xamarin.{0}</string>
	<key>CFBundleExecutable</key>
	<string>{0}</string>
	<key>MinimumOSVersion</key>
	<string>{1}</string>
	<key>UIDeviceFamily</key>
	<array>
		<integer>1</integer>
		<integer>2</integer>
	</array>
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationPortraitUpsideDown</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
</dict>
</plist>
", appName, MTouch.GetSdkVersion(Profile));
                break;

            case MTouch.Profile.TVOS:
                plist = string.Format(@"<?xml version=""1.0"" encoding=""UTF-8""?>
<!DOCTYPE plist PUBLIC ""-//Apple//DTD PLIST 1.0//EN"" ""http://www.apple.com/DTDs/PropertyList-1.0.dtd"">
<plist version=""1.0"">
<dict>
	<key>CFBundleDisplayName</key>
	<string>Extensiontest</string>
	<key>CFBundleIdentifier</key>
	<string>com.xamarin.{0}</string>
	<key>CFBundleExecutable</key>
	<string>{0}</string>
	<key>MinimumOSVersion</key>
	<string>{1}</string>
	<key>UIDeviceFamily</key>
	<array>
		<integer>3</integer>
	</array>
</dict>
</plist>
", appName, MTouch.GetSdkVersion(Profile));
                break;

            default:
                throw new Exception("Profile not specified.");
            }

            return(plist);
        }