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

Discussion in 'B4J Tutorials' started by JanPRO, Jul 1, 2017.

  1. JanPRO

    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: Jan 25, 2018
  2. Erel

    Erel Administrator Staff Member Licensed User

    Thank you for sharing this valuable information!

    I've installed your app from iTunes :)
     
    JanPRO likes this.
  3. ilan

    ilan Expert Licensed User

    @JanPRO you are awesome!! thank you very much for that!!! :)
     
  4. tufanv

    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 ?

     
  5. JanPRO

    JanPRO Well-Known Member Licensed User

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

    Jan
     
  6. tufanv

    tufanv Expert Licensed User

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

    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 likes this.
  8. tufanv

    tufanv Expert Licensed User

    Did it now thanks Jan . I will continue with the tutorial
     
  9. tufanv

    tufanv Expert Licensed User

    I have aother problem at the next step.

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

    [​IMG]
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    1. Try to update to the latest Java JDK.
    2. Run it from the command line with java -jar to see the full logs.
     
    tufanv and JanPRO like this.
  11. JanPRO

    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 likes this.
  12. tufanv

    tufanv Expert Licensed User

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

    JanPRO Well-Known Member Licensed User

    Hi,

    yesterday I came back from vacation, so I have not started yet with the webapp. But probably this evening or tomorrow morning when everything works fine.

    Jan
     
    ilan and tufanv like this.
  14. tufanv

    tufanv Expert Licensed User

    Thnaks very much !
     
  15. JanPRO

    JanPRO Well-Known Member Licensed User

    Hi,

    here you can find the webapp.
    Start the jar with a specific port, for example:
    Code:
    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 and Erel like this.
  16. tufanv

    tufanv Expert Licensed User

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

    tufanv Expert Licensed User

    Thanks for the great tool @JanPRO

    I have submitted my app to macstore. Let's see what will happen :)
     
    Erel likes this.
  18. tufanv

    tufanv Expert Licensed User

  19. ilan

    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: Jul 28, 2017
    JanPRO and tufanv like this.
  20. Erel

    Erel Administrator Staff Member Licensed User

    DonManfred likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice