fastlane-plugin-android_emulator 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: beb865e27d0b2be0c355ddba749cc7097993f89bfae2804f6c99151eed0f013c
|
4
|
+
data.tar.gz: 9ec7938d8ccc8846b5b3404412105207c772d03151082286e3a82a7f6ab2f182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca1b197134b7bea5b817bc47678099579d4d1eb63a7aeb559cacf3546dbdb6d66029c9f0ff474ddbc363b9f50833812408d3eeb36a08be8076cfcd59df179805
|
7
|
+
data.tar.gz: 376f98f5022bc8e3194f8a6be1064dc3f100def542cc99e94f0521f0fe7788ded3ba0653e3d30e28faa3ae361893a70d4f2d77634cc45c048e1402998bb05246
|
data/README.md
CHANGED
@@ -16,22 +16,28 @@ Creates and starts a new Android Emulator (AVD)
|
|
16
16
|
|
17
17
|
With additional features:
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
- set location
|
20
|
+
- set demo-mode (great for Screengrab 😀)
|
21
21
|
|
22
22
|
## Example
|
23
23
|
|
24
|
+
**Available Options:** sdk_dir, package, name, device, port, location, demo_mode, cold_boot, additional_options
|
25
|
+
|
24
26
|
```ruby
|
25
27
|
android_emulator(
|
26
28
|
location: '9.1808 48.7771',
|
27
29
|
package: "system-images;android-24;google_apis;x86_64",
|
28
30
|
demo_mode: true,
|
29
|
-
sdk_dir: "PATH_TO_SDK"
|
31
|
+
sdk_dir: "PATH_TO_SDK",
|
32
|
+
device: "Nexus 5",
|
33
|
+
cold_boot: false,
|
34
|
+
additional_options: [
|
35
|
+
"key=value"
|
36
|
+
]
|
30
37
|
)
|
31
38
|
```
|
32
39
|
|
33
|
-
Or you can use it with our [Android SDK Update Plugin](https://github.com/NovaTecConsulting/fastlane-plugin-android_sdk_update)
|
34
|
-
|
40
|
+
Or you can use it with our [Android SDK Update Plugin](https://github.com/NovaTecConsulting/fastlane-plugin-android_sdk_update)
|
35
41
|
|
36
42
|
```ruby
|
37
43
|
ENV["AVD_PACKAGE"] = "system-images;android-24;google_apis;x86_64"
|
@@ -58,6 +64,7 @@ rake
|
|
58
64
|
```
|
59
65
|
|
60
66
|
To automatically fix many of the styling issues, use
|
67
|
+
|
61
68
|
```
|
62
69
|
rubocop -a
|
63
70
|
```
|
@@ -4,6 +4,15 @@ require_relative '../helper/android_emulator_helper'
|
|
4
4
|
module Fastlane
|
5
5
|
module Actions
|
6
6
|
class AndroidEmulatorAction < Action
|
7
|
+
def self.avd_active(params, config_file)
|
8
|
+
image = params[:package].gsub(";", "/")
|
9
|
+
if File.exist?(config_file)
|
10
|
+
return File.readlines(config_file).grep(/#{image}/).size > 0
|
11
|
+
else
|
12
|
+
return false
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
7
16
|
def self.run(params)
|
8
17
|
sdk_dir = params[:sdk_dir]
|
9
18
|
port = params[:port]
|
@@ -11,35 +20,57 @@ module Fastlane
|
|
11
20
|
|
12
21
|
UI.message("Stopping emulator")
|
13
22
|
system("#{adb} emu kill > /dev/null 2>&1 &")
|
14
|
-
sleep(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
sleep(3)
|
24
|
+
|
25
|
+
config_file = "#{Dir.home}/.android/avd/#{params[:name]}.avd/config.ini"
|
26
|
+
|
27
|
+
if !avd_active(params, config_file) || params[:cold_boot]
|
28
|
+
UI.message("Creating new emulator")
|
29
|
+
FastlaneCore::CommandExecutor.execute(
|
30
|
+
command: "#{sdk_dir}/cmdline-tools/latest/bin/avdmanager create avd -n '#{params[:name]}' -f -k '#{params[:package]}' -d '#{params[:device]}'",
|
31
|
+
print_all: true,
|
32
|
+
print_command: true
|
33
|
+
)
|
34
|
+
|
35
|
+
configuration = {}
|
36
|
+
File.readlines(config_file).each do |definition|
|
37
|
+
key, value = definition.split("=")
|
38
|
+
configuration[key.strip] = value.strip
|
39
|
+
end
|
40
|
+
|
41
|
+
UI.message("Override configuration")
|
42
|
+
additional = {
|
43
|
+
"hw.gpu.mode" => "auto",
|
44
|
+
"hw.gpu.enabled" => "yes",
|
45
|
+
"skin.dynamic" => "yes",
|
46
|
+
"skin.name" => "1080x1920"
|
47
|
+
}
|
48
|
+
|
49
|
+
if params[:additional_options]
|
50
|
+
params[:additional_options].each do |option|
|
51
|
+
key, value = option.split("=")
|
52
|
+
additional[key.strip] = value.strip
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
configuration = configuration.merge(additional)
|
57
|
+
open(config_file, 'w') do |f|
|
58
|
+
configuration.each { |key, value| f << "#{key.strip}=#{value.strip}\n" }
|
59
|
+
end
|
60
|
+
end
|
30
61
|
|
31
62
|
# Verify HAXM installed on mac
|
32
63
|
if FastlaneCore::Helper.mac?
|
33
64
|
kextstat = Actions.sh("kextstat", log: false)
|
34
65
|
|
35
|
-
UI.
|
66
|
+
UI.important("Please install the HAXM-Extension for better performance") unless kextstat.include?("intel")
|
36
67
|
end
|
37
68
|
|
38
69
|
UI.message("Starting emulator")
|
39
70
|
system("LC_NUMERIC=C; #{sdk_dir}/emulator/emulator @#{params[:name]} -port #{port} > /dev/null 2>&1 &")
|
40
71
|
sh("#{adb} -e wait-for-device")
|
41
72
|
|
42
|
-
until Actions.sh("#{adb} -e shell getprop dev.bootcomplete", log: false).strip == "1"
|
73
|
+
until Actions.sh("#{adb} -e shell getprop dev.bootcomplete", log: false).strip == "1"
|
43
74
|
sleep(5)
|
44
75
|
end
|
45
76
|
|
@@ -71,7 +102,8 @@ module Fastlane
|
|
71
102
|
location: "9.1808 48.7771",
|
72
103
|
package: "system-images;android-24;google_apis;x86_64",
|
73
104
|
demo_mode: true,
|
74
|
-
sdk_dir: "PATH_TO_SDK"
|
105
|
+
sdk_dir: "PATH_TO_SDK",
|
106
|
+
additional_options: []
|
75
107
|
)'
|
76
108
|
]
|
77
109
|
end
|
@@ -107,13 +139,25 @@ module Fastlane
|
|
107
139
|
optional: false),
|
108
140
|
FastlaneCore::ConfigItem.new(key: :location,
|
109
141
|
env_name: "AVD_LOCATION",
|
110
|
-
description: "Set location of the
|
142
|
+
description: "Set location of the emulator '<longitude> <latitude>'",
|
111
143
|
optional: true),
|
112
144
|
FastlaneCore::ConfigItem.new(key: :demo_mode,
|
113
145
|
env_name: "AVD_DEMO_MODE",
|
114
146
|
description: "Set the emulator in demo mode",
|
115
147
|
is_string: false,
|
116
|
-
default_value: true)
|
148
|
+
default_value: true),
|
149
|
+
FastlaneCore::ConfigItem.new(key: :cold_boot,
|
150
|
+
env_name: "AVD_COLD_BOOT",
|
151
|
+
description: "Create a new AVD every run",
|
152
|
+
is_string: false,
|
153
|
+
default_value: false),
|
154
|
+
FastlaneCore::ConfigItem.new(key: :additional_options,
|
155
|
+
env_name: "AVD_ADDITIONAL_OPTIONS",
|
156
|
+
description: "Set additional options of the emulation",
|
157
|
+
type: Array,
|
158
|
+
is_string: false,
|
159
|
+
optional: true)
|
160
|
+
|
117
161
|
]
|
118
162
|
end
|
119
163
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-android_emulator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Ruhl
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -136,7 +136,7 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 2.78.0
|
139
|
-
description:
|
139
|
+
description:
|
140
140
|
email: michael.ruhl@novatec-gmbh.de
|
141
141
|
executables: []
|
142
142
|
extensions: []
|
@@ -152,7 +152,7 @@ homepage: https://github.com/NovaTecConsulting/fastlane-plugin-android_emulator
|
|
152
152
|
licenses:
|
153
153
|
- MIT
|
154
154
|
metadata: {}
|
155
|
-
post_install_message:
|
155
|
+
post_install_message:
|
156
156
|
rdoc_options: []
|
157
157
|
require_paths:
|
158
158
|
- lib
|
@@ -167,9 +167,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
|
-
|
171
|
-
|
172
|
-
signing_key:
|
170
|
+
rubygems_version: 3.1.2
|
171
|
+
signing_key:
|
173
172
|
specification_version: 4
|
174
173
|
summary: Creates and starts an Android Emulator (AVD)
|
175
174
|
test_files: []
|