4. Best Default Worse
14
7
2
27
19
6
How Much Time? Field Service Sample
Build Time (Debug) Deploy Time
Best Default Worse
37
16
14
169
49
16
Simulator Devices
5. Building for the iOS Simulator
.dll
C#
.exe
+ =
.app
addin
mtouch
•Resolve
•Package
•Embed
mono
•Deploy
?
6. Simulator vs Emulator
• Speed Over Compatibility
• Apple Simulator Tradeoffs
Simpler, less restrictive environment
• Xamarin Simulator Tradeoffs
Just In Time (JIT) compiler
Minimize files copying (symlinks)
Shared application launcher
7. Simulator : What to Do?
best
default 7
2
19
6 Build Time
Deploy Time
• Build
Avoid optimizing PNG files
• Deploy
Keep the simulator running
8. Simulator : What to Avoid?
best
worse 14
2
27
6 Build Time
Deploy Time
• Build
Enabling the linker
Disabling the shared launcher -‐-‐nofastsim
• Deploy
Up to 12 seconds to cold start
9. Simulator : Extra Tips
• Prefer Build over Rebuild
• Avoid copying files
Access them from a single location
The sandbox is not enforced
• Use -‐time
-‐time to measure your changes
13. Devices : Build Configurations
• Debug : Keep it quick
• Release : Focus on performance
LLVM Optimizing Compiler
Optimize PNG files
• Ad-Hoc / AppStore : No tweaks!
14. Build & Deploy Symbiosis
• Deployment time is a function of the app size
• Application size versus build time?
• Link SDK is default for devices
15. Devices : What to Do?
best
default 16
14
49
16 Build Time
Deploy Time
• Build
Avoid optimizing PNG files (debug)
• Consider
Linking all assemblies --linkall
Disabling the symbols creation --dsym=false
16. Devices : What to Avoid?
best
worse 37
14
169
16 Build Time
Deploy Time
• FAT binaries (debug)
• Disabling the linker --nolink
• Disabling stripping
Symbols --nosymbolstrip
IL (release) --nostrip
17. Devices : Extra Tips
• Prefer Build over Rebuild
AOT’ed assemblies (object files) are cached
• Avoid deploying large static files (debug)
Use UIFileSharingEnabled (Info.plist)
• Use -‐time
-‐time to measure your changes
21. It’s a Matter of Time and Size
Don’t Link
Link SDK
Link All 9
10
20
21
23
89
Build Time Deploy Time
48.6 MB
11.5 MB
10.9 MB
Field
Service
Sample
Applica8on*
*
Release
build,
LLVM,
ARMv7
22. 01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
Static Analysis Limitations
...
using
FieldService.Utilities;
#if
__iOS__
using
MonoTouch.Foundation;
#elif
__ANDROID__
using
Android.Runtime;
#endif
namespace
FieldService.Data
{
///
<summary>An
assignment
is
the
"thing"
or
"job"
the
user
is
going...
#if
!MOBILE
[Preserve
(AllMembers
=
true)]
#endif
public
class
Assignment
{
...
}
24. Partially Linking Applications
• Link All and skip some assemblies
No source required
e.g. -‐-‐linkall
-‐-‐linkskip=FieldServiceiOS
• Link SDK and use [LinkerSafe] attribute
Source code required