Getting started with coding for Jolla Sailfish OS. 22 Feb 2014, Tampere, Finland
-
Upload
artem-marchenko -
Category
Technology
-
view
1.884 -
download
3
description
Transcript of 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
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
QUICK START
22.02.14@AgileArtem
http://www.codingsubmarine.com
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
Starting app on emulator
• Set i486 platform as active
• Deploy as RPM
• Run subproject src
22.02.14
Start emulator and app
22.02.14
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
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
Then run on device
• Same as on emulator
• Just don’t forget to select armv7 platform
22.02.14
Continue in QML
22.02.14@AgileArtem
http://www.codingsubmarine.com
STRUCTURE OF THE BUILD PROCESS
22.02.14@AgileArtem
http://www.codingsubmarine.com
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
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
PACKAGING FOR APP STORE
22.02.14@AgileArtem
http://www.codingsubmarine.com
Build RPM package
1. Choose ARMV7 platform
2. *Clean* not to package i486 binaries
3. Deploy RPM
22.02.14
Validate
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
TROUBLESHOOTING DEPLOYMENTS
22.02.14@AgileArtem
http://www.codingsubmarine.com
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
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
Getting support and further questions
• IRC: #sailfishos on freenode(irc.freenode.net)
• This slideset –http://www.codingsubmarine.com/classes/2014-Tampere-Feb
• @AgileArtem on twitter
22.02.14@AgileArtem
http://www.codingsubmarine.com