AppleParty is an automated macOS tool developed by 37 mobile games iOS team to achieve rapid operation of App Store Connect background. This paper will introduce the background of the tool’s birth, the introduction of the use of tutorials and code implementation, hoping to share the results with everyone through open source, so that more people can participate in the improvement and improvement, and finally improve efficiency and expand exploration direction together.

One, foreword

Hi, everyone. I’m happy to tell you an important thing. We’ve launched an open source project called AppleParty. This is our team’s next attempt after the last open source App Store. The AppleParty project is a product incubated by our 37 mobile games iOS team. We hope that this project can serve as an introduction to share the results with everyone through open source, so as to improve efficiency and expand the direction of future exploration.

Ii. Project Background

At present, the iOS/macOS App on the App Store, is the only way to deal with apple, landing the App Store Connect the background (appstoreconnect.apple.com, Prepare all App information and materials for review through apple background. However, at present, the level of automation of Apple background is still at zero basis, and many repetitive operations and functions are not provided with batch processing solutions, such as:

  • Upload store screenshots and preview videos
  • Create and update in-app purchases
  • App localization metadata information configuration
  • Developer certificate creation and management
  • .

Indicators of App analysis:

  • Show the number
  • Product page view times
  • First download times
  • Net bookings
  • Platform version (iOS14.5, iOS15…)
  • Page types (product pages, store forms, in-app events…)
  • User sources (Web referral sources, App referral sources, AppStore browsing, AppStore search, event notifications…)
  • .

The above App can only download the data of one indicator at a time, and each App has more than a dozen indicators. The operation of these repeated configurations often takes a long time for the operation students, with low efficiency and repetitive boring work. As a result, we cannot spend more time to open up and enjoy creativity for a long time.

Based on the above pain points, we created the Apple Party tool from multiple technical means! By automating the process of operation as quickly as possible, thus greatly improving the operational efficiency of apple background!

Note: Apple currently provides the App Store Connect API, but the functions of the current iteration cannot meet all the requirements, which will be explained below.

2.1 Origin of the name Apple Party

Apple Party

We advocate a colorful life after work, such as fitness, travel, parties, cultivating artistic interests and so on.

  • A Party is an event where people come together to celebrate and relax.

So, Apple Party, short for: Apple pie, we hope that when you use Apple’s services, it is like an Apple Party

We hope that as you develop in the AppleOS ecosystem, you can be productive, focus on the core, and have fun!

3. Instructions for use

3.1 Noticing Events

Currently implemented functions

  • In-purchase project management (batch creation and update);
  • Bulk store map and preview video upload and update;
  • Batch download of data reports (open source);
  • Mail sending tool;
  • Qr code scanning and generation tools;

Note: Internal purchase items and store material upload only support iOS app for the time being, macOS App and tvOS App will be considered in the future.

Environment depends on

  • Supports macOS 10.13 and above
  • Rely on from the app
  • Dependent on Xcode (transporter.app dependent)

3.1 Downloading the Installation Package

We currently open source 37iOS/AppleParty on GitHub, so provide GitHub installation package:

  • AppleParty download

The update to update

Sparkle has been used to implement version updates, which are checked automatically by default when started or manually through the menu bar.

3.2 Introduction

When you open the account for the first time, you will be prompted to access the Keychain:

If you click reject, the account and password information will not be saved.

The main screen is then displayed:

By default, the login screen pops up. You can also cancel the login by pressing ESC:

The default login now requires two-factor authentication:

To use the SMS verification code, click Send SMS verification Code. To use the language verification code, select Call language.

3.2.1 Upload in-purchase items and store materials in batches

Click “My App” to display all apps of the account, and you can operate in-purchase project management and store material management.

Click internal purchase Management to display the list of existing internal purchase items:

  • Refresh: Refresh the in-app purchase item list of the current App (the item just uploaded will not take effect immediately, so you can manually refresh it)
  • Import form: Batch create in-purchase items in a fixed form
  • Export table: Export the Excel table of all item information
  • Exported item ID: table corresponding to exported item productID and purchased item ID
  • Download table sample: Sample Excel table for batch creating in-purchase items

Click “Import table”, you can select excel table to import, and then the list of imported items will be displayed.

As shown above, Listings 1 and 2 are custom submitted screenshots, so click “Upload Screenshots” in the lower right corner.

After “Submit”, the following interface will be displayed. If the special password is not set, you need to set it for the first time, or click “Set special Password” in the lower right corner to set it again.

Specific password generation reference document: Use App specific password – Apple support (China)

If the upload fails, check the ERROR content.

Batch upload

Click “material import” and upload the material in different sizes.

After uploading the video and screenshot, fill in the sort position and video poster frame:

You can click on the top right? Button to view help documentation.

3.2.2 Other extended functions

On the one hand, you can set fast email sending. On the other hand, you can set automatic email notification requirements for tool efficiency.

The QR code function is also a minor pain point at work.

Four, code implementation of simple solution

4.1 Upload in-app purchase items and store materials

I use the Transporter tool chain provided by Apple, which provides commands on the Transporter. There are three tools:

  • Xcode.app
  • Application Loader.app
  • Transporter.app

The Application Loader is deprecated and can be ignored. Transporter command all directories:

Xcode.app:

/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/itms/bin/iTMSTransporter
Copy the code

Transporter.app:

/Applications/Transporter.app/Contents/itms/bin/iTMSTransporter
Copy the code

4.1.1 Using the Transporter command

Lookup the Metadata model

Get app information and get an XXx. itmsp package, which contains XML files about app version and in-app purchase items.

iTMSTransporter -m lookupMetadata -u [user] -p [password] -apple_id(-apple_ids) -destination [output_path]
Copy the code

Example:

Obtain multiple APP information at the same time:

ITMSTransporter -m lookupMetadata -u [email protected] -p Special password -apple_ids 10 XXXX, multiple Appids, xxx-destination /Users/37/Desktop/outputCopy the code

Obtain information of a single APP:

ITMSTransporter -m lookupMetadata -u Email address -p Special password -apple_id An AppID -destination /Users/37/Desktop/outputCopy the code

The Provider model

Query the vendor, i.e. developer account name and team ID:

iTMSTransporter -m provider -u [user] -p [password]
Copy the code

Example:

ITMSTransporter -m provider -u [email protected] -p Dedicated passwordCopy the code

Output content:

Provider listing: - Long Name - - Short Name - 1 apple_dev 28PV6... 4 2 37iOSTeam R7S9... R1Copy the code

Verify Mode Verifies whether the uploaded content is valid.

iTMSTransporter -m verify -u [user] -p [password] -f [itmsp_path] [-vp ]
Copy the code

Example:

ITMSTransporter -m verify -u [email protected] - p special password - f/Users / 37 / Desktop/IAP itmspCopy the code

Upload mode Uploads content.

iTMSTransporter -m upload -u [user] -p [password] -f [itmsp_path]
Copy the code

Example:

ITMSTransporter -m upload -u [email protected] - p special password - f/Users / 37 / Desktop/IAP itmspCopy the code

Some important parameters:

  • -itc_provider: It is suggested to add the team ID of the sub-account when checking and uploading, but the test found that it is ok not to take it, because it is very troublesome to obtain
  • -errorLogs: Directory for storing error logs
  • -loghistory: Records the data packets successfully uploaded
  • -outputFormat xml: Returns output information in XML format,
  • -throughput: Displays the total transmission time, packet size, and bytes per second of successfully uploaded data packets
  • -o: Records the output information
  • -v: Log level, default eXtreme, details
  • -vp: Displays progress information when verifying or uploading packet files
  • -Xmx4096m: Specifies 4 GB of Java Virtual machine (JVM) stack memory

For details, see: Specify options and values – Transporter

You can also check the official document for details:

  • What is Transporter?
  • Transporter User Guide 2.0
  • From the help
  • App metadata specification 5.11

4.1.2 ITMSP Packet Description

From the command, you can see that we need to assemble a.itmsp folder that contains information about in-purchase items that we need to upload, screenshots submitted, or store images and preview videos.

XML configuration file for the purchased project


      
<package xmlns="http://apple.com/itunes/importer" version="software5.9">
    <provider>{team_id}</provider>
    <software>
        <vendor_id>{SKU}</vendor_id>
        <software_metadata>
            <in_app_purchases>
                <in_app_purchase>
                    <! -- Can contain letters, digits, underscores (_), and periods (.) A maximum of 255 characters -->
                    <product_id>com.app.1usd</product_id>
                    <reference_name>1ud (2 to 64 characters)</reference_name>
                    <! -- Consumable non-consumable auto-renewable renewable subscription -->
                    <type>consumable</type>
                    <products>
                        <product>
                            <cleared_for_sale>true</cleared_for_sale>
                            <wholesale_price_tier>3</wholesale_price_tier>
                        </product>
                    </products>
                    <locales>
                        <locale name="en-US">
                            <title>2 ~ 30 characters</title>
                            <description>Contains at least 10 to 45 characters</description>
                        </locale>
                        <locale name="zh-Hans">
                            <title>The value contains 2 to 30 characters</title>
                            <description>Contains at least 10 to 45 characters</description>
                        </locale>
                    </locales>
                    <review_screenshot>
                        <! -- Supported dimensions are: 1334x750, 750x1334, 1024x768, 1024x748, 768x1024, 768x1004, 2048x1536, 2048x1496, 1536x2048, 1536x2008, 2224x1668, 1668x2224, 960x640, 960x600, 640x960, 640x920, 2208x1242, 1242x2208, 2436x1125, 1125x2436, 312x390, 1136x640, 1136x600, 640x1136, 640x1096, 2732x2048, 2048x2732" -->
                        <size>636132</size>
                        <file_name>IMG_5180.PNG</file_name>
                        <checksum type="md5">xxxxx</checksum>
                    </review_screenshot>
                    <review_notes>Some notes for the Reviewer. (2~4000 characters)</review_notes>
                </in_app_purchase>
            </in_app_purchases>
        </software_metadata>
    </software>
</package>
Copy the code

XML configuration files for store images and preview videos


      
<package version="software5.10" xmlns="http://apple.com/itunes/importer">
    <provider>{provider}</provider>
    <team_id>{provider}</team_id>
    <software>
        <vendor_id>{vendor_id}</vendor_id>
        <software_metadata app_platform="{app_platform}">
            <versions>
                <version string="{app_version}">
                    <locales>
                        <locale name="{app_locale}">
                            <title>{title}</title>
                            <app_previews>
                                <app_preview display_target="{iOS - 5.5 - in}" position="{1}">
                                    <data_file role="source">
                                        <size>{video_size}</size>
                                        <file_name>{video_name}</file_name>
                                        <checksum>{video_md5}</checksum>
                                    </data_file>
                                    <preview_image_time format="30/1:1/nonDrop">{00:00:05:00}</preview_image_time>
                                </app_preview>
                            </app_previews>
                            <software_screenshots>
                                <software_screenshot display_target="{iOS - 5.5 - in}" position="{1}">
                                    <size>{image_size}</size>
                                    <file_name>{image_name}</file_name>
                                    <checksum type="md5">{image_md5}</checksum>
                                </software_screenshot>
                            </software_screenshots>
                        </locale>
                    </locales>
                </version>
            </versions>
        </software_metadata>
    </software>
</package>
Copy the code

Upload the XML configuration file for the IAP package

<? The XML version = "1.0" encoding = "utf-8"? > < package version = "software5.10" XMLNS = "http://apple.com/itunes/importer" > < software_assets apple_id = "{apple_id}" app_platform="ios"> <asset type="bundle"> <data_file> <size>{file_size}</size> <file_name>{file_name}</file_name> <checksum type="md5">{file_md5}</checksum> </data_file> </asset> </software_assets> </package>Copy the code

For detailed format, please refer to the example in the project: github.com/37iOS/Apple… . If you have any questions, please leave them in the comments section

4.2 App analyzes data and sales trends

After the release of iOS app, users search and download the app from the App Store, check the app product page, download and use the app, the number of times of app use, in-app recharge, or crash data, as well as the subsequent payment and financial statements.

This data is also very important for game operations and finance departments. It is usually viewed or downloaded in the Background of Apple, so I hope to get these data from the automatic way of Apple background.

There are three data functions in the background:

  • Analysis of the App
  • Sales and Trends
  • Payment and financial reporting (not currently in use)

Note: Payment and financial report are the amount statistics of in-app purchases and orders, which are not needed in the current export data requirements.

4.2.1 Research Report

Through investigation, the current mainstream methods are as follows:

  • App Store Connect API: REST API, download sales and Trends report (.txt file)
  • Reporter command line tool:.jar package, cross-platform, download sales and trend report (.txt file)
  • Third party open source: Fastlane-Spaceship: Ruby environment required, daily sales details (JSON data)

Corresponding documents:

  • App Store Connect API | Apple Developer Documentation
  • Reporter User Guide 3.1.6
  • Fastlane/spaceship fastlane

4.2.2 App Store Connect API

Customize and automate your workflow so you can focus on building a great app. This standards-based REST API allows you to cross developer tools such as App Store Connect, Xcode, and “Certificates,” Automate tasks and make workflows more flexible and efficient. This API can be used for development, beta testing, managing app metadata, generating reports, and more.

Sales and Download Trends report to view your app’s first downloads, sales, revenue, pre-orders, subscription activities, etc., across all Apple platforms.

Payment and Financial Reports Download monthly revenue reports by product, sales region, currency, price, etc. You can view the amount paid each month, as well as any tax adjustments or withholding taxes.

URL

GET https://api.appstoreconnect.apple.com/v1/salesReports
Copy the code

Specific request parameters and response, can view the document: Download the Sales and Trends Reports | Apple Developer Documentation

4.2.3 Reporter Command Line.

Reporter is a command line tool that can be used to download your sales and trend reports as well as payment and financial reports. You can also view information such as the error description and the estimated available time for delayed reporting. If you have multiple developer accounts using the same Apple ID, you can easily switch accounts in Reporter.

Download the Sales and trend Report Use the sales.getreport command to download the Sales and trend report.

Download financial Reports Use the finance.getreport command to download financial reports for you.

grammar

$ java -jar Reporter.jar p=[properties file] Sales.getReport [vendor number], [report type], [report subtype], [date type], [date], [version]* (if applicable)Copy the code

For specific request parameters and responses, see the documentation: Download Sales and Trend Reportreporter User Guide 3.1.6

4.2.4 Spaceship

Spaceship Exposes both the Apple Developer Center and the App Store Connect API. It’s super Fast, well tested and supports all of the operations you can do via the browser. It powers parts of fastlane, and can be leveraged for more advanced fastlane features. Scripting your Developer Center workflow has never been easier!

Spaceship exposed the Apple Developer Center and the App Store Connect API. It’s super fast, well tested, and supports everything you can do with a browser. It supports some fastlane features and can be used for more advanced Fastlane features. Scripting your developer Center workflow has never been easier!

Equivalent to a third-party encapsulation of the Apple interface, and implemented in a Ruby environment, for our automation purposes, it can be used. However, if it is instrumental, then it is not applicable, so, do not make in-depth research. Please take a look at: Spaceship · fastlane/ Fastlane.

4.2.5 crawler

The three methods introduced above do not support the acquisition and download of App analysis data. Therefore, crawler is the method with the lowest cost and feasibility in the current technical scheme.

The principle of crawler: simulate the developer to input the account password (to obtain the login status of the user), then click login, click the corresponding page label, download the corresponding data.

plan

  • Use the Python crawler library
  • Use the Swift network library

4.2.6 summary

plan advantages disadvantages Login authentication mode Degree of automation
App Store Connect API Official maintenance, interface and documentation Download not supportedAnalysis of the Appdata API keys high
Reporter command line tool Official maintenance, interface and documentation Download not supportedAnalysis of the Appdata The access token high
Fastlane – Spaceship Command automation tool Download not supportedAnalysis of the Appdata API Keys, account secret (+ verification code) In the
The crawler Apple supports everything in the background If the interface changes,

Developers need to adjust, too
Account secret (+ verification code) In the

To sum up, crawler is the fastest and most effective solution in terms of current business scenarios and business requirements. In the future, if Apple’s App Store Connect API or Reporter tool supports downloading App analytics data, then this would be a better solution. Let’s look forward to WWDC 2022!

The last

AppleParty to solve the problem is the developers have a lot of APP management, such as multi-language, frequent updates, of course, there are also needs for the game industry, such as material will be updated frequently, the purchase of items up to 100+, manual processing can not meet the display. Why not make it a command-line tool? It is hoped that the relevant tool can be handed over to operations without technical attention.

The above is a brief introduction of the AppleParty project, you can view the detailed source code at GitHub 37iOS/AppleParty. Give me a thumbs up if you think it’s good! If you have any questions or questions, please leave a message

Finally, Apple Party (Apple pie) is a new child, so there may be a lot of defects, even can not meet all the scenes, we hope you can be more excuse and understand long live, look forward to everyone to give us suggestions, propose codes, roll together!

Please follow us for more information on iOS and Apple

Special thanks to

  • Alamofire/Alamofire
  • Kitura/Swift-SMTP
  • SnapKit/SnapKit
  • sparkle-project/Sparkle
  • tid-kijyun/Kanna
  • drmohundro/SWXMLHash
  • jdg/MBProgressHUD
  • joshuajylin/MBProgressHUD-macOS
  • Yueoaix/SymbolicatorX
  • fpotter/ExpandingDatePicker
  • kishikawakatsumi/KeychainAccess

Refer to the reference

  • 37iOS/AppleParty: macOS App for App Store Connect to Improve Processing Efficiency and Enjoy the Party.
  • SwiftUI to implement an open source App Store – Nuggets
  • Apple Transporter.app
  • Use App Specific password – Apple Support (China)
  • What is Transporter?
  • Transporter User Guide 2.0
  • From the help
  • App metadata specification 5.11