SlideShare a Scribd company logo
1 of 30
Download to read offline
App Thinning
Neo
Outline
What’s App Thinning in iOS 9
Slicing (iOS)
Bitcode
On-demand Resources
What’s App Thinning
New feature in iOS and watchOS
According to variant devices to optimize App
App size
Efficiency
Spacing
Minimal footprint
Three components of App thinning
Slicing
Bitcode
On-demand resources
Slicing (iOS)
Slicing is the process of creating and delivering
variants of the app bundle for different target
devices.
App always have
universal resource,
and that’s very fat.
Slicing (iOS)
Slicing can export
variant of the App
bundle
Slicing (iOS)
How to use the capability
Just one additional step during run or distributing App.
After completed the step, developer can export variant of app bundle to
test, or run on simulator.
Slicing (iOS)
The step can help you
Specific App bundle resource for variant of devices to reduce App size. 

Ex: iPhone 6 plus will only download the App bundle of ARM 64 bit
architecture @3x image resource.
The most important
Slicing is only supported on latest iTunes and iOS 9.0 or later
Image resource must establishes on asset catalogs
If image resources come from external asset, make a simple folder
structure and JSON markup
Slicing (iOS)
Using asset catalogs to adapt slicing
Slicing (iOS)
Using custom folder to adapt slicing
Simple folder structure, just like Xcode asset but must have JSON
markup
Place any resource within xcasset folder reference
Slicing (iOS)
Must included JSON 

Markup to tell system 

how to retrieve image
Slicing (iOS)
“Bitcode is an intermediate representation of a compiled
program.” - App Distribution Guide
It is the same as byte code, but compiled by llvm.
Sent it to Apple which allow Apple to re-optimize you App without new
version App
In iOS is default but optional, but required in watchOS.
Bitcode (iOS, watchOS)
On-Demand Resources (iOS)
On-demand resources are that separated App
resources and hosted on Apple servers.
Download what user needs to download
More space efficiency
Remove resources when they are no

longer needed and disk space is low
Work transparently in the background
Ex: A game App
On-Demand Resources (iOS)
On-Demand Resources (iOS)
On-Demand Resources (iOS)
On-Demand Resources (iOS)
What type of resources can be on-demand
On-Demand Resource Size Limits
On-Demand Resources (iOS)
Setting up On-Demand Resources
https://developer.apple.com/library/prerelease/ios/documentation/
FileManagement/Conceptual/On_Demand_Resources_Guide/
index.html#//apple_ref/doc/uid/TP40015083-CH2-SW1
Using NSBundleResourceRequest to manage On-
Demand Resource
Request access to on demain resource
Update the priority of a download
Track the progress of a download
Notifying the OS when access is no longer needed
Check for a notification of low disk space
On-Demand Resources (iOS)
Request access to on demain resource
Tags of one App Bundle is managed by one instance of
NSBundleResourceRequest
Request resources before user need (ex: In game, load stage 2 in stage 1)
Step1 - Initial NSBundleResourceRequest
On-Demand Resources (iOS)
Step2 - Requesting access to the on-demand resources
Download the resources from the App store

a. error == nil (downloaded successfully)

b. callback is not at main thread

Does not download the resources

a. only check resources available in local

b. resourceAvailable = NO (resources are not ready)
On-Demand Resources (iOS)
On-Demand Resources (iOS)
Update the priority of a download
Change priority to ensure OS resources - App performance
Priority can be changed any time, including during the download.
Track the progress of a download
On-Demand Resources (iOS)
Pausing and Canceling
On-Demand Resources (iOS)
Notifying the OS when access is no longer needed
When resources end access, allow the OS to release the storage on the
device
Two way end access

1. Send endAccessingResources

2. Deallocate the resource request
On-Demand Resources (iOS)
Setting Preservation Priority
OS will purge tags from lowest preservation priority
On-Demand Resources (iOS)
Check for a notification of low disk space
Notification send out when it is no enough space for current request
On-Demand Resources (iOS)
Debugging On-Demand Resources
Three main categories of problems: Networking connectivity, local
storage space, and Unexpected State
Check unexpected state in Xcode
On-Demand Resources (iOS)
Unexpected State list
References
WWDC 2015 Section 404 - App Thinning in
Xcode
https://developer.apple.com/videos/wwdc/2015/?id=404
App Distribution Guide
https://developer.apple.com/library/prerelease/ios/documentation/
IDEs/Conceptual/AppDistributionGuide/AppThinning/
AppThinning.html
On-Demand Resources Guide
https://developer.apple.com/library/prerelease/ios/documentation/
FileManagement/Conceptual/On_Demand_Resources_Guide/
index.html#//apple_ref/doc/uid/TP40015083
Q & A

More Related Content

Similar to App thinning

Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual Studio
Mizanur Sarker
 
Artem Сhaykin. Android Application Security.
Artem Сhaykin. Android Application Security.Artem Сhaykin. Android Application Security.
Artem Сhaykin. Android Application Security.
Positive Hack Days
 

Similar to App thinning (20)

OWASP for iOS
OWASP for iOSOWASP for iOS
OWASP for iOS
 
MSR iOS Tranining
MSR iOS TraniningMSR iOS Tranining
MSR iOS Tranining
 
WWDC 15 - Apple's Developer Event @ 8-12 June, 2015
WWDC 15 - Apple's Developer Event @ 8-12 June, 2015WWDC 15 - Apple's Developer Event @ 8-12 June, 2015
WWDC 15 - Apple's Developer Event @ 8-12 June, 2015
 
Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1
 
Calabash-iOS
Calabash-iOSCalabash-iOS
Calabash-iOS
 
iOS Application Development Step by Step to develop an iOS App.pdf
iOS Application Development Step by Step to develop an iOS App.pdfiOS Application Development Step by Step to develop an iOS App.pdf
iOS Application Development Step by Step to develop an iOS App.pdf
 
Pentesting iOS Applications
Pentesting iOS ApplicationsPentesting iOS Applications
Pentesting iOS Applications
 
Enterprise Hybrid Feasibility Analysis
Enterprise Hybrid Feasibility AnalysisEnterprise Hybrid Feasibility Analysis
Enterprise Hybrid Feasibility Analysis
 
Apps rollback patches1
Apps rollback patches1Apps rollback patches1
Apps rollback patches1
 
Ios
IosIos
Ios
 
React-Native-N3XTCODER-Arya-Workshop-April-2016
React-Native-N3XTCODER-Arya-Workshop-April-2016React-Native-N3XTCODER-Arya-Workshop-April-2016
React-Native-N3XTCODER-Arya-Workshop-April-2016
 
Android studio
Android studioAndroid studio
Android studio
 
Android session-1-sajib
Android session-1-sajibAndroid session-1-sajib
Android session-1-sajib
 
Deep Dive into the AOSP
Deep Dive into the AOSPDeep Dive into the AOSP
Deep Dive into the AOSP
 
Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual Studio
 
iphone presentation
iphone presentationiphone presentation
iphone presentation
 
Android beginners David
Android beginners DavidAndroid beginners David
Android beginners David
 
Artem Сhaykin. Android Application Security.
Artem Сhaykin. Android Application Security.Artem Сhaykin. Android Application Security.
Artem Сhaykin. Android Application Security.
 
Google Devfest 2009 Argentina - Intro to Appengine
Google Devfest 2009 Argentina - Intro to AppengineGoogle Devfest 2009 Argentina - Intro to Appengine
Google Devfest 2009 Argentina - Intro to Appengine
 
Iphone development
Iphone developmentIphone development
Iphone development
 

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Recently uploaded (20)

%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

App thinning

  • 2. Outline What’s App Thinning in iOS 9 Slicing (iOS) Bitcode On-demand Resources
  • 3. What’s App Thinning New feature in iOS and watchOS According to variant devices to optimize App App size Efficiency Spacing Minimal footprint Three components of App thinning Slicing Bitcode On-demand resources
  • 4. Slicing (iOS) Slicing is the process of creating and delivering variants of the app bundle for different target devices.
  • 5. App always have universal resource, and that’s very fat. Slicing (iOS)
  • 6. Slicing can export variant of the App bundle Slicing (iOS)
  • 7. How to use the capability Just one additional step during run or distributing App. After completed the step, developer can export variant of app bundle to test, or run on simulator. Slicing (iOS)
  • 8. The step can help you Specific App bundle resource for variant of devices to reduce App size. 
 Ex: iPhone 6 plus will only download the App bundle of ARM 64 bit architecture @3x image resource. The most important Slicing is only supported on latest iTunes and iOS 9.0 or later Image resource must establishes on asset catalogs If image resources come from external asset, make a simple folder structure and JSON markup Slicing (iOS)
  • 9. Using asset catalogs to adapt slicing Slicing (iOS)
  • 10. Using custom folder to adapt slicing Simple folder structure, just like Xcode asset but must have JSON markup Place any resource within xcasset folder reference Slicing (iOS)
  • 11. Must included JSON 
 Markup to tell system 
 how to retrieve image Slicing (iOS)
  • 12. “Bitcode is an intermediate representation of a compiled program.” - App Distribution Guide It is the same as byte code, but compiled by llvm. Sent it to Apple which allow Apple to re-optimize you App without new version App In iOS is default but optional, but required in watchOS. Bitcode (iOS, watchOS)
  • 13. On-Demand Resources (iOS) On-demand resources are that separated App resources and hosted on Apple servers. Download what user needs to download More space efficiency Remove resources when they are no
 longer needed and disk space is low Work transparently in the background Ex: A game App
  • 17. On-Demand Resources (iOS) What type of resources can be on-demand On-Demand Resource Size Limits
  • 18. On-Demand Resources (iOS) Setting up On-Demand Resources https://developer.apple.com/library/prerelease/ios/documentation/ FileManagement/Conceptual/On_Demand_Resources_Guide/ index.html#//apple_ref/doc/uid/TP40015083-CH2-SW1 Using NSBundleResourceRequest to manage On- Demand Resource Request access to on demain resource Update the priority of a download Track the progress of a download Notifying the OS when access is no longer needed Check for a notification of low disk space
  • 19. On-Demand Resources (iOS) Request access to on demain resource Tags of one App Bundle is managed by one instance of NSBundleResourceRequest Request resources before user need (ex: In game, load stage 2 in stage 1) Step1 - Initial NSBundleResourceRequest
  • 20. On-Demand Resources (iOS) Step2 - Requesting access to the on-demand resources Download the resources from the App store
 a. error == nil (downloaded successfully)
 b. callback is not at main thread
 Does not download the resources
 a. only check resources available in local
 b. resourceAvailable = NO (resources are not ready)
  • 22. On-Demand Resources (iOS) Update the priority of a download Change priority to ensure OS resources - App performance Priority can be changed any time, including during the download. Track the progress of a download
  • 24. On-Demand Resources (iOS) Notifying the OS when access is no longer needed When resources end access, allow the OS to release the storage on the device Two way end access
 1. Send endAccessingResources
 2. Deallocate the resource request
  • 25. On-Demand Resources (iOS) Setting Preservation Priority OS will purge tags from lowest preservation priority
  • 26. On-Demand Resources (iOS) Check for a notification of low disk space Notification send out when it is no enough space for current request
  • 27. On-Demand Resources (iOS) Debugging On-Demand Resources Three main categories of problems: Networking connectivity, local storage space, and Unexpected State Check unexpected state in Xcode
  • 29. References WWDC 2015 Section 404 - App Thinning in Xcode https://developer.apple.com/videos/wwdc/2015/?id=404 App Distribution Guide https://developer.apple.com/library/prerelease/ios/documentation/ IDEs/Conceptual/AppDistributionGuide/AppThinning/ AppThinning.html On-Demand Resources Guide https://developer.apple.com/library/prerelease/ios/documentation/ FileManagement/Conceptual/On_Demand_Resources_Guide/ index.html#//apple_ref/doc/uid/TP40015083
  • 30. Q & A