B4J Tutorial [Tool] MacStorePackager - publish your App to the Mac AppStore

JanPRO

Well-Known Member
Licensed User
In this tutorial, I want to show you, how you can upload your Java Application to the Mac AppStore.
Here you can find a test Application in the Store.

Requirements:
  • MacOS (tested with version 10.13.3)
  • Apple Developer Account
  • Java JDK (recommended: JDK 9)
  • Xcode + Developer Tools

Video:


Before we can upload our App to the AppStore, we have to prepare some things:

Step 1: Create a new AppID:
  1. Login to your Apple Developer account and go to the Certificates, ID & Profiles section
  2. Choose macOS in the ChoiceBox at the top
  3. Go to the App ID’s section under identifiers
  4. Click on the + Button to create a new App ID
  5. Fill in the description field
  6. Under App ID Suffix, choose Explicit App ID and enter your package name (the package name, you have set in B4J under Projects --> Build Configuration --> Package)
  7. Click on Continue
  8. Click on Register

Step 2: Create a new App in iTunes Connect
  1. Go to iTunesConnect and click on My Apps
  2. Click on the + Button at the top and choose New Mac-App
  3. Fill in all fields, use the Bundle-ID we have created in Step 1.
  4. Click on the Create button
Note 1: You can’t remove Apps from iTunes Connect after you have added them


Step 3: Create and download certificates
  1. Open Xcode
  2. Click on Xcode --> Preferences in the MenuBar
  3. Go to the Accounts section
  4. Click on the + Button at the Bottom to add your Apple ID
  5. Fill in all fields and click on Sign In
  6. Select your Account and click on the Manage Certificates Button
  7. Click on the + Button at the Bottom and choose macOS App Store
  8. Click again on the + Button and choose macOS App Store Installer
  9. Now you can close Xcode
Now we have everything we need to create our package for the AppStore.
Next Steps:

Step 4: Create the package
  1. Download the StorePackager (for VM: http://bit.ly/2utzAgH) application (v. 1.0.1, created with B4J)
  2. Fill in all fields.
  3. Click on Next
  4. Set the entitlements of your App, for example when it uses Bluetooth. For more information click on the info button
  5. Click on Next
  6. Now you have to set the App category. For more information click on the info button
  7. Click on Create
  8. After StorePackager has finished, you will find the package on your desktop
Note 1: if you your icon is a png file, StorePackage will automatically resize it. The minimum dimension of the png is 1024x1024. If you are using .icns, be sure you have included all necessary formats (http://iconhandbook.co.uk/reference/chart/osx/)

Note 2: The root password is needed to have the permission to edit the bundle identifier of the Java info.plist, this prevents a CFBundleIndentifier Collision


Step 5: Upload the package
  1. Open Application Loader
  2. SignIn
  3. Click on Deliver your App
  4. Choose the package (.pkg) from your desktop
  5. Click to the next site and wait til the upload finishes

Congratulations! Now you have successfully upload your App to iTunes Connect. The last thing to do now is fill in all fields for the App Store listing and finally submit your App for the review.


Feel free to ask questions ;)
 
Last edited:

tufanv

Expert
Licensed User
Dear Jan,

I am trying to upload an app but having a problem at this :

  1. Select your Account and click on the Manage Certificates Button
  2. Click on the + Button at the Bottom and choose macOS App Store
  3. Click again on the + Button and choose macOS App Store Installer
  4. Now you can close Xcode
I had already added my account , my mail is visible there. There is no manage dcertificates at account page , there is a button to download crtificates but i cant find manage certificates.

Can it be related to xcode version ?

In this tutorial, I want to show you, how you can upload your Java Application to the Mac AppStore.
Here you can find a test Application in the Store.

Requirements:
  • MacOS (tested with version 10.12.5)
  • Apple Developer Account
  • Java JDK
  • Xcode + Developer Tools

Video:


Before we can upload our App to the AppStore, we have to prepare some things:

Step 1: Create a new AppID:
  1. Login to your Apple Developer account and go to the Certificates, ID & Profiles section
  2. Choose macOS in the ChoiceBox at the top
  3. Go to the App ID’s section under identifiers
  4. Click on the + Button to create a new App ID
  5. Fill in the description field
  6. Under App ID Suffix, choose Explicit App ID and enter your package name (the package name, you have set in B4J under Projects --> Build Configuration --> Package)
  7. Click on Continue
  8. Click on Register

Step 2: Create a new App in iTunes Connect
  1. Go to iTunesConnect and click on My Apps
  2. Click on the + Button at the top and choose New Mac-App
  3. Fill in all fields, use the Bundle-ID we have created in Step 1.
  4. Click on the Create button
Note 1: You can’t remove Apps from iTunes Connect after you have added them


Step 3: Create and download certificates
  1. Open Xcode
  2. Click on Xcode --> Preferences in the MenuBar
  3. Go to the Accounts section
  4. Click on the + Button at the Bottom to add your Apple ID
  5. Fill in all fields and click on Sign In
  6. Select your Account and click on the Manage Certificates Button
  7. Click on the + Button at the Bottom and choose macOS App Store
  8. Click again on the + Button and choose macOS App Store Installer
  9. Now you can close Xcode
Now we have everything we need to create our package for the AppStore.
Next Steps:

Step 4: Create the package
  1. Download the StorePackager application (v. 1.0 beta, created with B4J)
  2. Fill in all fields.
  3. Click on Next
  4. Set the entitlements of your App, for example when it uses Bluetooth. For more information click on the info button
  5. Click on Next
  6. Now you have to set the App category. For more information click on the info button
  7. Click on Create
  8. After StorePackager has finished, you will find the package on your desktop
Note 1: if you your icon is a png file, StorePackage will automatically resize it. The minimum dimension of the png is 1024x1024. If you are using .icns, be sure you have included all necessary formats (http://iconhandbook.co.uk/reference/chart/osx/)

Note 2: The root password is needed to have the permission to edit the bundle identifier of the Java info.plist, this prevents a CFBundleIndentifier Collision


Step 5: Upload the package
  1. Open Application Loader
  2. SignIn
  3. Click on Deliver your App
  4. Choose the package (.pkg) from your desktop
  5. Click to the next site and wait til the upload finishes

Congratulations! Now you have successfully upload your App to iTunes Connect. The last thing to do now is fill in all fields for the App Store listing and finally submit your App for the review.


Feel free to ask questions ;)
 

tufanv

Expert
Licensed User
Hi,

Possible, you should use Xcode 8.
But probably your are in the wrong preferences, can you send me a screenshot?

Jan
sure sending in 10 minutes. I also use xcode 8 so i think ı am making a mistake. I will post ss here.
 

JanPRO

Well-Known Member
Licensed User
Not sure why your preferences looks different.
But you should do the following:

1. Click on View Details
2. Click on the Create Button next to "Mac App Distribution"
3. Click on the Create Button next to "Mac Installer Distribution"
4. Click the Done button

Jan
 

tufanv

Expert
Licensed User
Not sure why your preferences looks different.
But you should do the following:

1. Click on View Details
2. Click on the Create Button next to "Mac App Distribution"
3. Click on the Create Button next to "Mac Installer Distribution"
4. Click the Done button

Jan
I have aother problem at the next step.

I always get error when opening storepackager. I hae the jdk installed :

 

JanPRO

Well-Known Member
Licensed User
Hi,
sorry, I should have written this earlier, but we already find out the reason for this issue:

Tufanv uses a virtual mac and in general, it's not possible to run Java ui apps in a vm. However command line apps will work fine, so I will create a small webapp as a solution.

Jan
 

tufanv

Expert
Licensed User
Hi,
sorry, I should have written this earlier, but we already find out the reason for this issue:

Tufanv uses a virtual mac and in general, it's not possible to run Java ui apps in a vm. However command line apps will work fine, so I will create a small webapp as a solution.

Jan
Thanks Jan for your help with the webapp , do you have an estimated time for releasing the webapp ?
 

JanPRO

Well-Known Member
Licensed User
Hi,

here you can find the webapp.
Start the jar with a specific port, for example:
B4X:
java -jar StorePackagerVM.jar 51042
The browser will automatically navigate to the app.

The only difference to the normal app is the missing FileChooser for the jar and icon (due to browser security aspects). But you can just drag and drop the file to the textfield ;)

Jan
 

tufanv

Expert
Licensed User
Hi,

here you can find the webapp.
Start the jar with a specific port, for example:
B4X:
java -jar StorePackagerVM.jar 51042
The browser will automatically navigate to the app.

The only difference to the normal app is the missing FileChooser for the jar and icon (due to browser security aspects). But you can just drag and drop the file to the textfield ;)

Jan
Perfect Jan !! I will try to continue uploading my app and report back here ! Thanks very much
 

ilan

Expert
Licensed User
congratulations Tufanv, great Job!
i will definitely make some MacOS Apps in the future but first need to finish my b4i game :)

anyway, @Erel i really think this Tutorial should be a sticky thread so we wont loose it if new tutorials will arrive!
 
Last edited:

Erel

Administrator
Staff member
Licensed User
Top