YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Getting Started with coding for Jolla Sailfish OS

Artem Marchenko

@AgileArtem

22.02.2014, Tampere, Finland

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 2: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Today

• Quick start on emulator

– And how to run on device

• Structure of the build process and artifacts

• Packaging for app store

• Troubleshooting / debugging

• Support channels and further questions

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 3: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

QUICK START

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 4: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Preparing SDK

1. Install SDK https://sailfishos.org/develop.html2. Run its Updater ( Help -> Start Updater)3. Get HelloWorld Pro from

https://github.com/amarchen/helloworld-pro-sailfish and open it (you need a project for Updating part of SDK)– Configure for all available platforms

4. Rename project into harbour-my-great-app via rename-to-my-project.sh

5. Start Mer build machine (can take a couple of clicks)

6. Install more updates via Sailfish OS tab

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 5: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Starting app on emulator

• Set i486 platform as active

• Deploy as RPM

• Run subproject src

22.02.14

Page 6: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Start emulator and app

22.02.14

Page 7: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Running tests on emulator

• Run /usr/share/tst-

harbour-my-

great-

app/runTestsOnD

evice.sh

– As README.md says

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 8: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Connecting device• https://sailfishos.org/develop-firstapp-article.html covers it

well– Works fine on WiFi– Couldn’t make it work via USB

22.02.14@AgileArtemhttp://www.codingsubmarine.co

m

Page 9: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Then run on device

• Same as on emulator

• Just don’t forget to select armv7 platform

22.02.14

Page 10: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Continue in QML

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 11: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

STRUCTURE OF THE BUILD PROCESS

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 12: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Project directoriesYour PC

Mer build

machine

Jolla device/

emulator

/Users/artem/

projects/great-app//home/mersdk/

projects/great-app/

/home/mersdk/

projects/build-great-

app-MerSDK.../

/home/deploy/

installroot/usr/share/

harbour-great-app/...

/home/deploy/

installroot/usr/bin/

harbour-great-app

/usr/bin/harbour-

great-app

/usr/share/harbour-

great-app/...

Same dir

Compile

INSTALLS

phase of

qmake build

Default comes from

~/mersdk/targets/Sailfish.../usr/

share/qt5/mkspecs/

features/sailfishapp.prf

RPM package

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 13: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Building-packaging

harbour-great-

app.yaml

gstreamer-devel

libresourceqt5

sailfishapp

Build-time

dependencies

libsailfishapp

Runtime

dependencies

/usr/bin/harbour-great-app

/usr/share/icons/...

/usr/share/harbour-great-app/..Files in main

package

harbour-great-

app-tests

subpackage

/usr/bin/tst-harbour-great-app

/usr/share/tst-harbour-great-app/...

harbour-great-

app-fake

subpackage

Garbage other packages

don't need

great-app.pro

source files

resources

harbour-great-

app.spec

Extra detais

Tell we are not

requiring/providing

anything not allowed

Pass QMake vars

E.g. version number

Or dir with platform-specific

resources

for bundling into app

/home/deploy/installroot/

usr/bin/harbour-great-app

...on Mer build machine

INSTALLS

harbour-great-app-0.1-1.armv7hl.rpm

harbour-great-app-test-0.1-1.armv7hl.rpm

harbour-great-app-fake-0.1-1.armv7hl.rpmRPM packaging

To App Store!

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 14: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

PACKAGING FOR APP STORE

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 15: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Build RPM package

1. Choose ARMV7 platform

2. *Clean* not to package i486 binaries

3. Deploy RPM

22.02.14

Page 16: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Validate

Page 17: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Submit to harbour

• http://harbour.jolla.com

• Icon templates can be found at https://sailfishos.org/apps_icons.html

– As mentioned in README.md

• You’ll need screenshots

– Use Screenshot or SailshotMe app on device

– Upload to Dropbox via Sailbox app

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 18: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

TROUBLESHOOTING DEPLOYMENTS

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 19: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Troubleshooting failed deployments and not runnable apps

• Examine the content of the Mer machine and emulator directories. And device too if you need

• Is covered well at https://sailfishos.org/develop-faq.html

• Mer: ssh -p 2222 -i~/SailfishOS/vmshare/ssh/private_keys/engine/root root@localhost

• Emulator: ssh -p 2223 -i~/SailfishOS/vmshare/ssh/private_keys/SailfishOS_Emulator/root root@localhost

• Real device: ssh [email protected]– Address and password from the Developer Settings

on device

22.02.14@AgileArtem

http://www.codingsubmarine.com

Page 20: Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland

Debugging

• C++ debugging doesn’t work from IDE

• If you comfortable with GDB, it is supposed to work

• Rumors tell that QML debugging does

– I failed to get it working

• Use logging

• Use automated tests

22.02.14@AgileArtem

http://www.codingsubmarine.com


Related Documents