Fwd: [vwnc] Publishing an app to apple store : the full script !

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fwd: [vwnc] Publishing an app to apple store : the full script !

abergel
Hello!

Here is a procedure to submit a VisualWorks application on AppStore.
Maybe it can be adapted for Pharo?

Cheers,
Alexandre


Begin forwarded message:

From: Annick Fron <[hidden email]>
Subject: [vwnc] Publishing an app to apple store : the full script !
Date: July 15, 2016 at 3:30:20 PM GMT+2
To: vwnc NC <[hidden email]>
Cc: Annick Fron <[hidden email]>
Reply-To: Annick Fron <[hidden email]>

Hi,


Besides Maarten’s package to publish on applestore, here is a more condensed procedure describing the process.

Summary of needed actions to publish an application to applestore 


Note : You can use the nano editor to edit system files using « nano" my file to ensure you stick to pure text format

- 1) Enroll as a developer on developer.apple.com
- 2) Generate certificates : Developer id; 3rd party application installer
- 3) Download certificates together with middle certificates from Apple (to complete the CA chain)
- 4) Check availability of certificates in keychain utility, and avoid certificates duplicated in session and system tabs
- 5) Generate one or more application ids in apple developer web site (in the following the app id will be com.fencingfox.saintgeorges)

- 6) Copy visual.app in a directory and rename it
- 7) Thin visual and its Frameworks components to architecture i386

cd myapp.app/Contents
cd MacOS
lipo visual -thin i386 -output visual
cd ../Frameworks
lipo libcairo.2.dylib -thin i386 -output libcairo.2.dylib
lipo libpixman-1.0.dylib -thin i386 -output libpixman-1.0.dylib
lipo libpng15.0.dylib -thin i386 -output libpng15.0.dylib

Check it
lipo - info visual

- 8) Edit myapp.app/Contents/Info.plist . To do that download Xcode, create a workspace, import the file myapp.app.
Modify Bundle identifier with one of the application ids you have crated on Apple Developers’ site, define application category, bundle version without any letter


- 9) Edit localizations subdirectories  under Contents/Resources/English.lproj (resp. French.lproj), etc. Modify the MainMenu.nib under Xcode.

- 10) Modify the icons MainIcons.icns in Contents/Resources using various tools. In case of problems you may use the following trick :
ICON_OLD=icon.icns
ICON_NEW=icon_new.icns
iconutil -c iconset -o "${ICON_OLD%.icns}.iconset" "$ICON_OLD"
iconutil -c icns -o "$ICON_NEW" "${ICON_OLD%.icns}.iconset"

-11) Copy your image.im to myapp.app/Contents/Resources/resource.im

- 12) Ensure everything is readable by all :
chmod -R a+r myapp.app
- 13) Ensure dylibs and visual have executable rights for all (chmod 555 visual).


- 14) Optional step : sign the components located in myapp.app/Contents/Frameworks with your developer Id certificate

codesign -s "Developer ID Application: Annick Fron (XXXXXXXXXX)" -v ./SaintGeorges.app/Contents/Frameworks/libcairo.2.dylib
codesign -s "Developer ID Application: Annick Fron (XXXXXXXXXX)" -v ./SaintGeorges.app/Contents/Frameworks/libpixman-1.0.dylib
codesign -s "Developer ID Application: Annick Fron (XXXXXXXXXX)" -v ./SaintGeorges.app/Contents/Frameworks/libpng15.0.dylib

- 15) Sign the app

codesign --entitlements ./sg.entitlements -s "Developer ID Application: Annick Fron (XXXXXXXXXX)" -v ./SaintGeorges.app

with for instance the following entitlements file (allows for networking)
sg.entitlements
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.device.usb</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.print</key>
<true/>
</dict>
</plist>

- 16) Create an installer
Create a component list :

pkgbuild --analyze --root ./SaintGeorges.app SaintGeorgesComponents.plist

Then use it
pkgbuild --root ./SaintGeorges.app --component-plist SaintGeorgesComponents.plist --identifier "com.fencingfox.saintgeorges" --install-location "/" ./SaintGeorges.pkg

You can also use Packages

- 17) Create and sign an archive
productbuild \
 --distribution distribution.plist \
 --resources . \
 --sign "3rd Party Mac Developer Installer: Annick Fron (XXXXXXXXXX)" \
 --package-path ./SaintGeorges.pkg \
 SaintGeorgesFinal.pkg


using for instance the following distribution.plist file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="2">
    <pkg-ref id="com.fencingfox.saintgeorges"/>
    <options customize="never" require-scripts="false"/>
    <volume-check>
        <allowed-os-versions>
            <os-version min="10.9"/>
        </allowed-os-versions>
    </volume-check>
    <choices-outline>
        <line choice="default">
            <line choice="com.fencingfox.saintgeorges"/>
        </line>
    </choices-outline>
    <choice id="default"/>
    <choice id="com.fencingfox.saintgeorges" visible="false">
        <pkg-ref id="com.fencingfox.saintgeorges"/>
    </choice>
    <pkg-ref id="com.fencingfox.saintgeorges" version="0" onConclusion="none">SaintGeorges.pkg</pkg-ref>

- 18) Generate the product
productbuild --sign "3rd Party Mac Developer Installer: Annick Fron (XXXXXXXXXX)" --component SaintGeorges.app /Applications SaintGeorgesFinal.pkg --product ./requirements.plist 

using for instance the following empty requirements.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>os</key>
<array>
</array>
</dict>
</plist>



- 19) From you Apple developer account connect to itunesconnect and describe your product

- 20) Upload your final package.pkg using ApplicationLoader launched from Xcode menu/Open Developer Tool (double click on the empty zone to upload)

Enjoy !

Annick Fron



-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.