示例#1
0
    public static void DoBuild(string message, bool buildPlayer, bool buildIPAOnly, TestFlightPreferences preferences)
    {
        if(_instance!=null)
        {
            Debug.LogError("AutoPilot: cannot start, a build is already in progress");
            return;
        }

        if(TestFlightBuildPipeline.onPreBuild!=null)
            TestFlightBuildPipeline.onPreBuild(preferences);

        if(buildPlayer)
        {
            if(!TestFlightBuildPipeline.BuildPlayerIOS(preferences))
                return;
        }

        TestFlightBuildWindow window = TestFlightBuildWindow.CreateInstance<TestFlightBuildWindow>();

        window.preferences = preferences;
        window.allowToLive = true;
        window.message = message;
        window.buildIPAOnly = buildIPAOnly;

        window.position = new Rect(0, 0, 300, 140);
        window.minSize = new Vector2(window.position.width, window.position.height);
        window.maxSize = new Vector2(window.position.width+1, window.position.height+1);

        window.ShowPopup();
    }
示例#2
0
 public static TestFlightPreferences Load()
 {
     TestFlightPreferences prefs = new TestFlightPreferences();
     prefs.teamPrefs = TestFlightTeamPreferences.Load();
     prefs.userPrefs = TestFlightUserPreferences.Load();
     return prefs;
 }
    public void OnEnable()
    {
        logoTex = TestFlightResources.GetTextureResource("logo_small.png");
        title = "Autopilot Build Options";
        preferences = TestFlightPreferences.Load();

        messageOptions = new List<string>();
        messageOptions.Add("New message...");
        messageOptions.AddRange(preferences.userPrefs.messageHistory);
        messageOptions.RemoveAll(m => m.Length == 0);
        messageOptions.Insert(1, "");
        newBundleVersion = PlayerSettings.bundleVersion;

        allProvisions = TestFlightMobileProvision.EnumerateProvisions();
        allSchemas = TestFlightXCodeSchemas.Enumerate(preferences.teamPrefs.buildPath);
        allIdentities = TestFlightDeveloperIdentities.Enumerate();
    }
    public static System.Diagnostics.Process BuildApp(TestFlightPreferences preferences)
    {
        TestFlightXCodeSchemas schmeas = TestFlightXCodeSchemas.Enumerate(preferences.teamPrefs.buildPath);
        if(schmeas == null || schmeas.Schemes == null || System.Array.IndexOf(schmeas.Schemes, preferences.userPrefs.xCodeSchema) == -1)
            preferences.userPrefs.xCodeSchema = "";

        if(Directory.Exists(preferences.teamPrefs.OutputPath))
            Directory.Delete(preferences.teamPrefs.OutputPath, true);

        Directory.CreateDirectory(preferences.teamPrefs.OutputPath);

        string buildPath = preferences.teamPrefs.buildPath;
        string extraArgs = "";

        /*
        if(preferences.userPrefs.xCodeConfig.Length > 0)
            extraArgs += " -configuration "+preferences.userPrefs.xCodeConfig;
        */

        if(preferences.userPrefs.xCodeSchema.Length > 0)
            extraArgs += " -scheme "+preferences.userPrefs.xCodeSchema;

        if(preferences.userPrefs.customProvisionProfile != null && preferences.userPrefs.customProvisionProfile.UUID != "")
        {
            extraArgs += " PROVISIONING_PROFILE=\""+preferences.userPrefs.customProvisionProfile.UUID+"\"";
        }

        if(preferences.userPrefs.dSYMBuild)
        {
            extraArgs += " DEBUG_INFORMATION_FORMAT=dwarf-with-dsym";
            extraArgs += " GCC_GENERATE_DEBUGGING_SYMBOLS=YES";
        }

        if(preferences.userPrefs.developerIdentity.Length > 0 && preferences.userPrefs.developerIdentity!="iPhone Developer")
        {
            extraArgs += " CODE_SIGN_IDENTITY=\""+preferences.userPrefs.developerIdentity+"\"";
        }

        extraArgs += " CONFIGURATION_BUILD_DIR=\""+Path.GetFullPath(preferences.teamPrefs.OutputPath)+"\"";
        string args = "clean build -project Unity-iPhone.xcodeproj"+extraArgs;
        Debug.Log("AutoPilot building .app: xcodebuild "+args);
        return StartProcess("xcodebuild", args, true, Path.GetFullPath(buildPath));
    }
    public static void DrawSubUserSettingsForIPA(TestFlightPreferences preferences, bool narrow, TestFlightMobileProvision[] availableProvisions, TestFlightXCodeSchemas availableSchemas, string[] availableIdentities)
    {
        DrawSubUserSettings_TestFlightSDK(preferences, narrow);
        DrawSubUserSettings_dSYM(preferences, narrow);
        DrawSubUserSettings_BundleId(availableProvisions, availableIdentities);
        DrawSubUserSettings_Provisions(preferences, narrow, availableProvisions, availableIdentities);

        if(preferences.userPrefs.customProvisionProfile != null && preferences.userPrefs.customProvisionProfile.Certificates == null)
            DrawSubUserSettings_Identity(preferences, narrow, availableIdentities, availableProvisions);

        DrawSubUserSettings_XCodeSchema(preferences, narrow, availableSchemas);

        if(!narrow)
        {
            GUILayout.Space(20);
            GUILayout.BeginHorizontal();
            GUILayout.Space(FieldWidth+4);
            GUILayout.Box("* Denotes settings that apply to both Autopilot and regular Unity builds");
            GUILayout.EndHorizontal();
        }
    }
    private static void DrawSubUserSettings_XCodeSchema(TestFlightPreferences preferences, bool narrow, TestFlightXCodeSchemas availableSchemas)
    {
        //		string[] configs = new string[] {"Release", "Debug"};
        string[] schemes = new string[] {"N/A"};
        //		string defaultConfig = preferences.userPrefs.xCodeSchema;
        if(availableSchemas != null)
        {
        //			configs = availableSchemas.Configs;
        //			defaultConfig = availableSchemas.DefaultConfig;

            if(availableSchemas.Schemes.Length > 0)
                schemes = availableSchemas.Schemes;
        }

        /*
        int currentConfig = System.Array.IndexOf(configs, preferences.userPrefs.xCodeConfig);
        if(currentConfig == -1)  currentConfig = Mathf.Max(0, System.Array.IndexOf(configs, defaultConfig));
        int newConfig = Mathf.Max(0, Popup(new GUIContent(narrow ? "Config":"XCode Configuration"), currentConfig, configs, narrow ? 5:0, narrow));
        preferences.userPrefs.xCodeConfig = newConfig < configs.Length ? configs[newConfig]:"";
        */

        int currentScheme = Mathf.Max(0, System.Array.IndexOf(schemes, preferences.userPrefs.xCodeSchema));
        int newScheme = Mathf.Max(0, Popup(new GUIContent(narrow ? "Scheme":"XCode Build Sheme", "The Xcode scheme to build with for users with customized Xcode projects.\n\nThis can be left as N/A or Unity-iPhone if you haven't haven't added extra schemas to your Xcode project"),
                                           					currentScheme, schemes, narrow ? 5:0));
        preferences.userPrefs.xCodeSchema = newScheme < schemes.Length ? schemes[newScheme]:"";
    }
 private static void DrawSubUserSettings_TestFlightUpload(TestFlightPreferences preferences, ref bool showUserLists)
 {
     preferences.userPrefs.notifyUsers = Toggle(new GUIContent("Notify Users", "Send emails to any users added to this build? (All users if it's a new build)"), preferences.userPrefs.notifyUsers);
     preferences.userPrefs.replaceSameBuilds = Toggle(new GUIContent("Replace Builds", "If this build has the same version as one already uploaded, do we replace it? Or do we create a new build with the same version number?"), preferences.userPrefs.replaceSameBuilds);
     preferences.userPrefs.activeDistributionLists = StringToggleField(new GUIContent("Active Lists", "Which of our distribution lists will we send builds to?"), preferences.teamPrefs.distributionLists, preferences.userPrefs.activeDistributionLists, ref showUserLists);
 }
    private static void DrawSubUserSettings_TestFlightSDK(TestFlightPreferences preferences, bool narrow)
    {
        bool hasSDK = TestFlightBuildPipeline.IsTestFlightSDKInstalled();
        string testFlightDescriptionBox = "You can still use testflight to deploy builds on users devices,\nbut won't receieve session logs/crashdumps. Features such as checkpoints,\nuser feedback and questions will be unavailable";
        Color testFlightDescriptionBoxColor = Color.grey;
        Texture testFlightDescriptionTexture = null;

        if(hasSDK)
        {
            GUILayout.BeginHorizontal();
            GUIContent[] options = new GUIContent[] { new GUIContent("Don't use TestFlight SDK"), new GUIContent("TestFlight SDK (for testers)",  TestFlightResources.TestflightSDKLogo), new GUIContent("TestFlight Live! (for App Store)", TestFlightResources.TestflightLiveLogo)};
            preferences.userPrefs.testFlightSDKEmbedType = (TestFlightSDKEmbedType)Popup(new GUIContent ("Testflight SDK*", "Integrate the Testflight SDK into this build?"), (int)preferences.userPrefs.testFlightSDKEmbedType, options, 0);
            GUILayout.EndHorizontal();

            switch(preferences.userPrefs.testFlightSDKEmbedType)
            {
            case TestFlightSDKEmbedType.DontAddTestflightSDK:
                testFlightDescriptionBoxColor = Color.grey;
                testFlightDescriptionBox = "TestFlight SDK Disabled.\n\n"+testFlightDescriptionBox;
                testFlightDescriptionTexture = null;
                break;

            case TestFlightSDKEmbedType.ForTestflightTesters:
                testFlightDescriptionBoxColor = Color.white;
                testFlightDescriptionBox = "TestFlight SDK for testers.\n\nAll features of the Testflight SDK can be used.\nAll session data will be referenced to the tester's TestFlight account.\n\nnote: You CANNOT use this mode of the Testflight SDK when submitting to the app store";
                testFlightDescriptionTexture = TestFlightResources.TestflightSDKLogo;
                break;

            case TestFlightSDKEmbedType.ForAppStoreSubmission:
                testFlightDescriptionBoxColor = Color.Lerp(Color.yellow, Color.red, 0.5f);
                testFlightDescriptionBox = "TestFlight SDK for Testflight Live! & App Store.\n\nNearly features of the Testflight SDK can be used,\nquestions and checkpoints can be placed the data for them cannot be collected.\nAll user data is anonymous, but you will still recieve full session and crash data.\n\nIf you submit a build in this mode to the asset store, you can use the Testflight Live! service.";
                testFlightDescriptionTexture = TestFlightResources.TestflightLiveLogo;
                break;
            }
        }
        else
        {
            Color baseColor = GUI.color;
            GUI.color = Color.grey;
            Toggle(new GUIContent("Add Testflight SDK", "You must install the testflight SDK in the preferences window to use this option"), false);
            GUI.color = baseColor;
            testFlightDescriptionBox = "Testflight SDK is not installed.\n\n" + testFlightDescriptionBox;
        }

        if(!narrow)
        {
            GUI.color = testFlightDescriptionBoxColor;
            GUILayout.BeginHorizontal();
            GUILayout.Space(FieldWidth+4);
            GUILayout.BeginHorizontal("Box", GUILayout.ExpandWidth(false));
            GUI.color = Color.white;
            GUILayout.Label(testFlightDescriptionTexture, GUILayout.ExpandWidth(false));
            GUILayout.Label(testFlightDescriptionBox, GUILayout.ExpandWidth(false));
            GUILayout.EndHorizontal();
            GUILayout.EndHorizontal();
        }
    }
    private static void DrawSubUserSettings_Provisions(TestFlightPreferences preferences, bool narrow, TestFlightMobileProvision[] availableProvisions, string[] availableIdentities)
    {
        // Only add options we have identities for
        var identityProvisionOptions = new List<KeyValuePair<string, TestFlightMobileProvision>>();
        foreach(var identity in availableIdentities)
        {
            foreach(var provision in availableProvisions)
            {
                if(!provision.MatchesBundleId(PlayerSettings.bundleIdentifier))
                    continue;

                if(provision.Certificates == null)
                {
                    identityProvisionOptions.Add(new KeyValuePair<string,TestFlightMobileProvision>("Unverified Identities", provision));
                    continue;
                }

                if(!System.Array.Exists(provision.Certificates, m => m == identity))
                    continue;

                identityProvisionOptions.Add(new KeyValuePair<string, TestFlightMobileProvision>(identity, provision));
            }
        }

        // craete a list of strings for the options we have
        var options = new List<string>();
        Regex removeParentheses = new Regex(@"\([^\)]*\)");
        for(int i=0; i<identityProvisionOptions.Count; ++i)
        {
            var option = identityProvisionOptions[i];

            string output = option.Key+"/\n"
                            +(option.Value.MatchesBundleId(PlayerSettings.bundleIdentifier)?"":"<Different Bundle Id> ")
                            +option.Value.Name;
            if(narrow)	output = removeParentheses.Replace(output, "");

            options.Add(output);
        }

        int chosen = Mathf.Max(0,identityProvisionOptions.FindIndex(delegate(KeyValuePair<string, TestFlightMobileProvision> obj) {return obj.Value.Equals(preferences.userPrefs.customProvisionProfile);}));

        var labelContent = new GUIContent(narrow?"Profile":"Provisioning Profile", "Select a specific iOS provisioning profile to use.\n\nTestflight can only intall your app on devices that are registered in this profile");
        chosen = PopupButton(labelContent, chosen, options.ToArray(), 0);

        if(identityProvisionOptions.Count != 0 && identityProvisionOptions[chosen].Value != null)
        {
            preferences.userPrefs.customProvisionProfile = identityProvisionOptions[chosen].Value;
            preferences.userPrefs.developerIdentity = identityProvisionOptions[chosen].Key;
        }

        GUI.color = Color.white;
    }
    private static void DrawSubUserSettings_Identity(TestFlightPreferences preferences, bool narrow, string[] availableIdentities, TestFlightMobileProvision[] availableProvisions)
    {
        List<string> identities = new List<string>();
        identities.AddRange(availableIdentities);

        GUILayout.BeginHorizontal();

        int current = Mathf.Max(0,identities.IndexOf(preferences.userPrefs.developerIdentity));
        current = Mathf.Max(0, Popup(new GUIContent(narrow ? "Identity":"iOS Codesign Identity",
                                                    "The developer identity certificate to use when building the app.\n\nThis must be set to a 'Distribution' identity for Ad-hoc and App store builds."),
                                     				current, identities.ToArray(), narrow ? 5:0));

        if(!narrow)
        {
            GUI.backgroundColor = Color.yellow;
            GUILayout.Label("NOTE: must be set to a 'Distribution' identity for Ad-hoc and App store builds.","textfield");
            GUI.backgroundColor = Color.white;
        }

        GUILayout.EndHorizontal();

        if(availableIdentities.Contains(identities[current]))
            preferences.userPrefs.developerIdentity = identities[current];
    }
示例#11
0
    public static bool CanBuild(TestFlightPreferences preferences, TestFlightMobileProvision[] availableProvisions, string[] availableIdentities)
    {
        if(preferences.userPrefs.userAPIKey.Length==0)
            return false;

        if(preferences.teamPrefs.teamAPIKey.Length==0)
            return false;

        if(System.Array.IndexOf(availableProvisions, preferences.userPrefs.customProvisionProfile) == -1)
            return false;

        if(System.Array.IndexOf(availableIdentities, preferences.userPrefs.developerIdentity) == -1)
            return false;

        if(!TestFlightBuildPipeline.MenuItemAllowed)
            return false;

        return true;
    }
示例#12
0
 public static void DoBuild(string message, TestFlightPreferences preferences)
 {
     DoBuild(message, TestFlightBuildPipeline.HasPro(), false, preferences);
 }
示例#13
0
    private static void ApplyTestflightSDKSettingToXcodeProject(TestFlightPreferences preferences)
    {
        bool enabled = IsTestFlightSDKInstalled() && preferences.userPrefs.UsingTestFlightSDK;

        // print a warning if the user or team token are empty
        if(enabled && preferences.userPrefs.userAPIKey.Length==0)
            Debug.LogWarning("Testflight SDK integration enabled, but no Testflight user API token set up in \"File->Autopilot Tetflight Build Preferences\". Testflight SDK will not be able to give data from this build.");

        if(enabled && preferences.teamPrefs.teamAPIKey.Length==0)
            Debug.LogWarning("Testflight SDK integration enabled, but no Testflight team API token set up in \"File->Autopilot Tetflight Build Preferences\". Testflight SDK will not be able to give data from this build.");

        // inject the TestFlight SDK
        string path = Path.GetFullPath(preferences.teamPrefs.buildPath)+"/Classes/AppController.mm";
        StreamReader sReader = new StreamReader(path);
        string output = sReader.ReadToEnd();
        sReader.Close();

        // 1. include the wrapper in AppController.mm
        string includeSubStr = "#include \"../Libraries/TestFlight.h\"\n";
        if(enabled)
        {
            if(!output.Contains(includeSubStr))
                output = includeSubStr + output;
        }
        else
        {
            output = output.Replace(includeSubStr, "");
        }

        // 2. initialize the testflight sdk at application launch
        string testFlightLaunchPattern = @"(applicationDidFinishLaunching\:\(UIApplication\*\)application\s*\{)(?:.|\n)*TestFlight_TakeOff\(\);\n";
        if(enabled)
        {
            if(!Regex.IsMatch(output, testFlightLaunchPattern))
                output = Regex.Replace(output, @"(applicationDidFinishLaunching\:\(UIApplication\*\)application\s*\{)", "$1\n\tTestFlight_TakeOff();\n");
        }
        else
        {
            output = Regex.Replace(output, testFlightLaunchPattern, "$1");
        }

        // 2.5 do the same for version 3.5's new launch function
        // didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { tTestFlight_TakeOff();
        testFlightLaunchPattern = @"(didFinishLaunchingWithOptions\:\(NSDictionary\*\)launchOptions\s*{)(?:.|\n)*TestFlight_TakeOff\(\);\n";
        if(enabled)
        {
            if(!Regex.IsMatch(output, testFlightLaunchPattern))
                output = Regex.Replace(output, @"(didFinishLaunchingWithOptions\:\(NSDictionary\*\)launchOptions\s*\n{)", "$1\n\tTestFlight_TakeOff();\n");
        }
        else
        {
            output = Regex.Replace(output, testFlightLaunchPattern, "$1");
        }

        string takeOffFunction = "";
        if(preferences.userPrefs.testFlightSDKEmbedType == TestFlightSDKEmbedType.ForTestflightTesters)
        {
            takeOffFunction += "\t[TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]];\n";
        }
        takeOffFunction += "\t[TestFlight takeOff:@\""+preferences.teamPrefs.teamAPIKey+"\"];\n";

        // 3. insert/replace the wrapper functions
        string functions = "// BEGIN AUTOPILOT IMPLMENETATION - automatically generated code, edit at your own risk.\n" +
                            "extern \"C\" void TestFlight_TakeOff()\n" +
                            "{\n" +
                            takeOffFunction +
                            "}\n" +
                            "// END AUTOPILOT IMPLMENETATION\n";

        string functionPattern = "// BEGIN AUTOPILOT IMPLMENETATION(?:.|\n)*// END AUTOPILOT IMPLMENETATION\n";
        if(Regex.IsMatch(output, functionPattern))
        {
            output = Regex.Replace(output, functionPattern, enabled ? functions:"");
        }
        else if(enabled)
        {
            output += 	"\n\n"+functions;
        }

        // 4. insert/replace prototypes
        string prototypes = "// BEGIN AUTOPILOT PROTOTYPES - automatically generated code, edit at your own risk.\n" +
                            "extern \"C\" void TestFlight_TakeOff();\n" +
                            "// END AUTOPILOT PROTOTYPES\n";

        string prototypesPattern = "// BEGIN AUTOPILOT PROTOTYPES(?:.|\n)*// END AUTOPILOT PROTOTYPES\n";
        if(Regex.IsMatch(output, prototypesPattern))
        {
            output = Regex.Replace(output, prototypesPattern, enabled ? prototypes:"");
        }
        else if(enabled)
        {
            output = Regex.Replace(output, "(// --- OpenGLES .*)", prototypes+"\n$1");
        }

        StreamWriter sWriter = new StreamWriter(path, false);
        sWriter.Write(output);
        sWriter.Close();
    }
示例#14
0
    public static string ZipDSYMTo(TestFlightPreferences preferences, string outputPath)
    {
        string dSymPath = FindBuiltDSYMName(preferences.teamPrefs.OutputPath);
        if(dSymPath != "MISSING" && preferences.userPrefs.dSYMBuild)
        {
            Debug.Log("AutoPilot: dSYM found, zipping for upload");
            string zipName = outputPath + new DirectoryInfo(dSymPath).Name + ".zip";

            if(File.Exists(zipName))
                File.Delete(zipName);

            System.Diagnostics.Process zipProcess = System.Diagnostics.Process.Start("zip", string.Format("\"{0}\" \"{1}\" -r -9", zipName, dSymPath));
            zipProcess.WaitForExit();

            return zipName;
        }

        return "MISSING";
    }
示例#15
0
    public static System.Diagnostics.Process TestFlightUpload(string message, TestFlightPreferences preferences)
    {
        //
        // FIXME: strip invalid characters from the product name
        //
        string ipaPath = FindBuiltIPAName(preferences.teamPrefs.OutputPath);
        string zipName = ZipDSYMTo(preferences, preferences.teamPrefs.OutputPath);

        //
        // FIXME: the message needs escape sequences for newlines
        //
        StreamWriter fs = new StreamWriter("TestFlightMessage.txt", false);
        fs.Write(message);
        fs.Close();

        while(!File.Exists(ipaPath))
        {
            string s = string.Format("Autopilot couldn't find your packaged .ipa at the following path:\n{0}\n\nPlease locate the .ipa to continue.\n\nContact the developer ([email protected]) if this happens often.", ipaPath);
            if(!EditorUtility.DisplayDialog("AutoPilot: Whoops!", s, "Find file...", "Abort"))
            {
                Debug.Log("AutoPilot: User aborted");
                return null;
            }

            ipaPath = EditorUtility.OpenFilePanel("Locate folder containing your .ipa", preferences.teamPrefs.buildPath, ".ipa");

            if(ipaPath.Length == 0)
            {
                Debug.Log("AutoPilot: User aborted");
                return null;
            }
        }

        string filename = "curl";
        string args = "https://testflightapp.com/api/builds.json"
          			+ " -F file=@'"+ipaPath+"'"
          			+ " -F api_token='"+preferences.userPrefs.userAPIKey+"'"
          			+ " -F team_token='"+preferences.teamPrefs.teamAPIKey+"'"
          			+ " -F notes=<'TestFlightMessage.txt'"
          			+ " -F notify="+(preferences.userPrefs.notifyUsers?"True":"False")
         		 	+ " -F distribution_lists='"+preferences.userPrefs.DistrobutionListsCSV+"'"
                    + " -F replace="+(preferences.userPrefs.replaceSameBuilds?"True":"False");

        if(zipName != "MISSING" && preferences.userPrefs.dSYMBuild)
        {
            Debug.Log("AutoPilot: dSYM found, zipping for upload");
            args += " -F dsym=@'"+zipName+"'";
        }

        args += " --silent"
                + " --write-out '\n%{http_code}'"
                + " --show-error";

        Debug.Log("Autopilot uploading: "+filename+" "+args);
        return StartProcess(filename, args, true);
    }
示例#16
0
    public static void PreBuildPlayer(TestFlightPreferences preferences)
    {
        // If testflight isn't installed... but it's in the Plugins/iOS folder. Install it from there.
        if(!IsTestFlightSDKInstalled() && HasPro() &&
           (File.Exists("Assets/Plugins/iOS/TestFlight.h")
            || File.Exists("Assets/Plugins/iOS/libTestFlight.a") ) )
        {
            InstallSDKFrom("Assets/Plugins/iOS");
        }

        // enable the SDK if in use
        UpdateSDKEnabledInBuild();
    }
示例#17
0
    public static void PostBuildPlayer(TestFlightPreferences preferences, bool buildResult)
    {
        // Tell them we're using the SDK
        if(IsTestFlightSDKInstalled() && preferences.userPrefs.testFlightSDKEmbedType != TestFlightSDKEmbedType.DontAddTestflightSDK)
        {
            string type = "";
            if(preferences.userPrefs.testFlightSDKEmbedType == TestFlightSDKEmbedType.ForTestflightTesters)
                type =  "TestFlight Testers";
            else
                type = "TestFlight Live! & App Store submission.";

            for(int i=0; i<100; ++i)
            {
                EditorUtility.DisplayProgressBar("Embedding Testflight SDK!", "Configuring Xcode project for "+ type, (float)i/100);
                System.Threading.Thread.Sleep(1);
            }
            System.Threading.Thread.Sleep(300);
            EditorUtility.ClearProgressBar();
        }

        // if we're running pro, inject the SDK
        ApplyTestflightSDKSettingToXcodeProject(preferences);
    }
 public static void DrawSubUserSettings(TestFlightPreferences preferences, ref bool showUserLists, bool narrow, TestFlightMobileProvision[] availableProvisions, TestFlightXCodeSchemas availableSchemas, string[] availableIdentities)
 {
     DrawSubUserSettings_TestFlightUpload(preferences, ref showUserLists);
     DrawSubUserSettingsForIPA(preferences, narrow, availableProvisions, availableSchemas,availableIdentities);
 }
示例#19
0
 public static void DoIPABuild(TestFlightPreferences preferences, bool buildPlayer)
 {
     DoBuild("", buildPlayer, true, preferences);
 }
示例#20
0
    public static System.Diagnostics.Process BuildIPA(TestFlightPreferences preferences, string forceOutputPath)
    {
        //
        // FIXME: strip invalid characters from the product name
        //
        string searchPath = preferences.teamPrefs.OutputPath;
        string appPath = FindBuiltAppName(searchPath);

        while(!Directory.Exists(appPath))
        {
            string s = string.Format("Autopilot couldn't find your built .app at the following path:\n{0}\n\nPlease locate the .app to continue.\n\nContact the developer ([email protected]) if this happens often.", searchPath);
            if(!EditorUtility.DisplayDialog("AutoPilot: Whoops!", s, "Find file...", "Abort"))
            {
                Debug.Log("AutoPilot: User aborted");
                return null;
            }

            searchPath = EditorUtility.OpenFolderPanel("Locate folder containing your .app", preferences.teamPrefs.buildPath, ".app");

            if(searchPath.Length == 0)
            {
                Debug.Log("AutoPilot: User aborted");
                return null;
            }

            appPath = FindBuiltAppName(searchPath);
        }

        string outputPath = "";
        if(forceOutputPath.Length > 0)
        {
            new FileInfo(forceOutputPath).Directory.Create();
            outputPath = forceOutputPath;
        }
        else
        {
            Directory.CreateDirectory(preferences.teamPrefs.OutputPath);
            outputPath = Path.GetFullPath(preferences.teamPrefs.OutputPath+Path.GetFileNameWithoutExtension(appPath)+".ipa");
        }

        // delete the IPA if it exists
        System.IO.FileInfo fi = new System.IO.FileInfo(outputPath);
        if(fi.Exists)
        {
            fi.Delete();
        }

        // build
        string filename = "xcrun";
        string args     = "-sdk iphoneos"
                 	    +" PackageApplication"
                        + " -v '"+appPath+"'"
                        + " -o '"+Path.GetFullPath(outputPath)+"'";

        Debug.Log("Autopilot packaging IPA: "+filename+" "+args);
        return StartProcess(filename, args, false);
    }
    public void OnEnable()
    {
        preferences = TestFlightPreferences.Load();
        logoTex = TestFlightResources.GetTextureResource("logo_small.png");
        title = "AutoPilot Preferences";

        allProvisions = TestFlightMobileProvision.EnumerateProvisions();
        allSchemas = TestFlightXCodeSchemas.Enumerate(preferences.teamPrefs.buildPath);
        allIdentities = TestFlightDeveloperIdentities.Enumerate();
    }
示例#22
0
    public static bool BuildPlayerIOS(TestFlightPreferences preferences)
    {
        PreBuildPlayer(preferences);

        bool buildResult = BuildPlayer(BuildTarget.iPhone, preferences.teamPrefs.buildPath, false);

        return buildResult;
    }
 private static void DrawSubUserSettings_dSYM(TestFlightPreferences preferences, bool narrow)
 {
     preferences.userPrefs.dSYMBuild = Toggle(new GUIContent ("Build & include dSYM", "Builds symbols for this project.\nThis makes the bundle size significantly larger but can greatly increase the detail in TestFlight's crash reports.\n\nNote: even with a dSYM many crashes won't be reported if 'Fast but no exceptions' has been set in iPhone settings"), preferences.userPrefs.dSYMBuild);
 }
示例#24
0
 public static System.Diagnostics.Process BuildIPA(TestFlightPreferences preferences)
 {
     return BuildIPA(preferences, "");
 }