When performing a test using the iOS simulator, the actual app file is required.
When performing tests with each user app, either have the app file prepared by the app development representative, or generate and acquire the app from the app source code using any of steps 1 to 3 below (You cannot generate an app file from an IPA file. You cannot extract the app file from the IPA file, and run it on a simulator. ). It is possible, however, to download the App file of the Demo app provided by MagicPod.
Table of Contents
- When using Bitrise
- When using Xcode
- In case of the Cordova app
1. When using Bitrise
1-1 Bitrise Initial Setup
Bitrise is a CI service that enables you to build recent popular iOS and Android apps on the Cloud. There are a variety of CI services these days, but Bitrise has the following features.
- You can start using the free version
- It specializes in mobile app builds
- You can easily configure the build with the GUI shown below
The content of the workflow settings are stored in a file called bitrise.yml, which can be edited directly or managed on the Git repository. *1
We will start the explanation with new registration.
- Although this page discusses the procedure for iOS, it is virtually the same for Android. For the detailed Android configuration method, see CI and automated tests on Android apps with Bitrise and Magic Pod
First, let us newly register with Bitrise and perform the initial setup.
Move to the Bitrise sign-up page and register as a user.
You will receive an email entitled “Confirmation instructions” from Bitrise, so click on “Confirm My Account”.
Enter your name, etc.
User registration is complete. Move to the Start Page and click “Add new app.”
If you do this, you will be in the app build setup screen, so you can configure the build from here
The required settings are as described below.
- CHOOSE ACCOUNT:
- Specifies whether the Bitrise settings are made available to the public. You should set this to Private.
- Connect your repository:
- Setup repository access:
- If you need to access an additional, separate private Git repository, such as when using GitHub's submodule feature, configure the necessary settings with "I need to". If nothing in particular comes to mind, select “No, auto-add SSH key.”
- Choose Branch
- Specify the Git branch name to build, such as “master”.
Once you have completed the setup to this point, Bitrise will analyze the contents of the repository, and automatically create the build settings.
Here, you may see the following error message.
If you just want to perform a Magic Pod test with an iOS simulator for now, choose “Proceed anyway” to progress forward.
If you are considering a build on a real device in the near future, you should edit it properly. Following this article, set the build Scheme on Xcode to Shared, and commit the xcshareddata to the Git repository. Then, return to the Bitrise build settings, choose the “Scan another branch” item (leave the branch name as is) and resume the build settings.
Next, you will be asked to “Select ipa export method” as follows, but as these are not relevant in the case of Magic Pod Cloud tests, you can choose “ad-hoc.” *2
If are setting the app icon, click “Choose Image and Proceed” here.
If you perform the final Webhook setup, every time a change (Push or Pull request) occurs to the Git repository, a built occurs automatically. We definitely recommend choosing “Register a Webhook for me!” *3
This completes the initial setup. Finally, if you press the button in the image below, the build will start automatically.
However, it is likely that the first build will fail as shown below.
1-2 Build the iOS app for simulator with Bitrise
The first build failed because the settings required for the iOS real device build were insufficient*4. However, the step introduced this time is the build settings for the iOS simulator, so delete the settings for the real device and swap them with the settings for the simulator.
First, press the “Edit workflow” button on the build results screen to move to the build workflow edit screen.
Here, select “Xcode Archive & Export for iOS” on the left,
and press “Delete Step:Xcode Archive & Export for iOS” to delete the step.
Next, click the “+” button immediately above “Deploy to Bitrise.io - Apps, Lo...”.
and search for and add the “Xcode build for simulator” step*5.
Once you have completed up to this point, save the changes using the save button at the top-right of the screen,
and click the app name at the top of the screen to move to the build screen.
Run the build again from the “Rebuild” button on the failed build results.
The build should succeed this time.
1-3 Prepare the app file required for creating the test
Now that you are able to automatically build the app, next prepare the app file that is the simulator app entity file for creating a test using the Magic Pod Cloud device.
If you perform a simple configuration, you can download the app file built with Bitrise.
First, click the “Workflow” tab to move to the Workflow Editor screen visited just now.
Select the “Deploy to Bitrise.io - Apps, Lo...” step,
and set “$BITRISE_APP_DIR_PATH” to “Deploy directory or file path” and “Compress the artifacts into one file?” to true,
Run the build again.
After the build, click the build results “Artifacts” tab,
and download the created “magic_pod_demo_app.app.zip.”
If you do this, you can get a zip-compressed version of the app file. Then, by unzipping this file, you can acquire the app file. (If you use the zip file as is for the Magic Pod test, it will not work properly due to the folder structure, so it is necessary to unzip it first. )
2. When using Xcode
- Open the app project in Xcode (a Mac is required).
- Change the build target to the appropriate iOS simulator. ()
- Run the build. ()
- If the build succeeds, an App file shall be generated under the Products folder. ()
- If you right-click the file and select “Show in Finder,” you can open the location of the App file. () *If you are unable to find it, check /Users/○○/Library/Developer/Xcode/DerivedData/△△△△/Build/Products/Debug-iphonesimulator.
How to generate and acquire an app file
3. In case of the Cordova app
First, follow the procedure here, and install the tested iOS app on the iOS simulator with the “cordova emulate ios” command.
Once the installation is complete, start the app with the iOS simulator.
Next, open the Mac terminal and run the “ps aux | grep app name”. The app name is the same as the normal Cordova project name and partial matches are also possible.
Once the following results are found, the path to the app file should be included there, so copy and use that.
The app file entity is a directory, but on a Mac machine, this can be treated like a file.
*Notes / Sources
- Handbook for managing bitrise.yml within the repository
- This setting is the setting for building the ipa file for the iOS real device, and as we are using the iOS simulator for the Magic Pod Cloud test, we shall not build an ipa file.
- When setting up Webhook later, this can be done from the build settings “Code” tab.
- If you check the build Log, you may see the error message “No profiles for ‘***’ were found.”
- In other words, in the steps for “Do anything with Script step” and “Certificate and profile installer”, the iOS simulator build is not required on this occasion. It is just in the way, so you can delete this.