mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-03-29 22:43:28 +08:00
[profiler] Pass arguments to app on launch.
This commit is contained in:
@@ -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'] = {}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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' => {
|
||||
|
||||
Reference in New Issue
Block a user