[profiler] Pass arguments to app on launch.

This commit is contained in:
Eloy Durán
2013-10-31 17:50:47 +01:00
parent 61e9a65534
commit 19e9bddef3
3 changed files with 6 additions and 7 deletions

View File

@@ -212,7 +212,7 @@ end
namespace :profile do
desc "Run a build on the simulator through Instruments"
task :simulator => 'build:simulator' do
plist = App.config.profiler_config_plist('iPhoneSimulator')
plist = App.config.profiler_config_plist('iPhoneSimulator', ENV['args'])
plist['com.apple.xcode.simulatedDeviceFamily'] = App.config.device_family_ints.first
plist['com.apple.xcode.SDKPath'] = App.config.sdk('iPhoneSimulator')
plist['optionalData']['launchOptions']['architectureType'] = 0
@@ -231,7 +231,7 @@ namespace :profile do
App.fail 'Unable to determine remote app path'
end
plist = App.config.profiler_config_plist('iPhoneOS')
plist = App.config.profiler_config_plist('iPhoneOS', ENV['args'])
plist['absolutePathOfLaunchable'] = File.join($deployed_app_path, App.config.bundle_name)
plist['deviceIdentifier'] = (ENV['id'] or App.config.device_id)
plist['environmentEntries'] = {}

View File

@@ -98,7 +98,6 @@ end
# TODO change to singular build task for development and release.
desc "Run a build on the simulator through Instruments"
task :profile => 'build:development' do
plist = App.config.profiler_config_plist('MacOSX')
plist['argumentEntries'] = '-NSDocumentRevisionsDebugMode YES' # Xcode default
plist = App.config.profiler_config_plist('MacOSX', "-NSDocumentRevisionsDebugMode YES #{ENV['args']}")
App.profile('MacOSX', plist)
end

View File

@@ -278,14 +278,14 @@ EOS
end
# TODO
# * add launch args and env vars from user
# * add env vars from user
# * add optional Instruments template to use?
def profiler_config_plist(platform)
def profiler_config_plist(platform, args)
working_dir = File.expand_path(versionized_build_dir(platform))
{
'CFBundleIdentifier' => identifier,
'absolutePathOfLaunchable' => File.expand_path(app_bundle_executable(platform)),
'argumentEntries' => '',
'argumentEntries' => (args or ''),
'workingDirectory' => working_dir,
'workspacePath' => '', # Normally: /path/to/Project.xcodeproj/project.xcworkspace
'environmentEntries' => {